Nest Starter Pg Auth

screenshot of Nest Starter Pg Auth
nestjs

NestJS REST API Starter with Postgres, Passport Local and Social Auth

Overview

The NestJS REST API Starter with Postgres, Passport Local and Social Auth is a starter kit designed to help developers quickly set up a REST API using NestJS. It comes pre-configured with a PostgreSQL database, authentication using Passport Local and social auth providers (Google, Facebook, Twitter, and Github), and additional features such as user roles, logging, transactional email with Sendgrid, and security headers. The starter kit also includes testing with Jest and linting with ESLint.

Features

  • Postgres with TypeORM: easily connect and interact with a PostgreSQL database using TypeORM.
  • Husky and Lint-staged: set up pre-commit hooks and linting to ensure code quality.
  • ESLint: use ESLint for linting instead of the default TSLint.
  • Expose only intentional fields: automatically control which fields to expose in the API responses using class-validator and ClassSerializerInterceptor.
  • Testing with Jest: write and run tests using the Jest testing framework.
  • User roles: implement user roles and permissions in the API.
  • Logging with Pino: configure logging using Pino and nestjs-pino, with the option to use another logging library.
  • Passport Local: enable local authentication using email and password.
  • Passport JWT: enable JSON Web Token (JWT) authentication.
  • Passport Google, Facebook, Twitter, and Github: integrate social authentication using popular social media platforms.
  • Transactional Email with Sendgrid: send transactional emails using the Sendgrid email service.
  • Helmet: automatically set appropriate HTTP headers for security.
  • CORS: handle Cross-Origin Resource Sharing (CORS) to allow requests from different domains.
  • Events: listen for and handle events in the application.
  • Analytics: (Roadmap) - planned feature.

Summary

The NestJS REST API Starter with Postgres, Passport Local and Social Auth is a comprehensive starter kit for building REST APIs using NestJS. It provides a solid foundation with pre-configured features such as PostgreSQL integration, authentication with Passport for local and social providers, user roles, logging, email sending, security headers, and more. With the included testing framework and linting setup, developers can quickly get started on building robust REST APIs with NestJS.

nestjs
Nest

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

fullstack
Fullstack

A fullstack boilerplate provides a starter application that includes both frontend and backend. It should include database, auth, payments, user roles and other backend services to build a fully featured saas or webapps.

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.

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.