Ensure you have the following installed:
To start the project using Docker, run:
docker compose up -d
Once the services are up, run database migrations using:
docker compose exec control-plane node ace migration:run --force
To stop the services, run:
docker compose down
Integration tests are defined in the platform
application. The playwright UI
can be started with the following command:
docker compose exec platform \
npx playwright test --project=firefox --ui-host=0.0.0.0 --ui-port=39709
The UI is then accessible on http://localhost:39709
AdonisJS offers an application-aware REPL to interact with the control-plane from the command line. To start a new REPL session in a development environment with docker-compose, run the following command:
docker compose exec control-plane node ace repl
The project comes with a token preconfigured for the worker user. The token might not be valid for a few different reasons:
- The AdonisJS application key (the
APP_KEY
environment variable) has been changed - The token has expired (expiry scheduled in 2035)
The following command (executed in a REPL session) allows to regenerate a token for the worker user. The command can also be tweaked to generate a token for a different user or for a different expiry. Be wary of using it in prod as generating a long-lived token may be a security threat if the token is exposed outside a controlled, private network.
(await (await import('#models/user')).default.accessTokens.create(await (await import('#models/user')).default.findByOrFail({ email: 'worker@france-nuage.fr' }), ['*'], { expiresIn: '10 years' })).value.release()