Nest Starter

screenshot of Nest Starter
nestjs

NestJS RESTful API starter for minimalists

Overview:

The NestJS Starter is a RESTful API starter built with the NestJS framework. It includes features such as JWT authentication, Open API 3 documentation, and TypeORM integration. The purpose of this starter is to allow developers to quickly build a production-ready RESTful API with minimal boilerplate code.

Features:

  • JWT Authentication: Configured authentication using JSON Web Tokens (JWT).
  • OpenAPI 3 Documentation: Includes OpenAPI 3.0 configuration for API documentation.
  • TypeORM Integration: Integrated TypeORM for database operations.
  • DB Migrations: Allows for incremental database migrations to keep the database structure in sync with the code base.
  • Environment Configuration: Utilizes @nestjs/config for easy configuration and reading of environment variables.
  • Modular Design: Built with a modular approach, making it easy to add new features or extend the existing functionality.
  • HMR (Hot Module Reload): Configured HMR with Webpack for faster development and code updates.

DB Migrations:

The NestJS Starter includes support for database migrations. To generate a new migration, run the following command:

npx ts-node node_modules/typeorm/cli.js migration:generate -n MigrationName

Or if using docker:

docker-compose run --rm app npx ts-node node_modules/typeorm/cli.js migration:generate -n MigrationName

Migration files will be placed under the src/migrations directory. To run pending migrations, use the following command:

npx ts-node node_modules/typeorm/cli.js migration:run

To revert the last migration, use the following command:

npx ts-node node_modules/typeorm/cli.js migration:revert

API Documentation:

The NestJS Starter includes OpenAPI 3.0 configuration for API documentation. The API documentation is hosted at BASE_URL/api/docs.

Authentication:

JWT authentication is already configured in the NestJS Starter. However, it is recommended to change the current password hashing mechanism to something more secure.

Summary:

The NestJS Starter is a powerful boilerplate for building RESTful APIs using the NestJS framework. It provides features such as JWT authentication, OpenAPI 3 documentation, and TypeORM integration. With its modular design and easy installation process, developers can quickly set up and start building production-ready APIs with minimal effort and code duplication.

nestjs
Nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript.

template
Templates & Themes

A template or theme refers to a pre-designed layout or structure that provides a basic framework for building a specific type of application or website. It typically includes good design, placeholder content and functional features, allowing developers to customize and fill in the details according to their specific needs.

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.