User Management API

Production Ready

User Management API

A production-grade REST API for comprehensive user management with authentication, RBAC, 2FA, and enterprise security features.

Quick Start

# Clone and setup
cd backend && npm install

# Configure environment
cp .env.example .env

# Run migrations and start
npm run db:migrate && npm run dev

Base URL: http://localhost:5001/api/v1

Core Features

JWT Authentication
Access/refresh tokens with 15-min expiry
Two-Factor Auth
TOTP with QR codes & backup codes
Role-Based Access
14 granular permissions
Session Management
Track & revoke across devices
Admin Dashboard
User search, impersonation
Audit Logging
Complete activity tracking
Notifications
In-app notification system
Health Checks
K8s ready endpoints

Tech Stack

FastifyTypeScriptPrismaPostgreSQLJWTZodbcrypt

API Endpoints

/api/v1/auth/*Authentication
/api/v1/users/*User Profile
/api/v1/2fa/*Two-Factor Auth
/api/v1/sessions/*Sessions
/api/v1/admin/*Admin Panel
/api/v1/roles/*RBAC
/api/v1/audit/*Audit Logs