Enterprise-Grade Authentication

A production-ready authentication and authorization system built with Next.js, PostgreSQL, and TypeScript. Featuring email/password and Google OAuth authentication.

Features

Email/Password Auth
Secure registration and login with bcryptjs password hashing and comprehensive validation.
Google OAuth
Seamless Google OAuth 2.0 integration with automatic account creation and linking.
Email Verification
Secure email verification with time-limited tokens for confirming user email addresses.
Password Reset
Secure password reset flow with time-limited tokens and validation for account recovery.
Role-Based Access Control
Fine-grained RBAC with default roles (admin, moderator, user) and extensible permissions.
Account Security
Account lockout protection, failed login tracking, and comprehensive audit logging.

Architecture

Backend (4-Layer)

  • ✓ Routes (Next.js API handlers)
  • ✓ Controllers (Request orchestration)
  • ✓ Services (Business logic)
  • ✓ Repositories (Data access)
  • ✓ Domain Models (Entities)
  • ✓ Middleware (Auth/Authorization)

Frontend & Database

  • ✓ React Components (Shadcn UI)
  • ✓ Custom Hooks (useAuth, usePermissions)
  • ✓ TanStack Query (Data fetching)
  • ✓ PostgreSQL Database
  • ✓ Drizzle ORM (Type-safe)
  • ✓ 10 Normalized Tables

Ready to Get Started?

Create an account or sign in to access the full system with all authentication and authorization features.