Nestjs Typescript Graphql Api

screenshot of Nestjs Typescript Graphql Api

A containerized boilerplate for a TypeScript-first NestJS backend with code-first GraphQL, JWT (Passport) authentication, MongoDB (MikroORM), and concise (Unit & E2E) tests.

Overview

The NestJS (TypeScript) GraphQL API Boilerplate is a robust framework designed for developers looking to build a scalable backend solution. Leveraging the power of TypeScript, this boilerplate brings together a suite of modern technologies and practices, including code-first GraphQL, JWT authentication, and a modular architecture. It combines the use of MikroORM for MongoDB support and offers comprehensive testing capabilities, making it a great starting point for any TypeScript-first backend project.

With containerization using Docker and continuous integration via GitHub Actions, this boilerplate is set up for seamless deployment and maintenance. It simplifies the setup process and allows developers to focus on building feature-rich applications rather than worrying about the underlying infrastructure.

Features

  • Code-first GraphQL: Integrates with Apollo Sandbox, allowing developers to easily build and test GraphQL APIs in an intuitive environment.

  • Persistence with MikroORM: Utilizes MikroORM as a MongoDB driver, providing a straightforward and efficient approach to database interactions.

  • Comprehensive Testing Suite: Built-in support for unit and end-to-end tests using Vitest, ensuring code quality and stability throughout development.

  • JWT Authentication: Easily implement JWT authentication using NestJS with Passport, enhancing the security of your API.

  • Domain-driven Architecture: Organized file structure designed for scalability and maintainability, catering to modern development practices.

  • Environment Configuration: Supports environment variables through dotenv, allowing for easy configuration based on different deployment environments.

  • Strong Typing and Validation: Harnesses TypeScript's strong typing along with class-validator for data validation, reducing runtime errors and ensuring data integrity.

  • Containerization with Docker: The entire application is containerized, simplifying deployment and enabling consistency across development and production environments.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

graphql
Graphql

A website that uses GraphQL as a query language to manage data fetching and state management. This includes features such as a strongly typed schema, client-side caching, and declarative data fetching to streamline data management and optimize website performance.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.