docker compose pull
docker compose up --detach --remove-orphansdocker compose exec phpfpm composer installDefine default local settings:
cp config/services.local.yaml.dist config/services.local.yamlEdit config/services.local.yaml as needed (cf. Mocks).
Set up database:
docker compose exec phpfpm bin/console doctrine:migrations:migrate --no-interactionCreate super administrator:
docker compose exec phpfpm bin/console user:create [email protected]
docker compose exec phpfpm bin/console user:promote [email protected] ROLE_SUPER_ADMIN
docker compose exec phpfpm bin/console user:set-password [email protected]Create administrator:
docker compose exec phpfpm bin/console user:create [email protected]docker compose exec phpfpm bin/console user:promote [email protected] ROLE_ADMINCreate user:
docker compose exec phpfpm bin/console user:create [email protected]Open the site:
open "http://$(docker compose port nginx 8080)"docker compose exec phpfpm composer update-translations
# Open Danish translations in Poedit (https://poedit.net/)
# Run `brew install poedit` to install Poedit.
open translations/messages+intl-icu.da.xlfdocker compose run --rm node yarn install
docker compose run --rm node yarn buildDuring development, use
docker compose run --rm node yarn watchto watch for changes.
Load fixtures to populate your test database:
docker compose exec phpfpm composer fixtures:loadAfter loading fixtures, the following users exist (cf. fixtures/user.yaml):
| Password | Roles | API key | |
|---|---|---|---|
[email protected] |
password |
ROLE_SUPER_ADMIN | |
[email protected] |
user-password |
ROLE_USER | user-api-key |
The app:aeos:code-cleanup console command can be used to delete expires codes:
bin/console app:aeos:code-cleanup --helpA couple of commands can clean up guest and apps
bin/console app:expire-guests
bin/console app:expire-inactive-apps --app-sent-before='-24 hours'Set up a cron job to have expired codes deleted daily at 02:00
(adjust paths to match your actual setup):
0 2 * * * /usr/bin/php /home/www/dokk1gh/htdocs/bin/console --env=prod app:aeos:code-cleanupA user can create an API key via the user menu: @TODO
API documentation:
open "http://$(docker compose port nginx 8080)/api/doc"In the following examples, the API key of the fixture user [email protected] is
used.
Get a list of templates available to the user:
curl --silent --header "Authorization: Bearer user-api-key" "http://$(docker compose port nginx 8080)/api/templates"Get list of codes created by user:
curl --silent --header "Authorization: Bearer user-api-key" "http://$(docker compose port nginx 8080)/api/codes"An administrator can get all codes by adding all=1:
curl --silent --header "Authorization: Bearer user-api-key" "http://$(docker compose port nginx 8080)/api/codes?all=1"Create a code:
curl --silent --silent --header "Authorization: Bearer user-api-key" "http://$(docker compose port nginx 8080)/api/codes" --header "content-type: application/json" --data @- <<'JSON'
{
"template": 1,
"startTime": "2017-08-14T08:00:00+02:00",
"endTime": "2017-08-14T16:00:00+02:00"
}
JSONOn success the result will look like this:
{
"status" : "ok",
"code" : "21347994",
"endTime" : "2017-08-14T16:00:00+0200",
"startTime" : "2017-08-14T08:00:00+0200",
"template" : {
"name" : "Gæst ITK",
"id" : 1
}
}Debug email sent to user when created:
bin/console app:debug notify-user-created [user email]e.g.
bin/console app:debug notify-user-created [email protected]Open test mail UI:
open "http://$(docker compose port mail 8025)"docker compose exec phpfpm bin/console doctrine:schema:update --em=mock --force --completeUse this during local testing and development.
# config/services.local.yaml
parameters:
aeos_location: 'http://nginx:8080/mock/aeosws'
aeos_username: null
aeos_password: null-
List mock AEOS templates to use when editing templates:
open "http://$(docker compose port nginx 8080)/admin/api/templates" -
List mock AEOS users to use when editing users:
open "http://$(docker compose port nginx 8080)/admin/api/people"
See messages sent to the mock AEOS web service:
open "http://$(docker compose port nginx 8080)/mock/aeosws/log"Show only the latest message:
open "http://$(docker compose port nginx 8080)/mock/aeosws/log/latest"Use this during local testing and development.
https://pushapi.ecmr.biz/docs/index.html?url=/swagger/v1/swagger.json#tag/SMS-gateway
curl --verbose --location "$(docker compose port nginx 8080)/mock/sms2go/sms2go-gateway-id" --header "authorization: Bearer sms2go-api-key" --header "content-type: application/json" --data @- <<'JSON'
{
"body":"Hello!",
"to": [
"4512345678"
]
}
JSONThe values sms2go-gateway-id and sms2go-api-key above must match the values
of the SMS2GO_GATEWAY_ID and SMS2GO_API_KEY environment variables.
See messages sent to the mock SMS gateway:
open "http://$(docker compose port nginx 8080)/mock/sms/log"Show only the latest message:
open "http://$(docker compose port nginx 8080)/mock/sms/log/latest"Clear out the acceptance test cache and set up the database:
SYMFONY_ENV=acceptance bin/console cache:clear --no-warmup
SYMFONY_ENV=acceptance bin/console cache:warmup
SYMFONY_ENV=acceptance bin/console doctrine:database:createRun API tests:
./vendor/bin/behatdocker compose exec phpfpm composer coding-standards-apply
docker compose exec phpfpm composer coding-standards-checkdocker compose run --rm node yarn install
docker compose run --rm node yarn coding-standards-apply
docker compose run --rm node yarn coding-standards-checkdocker compose exec phpfpm vendor/bin/rector processdocker compose exec phpfpm composer code-analysis