Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base architecture #7

Merged
merged 46 commits into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
4b4e10d
Add adapter base
abnegate Sep 27, 2022
c496b02
Add email base adapter
abnegate Sep 27, 2022
5534b91
Add email message type
abnegate Sep 27, 2022
13f82ef
Add mailgun adapter
abnegate Sep 27, 2022
e4b1c41
Add SMS base adapter
abnegate Sep 27, 2022
cb69920
Add SMS message type
abnegate Sep 27, 2022
c86af93
Add Twilio adapter
abnegate Sep 27, 2022
405fa2c
Add ignore
abnegate Sep 27, 2022
490437d
Add push base adapter
abnegate Sep 27, 2022
76d6515
Add push message type
abnegate Sep 27, 2022
0190b2f
Add FCM adapter
abnegate Sep 27, 2022
3351fd7
Allow mixed body for base request
abnegate Sep 27, 2022
995eaed
Add composer
abnegate Sep 27, 2022
2c545f3
Add mock SMS adapter
abnegate Sep 27, 2022
5a2a8dc
Add composer
abnegate Sep 27, 2022
597a216
Add docker
abnegate Sep 27, 2022
69544d3
Add mock SMS test
abnegate Sep 27, 2022
6c0b334
Add mock email adapter
abnegate Sep 27, 2022
a08c446
Add mock email test
abnegate Sep 27, 2022
bb15edb
Move max message per request function to adapter base
abnegate Sep 27, 2022
915a5f6
Add github workflows + linter
abnegate Sep 27, 2022
d837af7
Lint
abnegate Sep 27, 2022
a60c759
Install deps instead of update
abnegate Sep 27, 2022
604cd24
Fix compose volume mounts
abnegate Sep 27, 2022
5b28933
Fix contributing refs
abnegate Sep 27, 2022
c3a27fb
Keep unit test folder
abnegate Sep 27, 2022
2711fe1
Sleep before tests
abnegate Sep 27, 2022
1f2f407
Structure updates
abnegate Sep 28, 2022
37a693c
Add Msg91 SMS adapter
abnegate Sep 28, 2022
d933a43
Add Telesign SMS adapter
abnegate Sep 28, 2022
93552df
Add Vonage SMS adapter
abnegate Sep 28, 2022
6bbcfe6
Refactor constructor params for clarity
abnegate Sep 28, 2022
1792c51
Add TextMagic SMS adapter
abnegate Sep 28, 2022
2d92286
Update structure
abnegate Sep 28, 2022
1bc7726
Lint
abnegate Sep 28, 2022
bcb67ae
Add Sendgrid email adapter
abnegate Sep 28, 2022
52bc710
Add + to twilio requests
abnegate Sep 28, 2022
3e5eb89
Add curl ext dependency
abnegate Sep 28, 2022
1c91ea8
Update structure
abnegate Sep 28, 2022
a5f707a
Add get message type function
abnegate Sep 28, 2022
cbad65e
Import aliases
abnegate Sep 28, 2022
3d04104
Strip '+' where required
abnegate Sep 28, 2022
e85775a
Update structure
abnegate Sep 28, 2022
68a9c16
Add Twilio Notify SMS adapter
abnegate Sep 28, 2022
249faf9
Add readme
abnegate Sep 29, 2022
b68972f
Add adding new adapter guide
abnegate Sep 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: "🐛 Bug Report"
description: "Submit a bug report to help us improve"
title: "🐛 Bug Report: "
labels: [bug]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out our bug report form 🙏
- type: textarea
id: steps-to-reproduce
validations:
required: true
attributes:
label: "👟 Reproduction steps"
description: "How do you trigger this bug? Please walk us through it step by step."
placeholder: "When I ..."
- type: textarea
id: expected-behavior
validations:
required: true
attributes:
label: "👍 Expected behavior"
description: "What did you think would happen?"
placeholder: "It should ..."
- type: textarea
id: actual-behavior
validations:
required: true
attributes:
label: "👎 Actual Behavior"
description: "What did actually happen? Add screenshots, if applicable."
placeholder: "It actually ..."
- type: textarea
id: version
attributes:
label: "🎲 Version"
description: "What version of are you running?"
validations:
required: true
- type: dropdown
id: operating-system
attributes:
label: "💻 Operating system"
description: "What OS is your server / device running on?"
options:
- Linux
- MacOS
- Windows
- Something else
validations:
required: true
- type: textarea
id: environment
validations:
required: false
attributes:
label: "🧱 Your Environment"
description: "Is your environment customized in any way?"
placeholder: "I use Cloudflare for ..."
- type: checkboxes
id: no-duplicate-issues
attributes:
label: "👀 Have you spent some time to check if this issue has been raised before?"
description: "Have you Googled for a similar issue or checked our older issues for a similar bug?"
options:
- label: "I checked and didn't find similar issue"
required: true
- type: checkboxes
id: read-code-of-conduct
attributes:
label: "🏢 Have you read the Code of Conduct?"
options:
- label: "I have read the [Code of Conduct](https://github.com/utopia-php/messaging/blob/HEAD/CODE_OF_CONDUCT.md)"
required: true
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "📚 Documentation"
description: "Report an issue related to documentation"
title: "📚 Documentation: "
labels: [documentation]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to make our documentation better 🙏
- type: textarea
id: issue-description
validations:
required: true
attributes:
label: "💭 Description"
description: "A clear and concise description of what the issue is."
placeholder: "Documentation should not ..."
- type: checkboxes
id: no-duplicate-issues
attributes:
label: "👀 Have you spent some time to check if this issue has been raised before?"
description: "Have you Googled for a similar issue or checked our older issues for a similar bug?"
options:
- label: "I checked and didn't find similar issue"
required: true
- type: checkboxes
id: read-code-of-conduct
attributes:
label: "🏢 Have you read the Code of Conduct?"
options:
- label: "I have read the [Code of Conduct](https://github.com/utopia-php/messaging/blob/HEAD/CODE_OF_CONDUCT.md)"
required: true
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 🚀 Feature
description: "Submit a proposal for a new feature"
title: "🚀 Feature: "
labels: [feature]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out our feature request form 🙏
- type: textarea
id: feature-description
validations:
required: true
attributes:
label: "🔖 Feature description"
description: "A clear and concise description of what the feature is."
placeholder: "You should add ..."
- type: textarea
id: pitch
validations:
required: true
attributes:
label: "🎤 Pitch"
description: "Please explain why this feature should be implemented and how it would be used. Add examples, if applicable."
placeholder: "In my use-case, ..."
- type: checkboxes
id: no-duplicate-issues
attributes:
label: "👀 Have you spent some time to check if this issue has been raised before?"
description: "Have you Googled for a similar issue or checked our older issues for a similar bug?"
options:
- label: "I checked and didn't find similar issue"
required: true
- type: checkboxes
id: read-code-of-conduct
attributes:
label: "🏢 Have you read the Code of Conduct?"
options:
- label: "I have read the [Code of Conduct](https://github.com/utopia-php/messaging/blob/HEAD/CODE_OF_CONDUCT.md)"
required: true
26 changes: 26 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to appwrite here: https://github.com/utopia-php/messaging/blob/master/CONTRIBUTING.md

