This document explains how to set up and configure the database for development and testing purposes.
There are two ways to set up a database for development:
The easiest way to get started is using Docker with the default configuration:
npm run docker-dev
This command will:
For a local MariaDB setup, you’ll need to install MariaDB on your system first.
Installation Guide: MariaDB Getting Started
After installing MariaDB locally, configure your application to connect to your local database instance by updating the appropriate configuration files.
For running tests, Docker must be installed and running on your system.
To set up the test database:
npm run docker-test
This command will:
For development purposes, you can seed the database with mock data by setting forceSeed to true in your configuration.
Important Notes:
forceSeed is enabled, seeding will execute every time the server reloadsdrop property will clean all data from the database if set to true every time the server reloadsDatabase migrations will be executed automatically if they haven’t been run before.
Clean Setup Recommendation: For a completely clean database setup, it’s recommended to run:
docker compose down database -v
And delete all existing data.
WARNING: Only perform this clean setup the first time or when you specifically need to reset everything, as it will permanently delete all database data.
Important: The database is currently not being used by the application or tests, as the services and controllers are not yet configured to utilize the database layer. This functionality is planned for future implementation.
npm run docker-dev - Start development databasenpm run docker-test - Start test database with mock datadocker compose down database -v - Clean database setup (removes all data)