WebUi

Database Setup and Configuration

This document explains how to set up and configure the database for development and testing purposes.

Development Database Setup

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:

Option 2: Local MariaDB Installation

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.

Testing Database Setup

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:

Database Seeding and Configuration

Development Seeding

For development purposes, you can seed the database with mock data by setting forceSeed to true in your configuration.

Important Notes:

Migrations

Database 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.

Current Status

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.

Database Management Commands