Skip to content

A full-stack authentication system built with NestJS (backend) and Next.js (frontend), featuring secure user authentication and authorization.

Notifications You must be signed in to change notification settings

richardhosler/nestjs-nextjs-authentication-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NestJS NextJS Authentication Boilerplate

NestJS Next JS TailwindCSS Zod TypeScript Swagger Postgres

A full-stack authentication system built with NestJS (backend) and Next.js (frontend), featuring secure user authentication and authorization.

Features

  • 🔐 Secure JWT-based authentication
  • 👤 User management system
  • 🔄 TypeORM for database management
  • 📝 API documentation with Swagger
  • 🎨 Modern UI with Tailwind CSS
  • ✨ Type-safe API calls using Orval

Security

This application implements several security best practices:

  • Password hashing using bcrypt
  • JWT-based authentication
  • TypeORM for SQL injection prevention
  • Input validation using class-validator
  • Secure HTTP-only cookies

Screenshots

Login Page Register Page User Info

Tech Stack

Backend (RESTful API)

  • NestJS Framework
  • PostgreSQL with TypeORM
  • Passport.js for authentication
  • JWT for token management
  • Class-validator for DTO validation
  • Swagger for API documentation
  • Orval for generated API hooks

Frontend (App)

  • Next.js Framework
  • TailwindCSS for styling
  • React Query for API interaction
  • Zod for form validation
  • React hook form for form handling

Prerequisites

Getting Started

  1. Install dependencies

    yarn install
    
  2. Set up environment variables

    cp .env.example .env
    
  3. Start Application

    yarn turbo dev
    

Documentation

The API documentation can be found at http://[your_url]/docs provided by Swagger

About

A full-stack authentication system built with NestJS (backend) and Next.js (frontend), featuring secure user authentication and authorization.

Topics

Resources

Stars

Watchers

Forks