This is the official repository for the NestJS GraphQL API, a robust backend service designed to offer efficient data handling and operations for web and mobile applications.
This project is structured to facilitate development, testing, and deployment of a GraphQL-based API using NestJS, a progressive Node.js framework. The API is built with a focus on performance, scalability, and ease of use, incorporating various modern tools and practices.
Nest.js |
PostgreSQL |
Drizzle ORM |
GraphQL |
Clerk |
Sentry |
AWS |
Docker |
src/
: The main source directory containing the application logic.config
: Configuration files and environment variables.drizzle
: Drizzle schema, migration and other related files for database management.graphql
: GraphQl module for handling queries and mutations.
test/
: Contains unit and e2e tests for the application.dist/
: The output directory for the compiled application.
- NestJS for creating scalable server-side applications.
- GraphQL for efficient and flexible data queries.
- TypeScript for static type checking.
- Drizzle ORM for database access and management.
- Docker for containerization and easy deployment.
- Sentry for real-time error tracking and monitoring.
- AWS for cloud-based resources and logging with CloudWatch.
- GraphQL API: Offers a powerful, flexible API for querying and mutating data.
- CRUD Operations: Simplified data manipulation with CRUD operations.
- Authentication and Authorization: Secure access to the API with integrated authentication and authorization mechanisms.
- Logging and Monitoring: Integrated logging and monitoring for easy debugging and performance tracking.
- Sentry account setup (in order to provide SENTRY_DNS env variable)
- Clerk account setup (in order to provide CLERK_SECRET_KEY env variable)
- AWS account setup (in order to provide AWS's env variables)
- CloudWatch is currently implemented for Logging. If you want, it can be disabled or replaced (code update required)
Clone the repository and install dependencies:
git clone git@github.com:maurim96/nestjs-graphql-scaffold.git
cd nestjs-graphql-scaffold
npm install
Ensure you have Node.js and Docker installed on your machine. Then follow these steps to set up the project for development:
- Install dependencies:
npm install
- Start the development database with Docker Compose:
npm run db:setup:dev
- Apply database migrations:
npm run db:migrate:pg
- Start the development server with hot reload:
npm run start:dev
To run tests, use the following commands:
- For unit tests:
npm test
- For e2e tests:
npm run test:e2e
- To watch tests:
npm run test:watch
Build the application for production by running:
npm run build
Then start the production server:
npm run start:prod
You may notice the codebuild/
directory. This is because it's ready to be connected with a CodePipeline (AWS) setup. For more information you may refer to the official docs.
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch for your feature or fix.
- Commit your changes with clear, descriptive messages.
- Push your changes and submit a pull request.
Please adhere to the coding standards and commit message guidelines provided in the repository.
This project is UNLICENSED. Feel free to use it according to the terms of the license.