DojoBackendAPI
Development environment
Env vars
You can decrypt env var stored in the .env.vault
file with the following commands in the ExpressAPI
folder:
> npx dotenv-vault local keys
environment DOTENV_KEY
─────────── ─────────────────────────────────────────────────────────────────────────
development dotenv://:key_1234@dotenv.local/vault/.env.vault?environment=development
Set DOTENV_KEY on your server
> npx dotenv-vault local decrypt dotenv://:key_1234@dotenv.local/vault/.env.vault?environment=development > .env.development
The .env.keys
file have to be requested to the project maintainers.
Database
For development, you can use the docker-compose file in the Resources/DevInfra/
folder.
docker-compose -f Resources/DevInfra/docker-compose.yml up -d
This will run a MariaDB database on port 59231
with the following credentials: root:9buz7f312479g6234f1gnioubervw79b8z
A second container is created with the Adminer tool on port 62394
.
Structure creation and seeding
The following command will create the database structure and seed it with some exemple data.
npm run database:deploy:dev