Skip to content

Database

The project uses SQLite, a relational database written in C that generates a local file. This means you don’t need to install any additional software to handle the structure and storage of data.

Additionally, the project uses an ORM (Object-Relational Mapping) called Prisma, which allows us to interact with the database without needing to write SQL queries and define the structures of tables and their relationships in an easier language.

If you want to fork the project and make any changes to the models, you will need to perform migrations in the database so that the new columns/tables are inserted.

When making any changes to the apps/api/src/infrastructure/prisma/schema.prisma file, run (inside the project’s API folder) the following command:

Terminal window
bun run db:migrate --name <name-of-change>

This will create a migration file that should be committed.

Resetting the Database

If you want to clear the database and reinsert the original data, you can use the command:

Terminal window
bun run db:reset

Viewing the Data

If you want to see the database in a dashboard, you can launch Prisma Studio:

Terminal window
bun run studio