This repository contains:
- Frontend for members.dsek.se
- Backend for graphql.api.dsek.se
- File server for minio.api.dsek.se
- Install Docker
- Install nodejs (version 16) and npm (development only)
- (recommended) Visual studio code for typescript and the eslint extension (development only)
Run the following command to setup everything (UNIX-based systems):
./dev.sh
If you want to learn more about what this does under the hood, you can check out our build details
To run tests locally you have to run the /backend/services/core/setup_test_db.sh
bash script to setup the test db.
First time using pg Admin you need to connect it to the database. To do this add a new server with the following options: Name: (Can be whatever) Username (POSTGRES_USER from .env) Password (POSTGRES_PASSWORD from .env) Host: host.docker.internal Port: 5432
To make changes to the database, you will have to write a migration.
Run the command
npm run migrate:make migration_name
to generate a new migration file at
backend/services/core/migrations/DATETIME_migration_name
When you are done writing your migration, you can execute the migration locally by running the command
(in backend/services/core)
npm run dev:migrate
You can also seed data by editing the file
backend/services/core/seeds/data.ts
Additionally you can rollback your migration with the command
npm run migrate:rollback
We use gitmoji for our commit messages since it provides an easy way of identifying the purpose or intention of a commit with only looking at the emojis used.
npm i -g gitmoji-cli
Initialize gitmoji as a commit hook
gitmoji -i
The next time you commit gitmoji will ask you to pick a suitable emoji.