An example repo demonstrating how to put together a fully containerized modern NestJS CRUD API with some cool/useful features including:
- Docker for containerization
- Database integration with TypeORM
- CQRS using NestJS
- GraphQL using apollo-server-express
- Authentication using Passport
With planned support for:
- User Group/Role Authorization with role-acl
- Email using Sendgrid
- CI/CD with CircleCI
- Automated testing (including integration and regression tests for GraphQL API routes)
- and much more.
- clone the repo
npm install
- Setup temp environment configs
- Run in CLI from project root
./setenv.test.sh
- Imporant: when deploying your app, don't use the
.env
file, set vars in your CI provider or container manager
docker-compose up
- This will spin up Postgres, PGAdmin, and Redis
- To stop them, and remove local volumes:
docker-compose down -v
- Start up app in developer mode (will watch and recompile for changes)
npm run start
- Open browser tab to Postgres Admin for Postgres Admin
- click on "Servers" and then "Object > Create > Server"
- "General > Name" the connection "Test Server"
- click on "Connection" tab:
- Host:
postgres
(network exposed by docker-compose) - Password:
yourPostgresPassword
- Host:
- click on "Save"
- traverse "Servers > Test Server > Databases >
yourPostgresDb
> Schemas > public"