API uses NestJS. Please refer to the NestJS documentation for more information.
Environments variables should be in .env file. Any change in this file should be reflected in GitHub Secrets and variables, in the secret API_DEV_VARS API_PROD_VARS or API_DEV_SECRETS API_PROD_SECRETS depending on the environment.
# Generate a resource (CRUD module with everything included)
pnpm dlx @nestjs/cli g resource
# Generate a module
pnpm dlx @nestjs/cli g module MODULE_NAME
# Generate a controller
pnpm dlx @nestjs/cli g controller CONTROLLER_NAME
# Generate a service/provider
pnpm dlx @nestjs/cli g service SERVICE_NAME
# Check the help for more options
pnpm dlx @nestjs/cli generate --helpGenerate a migration:
Example :npm run migrate:generate --migration_name=[MigrationName]Create empty migration:
Example :npm run migrate:create --migration_name=[MigrationName]Run migrations:
Example :npm run migrate:runRevert migrations:
Example :npm run migrate:revertThe API is deployed in GCP CloudRun. The deployment is done automatically by GitHub Actions using Dockerfile.api and follows the next logic:
master branch, deploy-to-dev.yml workflow will deploy to dev environment.production branch, deploy-to-prod.yml workflow will deploy to prod environment.gcloud auth application-default login