Happy contributing!

-->

## What does this PR do?

(Provide a description of what this PR does.)

## Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

## Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

### Have you read the [Contributing Guidelines on issues](https://github.com/utopia-php/messaging/blob/master/CONTRIBUTING.md)?

(Write your answer here.)
18 changes: 18 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Linter"

on: [pull_request]
jobs:
lint:
name: Linter
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 2
- run: git checkout HEAD^2
- name: Run Linter
run: |
docker run --rm -v $PWD:/app composer sh -c \
"composer install --profile --ignore-platform-reqs && composer lint"
19 changes: 19 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Tests"

on: [pull_request]
jobs:
tests:
name: Unit & E2E
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 2
- run: git checkout HEAD^2
- name: Run Tests
run: |
docker compose up -d --build
sleep 5
docker compose exec tests vendor/bin/phpunit
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea
vendor
.phpunit.result.cache
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM composer:2.0 as composer

ARG TESTING=false
ENV TESTING=$TESTING

WORKDIR /usr/local/src/

COPY composer.lock /usr/local/src/
COPY composer.json /usr/local/src/

RUN composer install \
--ignore-platform-reqs \
--optimize-autoloader \
--no-plugins \
--no-scripts \
--prefer-dist

FROM php:8.0-cli-alpine

WORKDIR /usr/local/src/

COPY --from=composer /usr/local/src/vendor /usr/local/src/vendor
COPY . /usr/local/src/

CMD [ "tail", "-f", "/dev/null" ]
44 changes: 44 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "utopia-php/messaging",
"description": "A simple, light and advanced PHP messaging library",
"type": "library",
"keywords": ["php","messaging", "upf", "utopia", "utopia-php", "library"],
"license": "MIT",
"minimum-stability": "stable",
"scripts": {
"test": "vendor/bin/phpunit",
"lint": "vendor/bin/phpcs",
"format": "vendor/bin/phpcbf"
},
"authors": [
{
"name": "Jake Barnby",
"email": "[email protected]"
}
],
"autoload": {
"psr-4": {
"Utopia\\Messaging\\": "src/Utopia/Messaging"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\E2E\\": "tests/e2e",
"Tests\\Unit\\": "tests/unit"
}
},
"require": {
"php": ">=8.0.0",
"ext-curl": "*"
},
"require-dev": {
"phpunit/phpunit": "9.5.*",
"phpmailer/phpmailer": "6.6.*",
"squizlabs/php_codesniffer": "^3.6"
},
"config": {
"platform": {
"php": "8.0"
}
}
}
Loading