Template project is deployed to the following environments:
If you don't want to use GCP run following command:
rm -rf infra .github/workflows/cd.yml .github/workflows/manual-cd.yml .github/workflows/manual-terraform.yml .github/workflows/terraform.yml
- Fastify branch 🚀
- Vertex AI branch 🤖
- GCP Identity branch 🔐
- Install dependencies:
make install
(the project uses yarn) - Create local environment file:
cp .env.template .env
- Run infrastructure
make infra
(.db/init/init.sql
should automatically createapi_db
database) - Run database migrations:
make migration-run
Note: if you want to run with docker, don't forget to change DATABASE_HOST=0.0.0.0
to DATABASE_HOST=database
in .env
file.
Because of node bindings (swc
, bcrypt
) we can't share node_modules between host and docker container. To solve this issue we have to restart the container every time we install new package.
make develop-dockerized
make infra
- start postgres docker containermake develop
- start development servermake type-check
- run type checkingmake lint
- run lintermake format
- run prettier
make seed-database
- truncate all tables and seed database with initial datamake migration-create name=<migration-name>
- create new empty migration filemake migration-generate name=<migration-name>
- generate migration file based on the current schema diffmake migration-run
- run all pending migrationsmake migration-revert
- revert last migrationmake schema-drop
- drop all tables
classDiagram
direction LR
refresh_token --> user : userId.id
class migrations {
bigint timestamp
varchar name
integer id
}
class refresh_token {
varchar value
varchar ipAddress
timestamp createdAt
timestamp updatedAt
integer userId
integer id
}
class user {
varchar email
varchar firstName
varchar lastName
varchar password
user_role_enum role
timestamp createdAt
timestamp updatedAt
timestamp deletedAt
integer id
}
Most of the tests are E2E tests, which means that they are testing the whole application, including the database. For that.
make test
- run all tests
ci.yml
- lints and runs tests on every pull request.
For more information about the infrastructure setup, please refer to the infra documentation.