Skip to content

Latest commit

 

History

History
142 lines (98 loc) · 3.49 KB

File metadata and controls

142 lines (98 loc) · 3.49 KB

Nx Full Stack Authentication – Monorepo Starter

Nx TypeScript NestJS React License

📌 Overview

This project is a full-stack authentication system built using an Nx monorepo architecture, designed with enterprise-grade structure and scalability in mind.

The goal is not just to implement login and registration, but to provide a clean, modular and reusable architecture for real-world applications.

It demonstrates:

  • Proper monorepo organization
  • Clear frontend/backend separation
  • Shared type-safe contracts
  • Database schema management with Drizzle ORM
  • JWT-based authentication
  • Structured technical documentation

🏗 Architecture

Organized as an Nx monorepo:

  • apps/web → React frontend
  • apps/api → NestJS backend
  • libs/api/db → Database schema and configuration (Drizzle)
  • libs/shared/contracts → Shared contracts between frontend and backend
  • libs/web/auth → Authentication logic
  • libs/web/auth-ui → Reusable UI components

Design principles:

  • Modularity
  • Separation of concerns
  • Shared typed contracts
  • Future scalability

⚙️ Tech Stack

  • Nx – Monorepo orchestration
  • React – Frontend
  • NestJS – Backend
  • TypeScript – Static typing
  • Drizzle ORM – Database access
  • PostgreSQL – Database
  • JWT – Authentication
  • pnpm – Package manager
  • shadcn/ui + daisyUI – UI system

🚀 Implemented Features

Authentication

  • User registration with validation
  • JWT-based login
  • Remember me
  • Protected routes
  • Logout
  • Password recovery (UI)

Dashboard

  • Authenticated user area
  • Profile editing
  • Access logs (last 5 logins)
  • Avatar upload

Backend

  • Input validation
  • Secure password hashing
  • JWT middleware
  • Database migrations with Drizzle

🔐 Security & Future Improvements

  • Brute-force protection
  • Image metadata stripping (GDPR compliance)
  • Extended backend test coverage
  • Social authentication
  • Full password recovery flow

🛠 Installation

pnpm install
pnpm nx serve web
pnpm nx serve api

Documentation

The project documentation is organized modularly in the docs/ folder:

The structure is fully available in Italian as well (docs/it/).


🎯 Project Purpose

This repository serves as:

  • Nx full-stack architecture showcase
  • Authentication starter template
  • Enterprise-ready structural example