Nestjs Auth Jwt

screenshot of Nestjs Auth Jwt

A sample NestJS application, demonstrating how to use JWT Authentication, with short lived access tokens, and long lived refresh token.

Overview

NestJS is quickly becoming a favorite among developers who need a robust framework for building server-side applications. This sample NestJS application showcases JWT Authentication, providing both short-lived access tokens and long-lived refresh tokens. It's designed with a strong architectural foundation, making it easy for developers to understand and extend. As you navigate through the code, you'll appreciate its thorough documentation and the community-driven opportunities for comments and pull requests.

With its focus on security and future-proofing the app through a roadmap that includes third-party authentication and Redis caching, this application serves as an excellent starting point for those looking to incorporate token-based authentication in their projects.

Features

  • JWT Authentication: Implement secure authentication using JSON Web Tokens for efficiently managing user sessions.
  • Access and Refresh Tokens: Utilize short-lived access tokens paired with long-lived refresh tokens to enhance security and user experience.
  • Opinionated Architecture: Built with clear organizational principles, making it easy for other developers to contribute and understand the structure.
  • Swagger Documentation: Access rich API documentation quickly via the Swagger UI, located at the app's dedicated endpoint.
  • Extensible Roadmap: Plans for future enhancements, including integration with third-party providers like Facebook, Google, and Twitter.
  • In-memory Token Blacklist: Current implementation supports in-memory storage for blacklisted access tokens, with future plans for Redis caching.
  • Open Source License: The application is licensed under MIT, encouraging community use and contributions.
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.

webpack
Webpack

Webpack is a popular open-source module bundler for JavaScript applications that bundles and optimizes the code and its dependencies for production-ready deployment. It can also be used to transform other types of assets such as CSS, images, and fonts.