- A bare bones NodeJS using Nest, Typescript and Prisma
- Scripts to deploy the application to AWS using Terraform & Terragrunt
- Common Github Actions for CI/CD
- NodeJS, ideally via a NodeJS version manager
- Docker
- If you are working on infrastructure components you might need to setup your environment as explained here
- Clone this repo
git@github.com:onlyfyio/ecs-rds-nest-tf-template.git
- Run the install script
bash scripts/install.sh
- Follow the instructions
cd
into your new copy
git clone git@github.com:onlyfyio/ecs-rds-nest-tf-template.git
bash scripts/install.sh
LC_ALL=C find . -type f -name '*.*' -exec sed -i '' s/your-service-name/new-service-name/g {} +
- Check more details in here
We provide a Brewfile for all necessary dependencies:
brew bundle
Notice: NodeJS is not included in the Brewfile
as typically this is installed in many different ways by preferences of developers.
For digging deeper in infrastructure topics please refer to our guides in https://github.com/onlyfyio/bss
$ yarn install
Start local services:
make install
make start
# development
$ yarn run start
# watch mode
$ yarn run start:dev
# production mode
$ yarn run start:prod
# unit tests
$ yarn run test
# e2e tests
$ yarn run test:e2e
# test coverage
$ yarn run test:cov
Add the changes that you want in prisma/schema.prisma
. To generate a new migration file run:
Once this file was changed, modify the DATABASE_URL
from your .env
file tu use the root user and run:
make db-migrate
Add the changes that you want in prisma/schema.prisma
.
Once this file was changed, modify the DATABASE_URL
from your .env
file tu use the root user and localhost instead of database and run:
make create-db-migration NAME=migration_name
When merging to main, a deploy to production is triggered automatically. We can also deploy to preview or sandbox environments by opening a pull request and commenting [deploy-sandbox] or [deploy-preview], this won't trigger any modification to sandbox and preview branches, just deploying the code from the PR.
Actually if code is pushed to preview or sandbox, a deploy will be also triggered. In the future it should be decided if we want to have one approach or both.
Check the infrastructure docs here
Create a PR in the our repo
- Infrastructure changes on modules should be versioned following Semantic Versioning (be careful with breaking changes)
- Be tested in our Playground environments (
preview
andsandbox
) before merging them tomaster