Skip to content

About

๐Ÿš€ Enterprise NestJS Admin Template built with NestJS, Prisma, MySQL, Redis, JWT Authentication, RBAC, Swagger and Docker.

Topics

Resources

Stars

22 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

147 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

GVRAY Admin

็ฎ€ไฝ“ไธญๆ–‡ | English

๐Ÿš€ An enterprise-grade admin backend scaffold built on NestJS 11, TypeScript, Prisma, MySQL, and Redis, with built-in RBAC permissions, JWT authentication, Swagger/OpenAPI, Docker deployment, and AI-assisted development support โ€” ready to use as a Starter Template for enterprise backend projects.

Light Theme Dark Theme

โœจ Highlights

  • ๐Ÿ” RBAC Permission System โ€” dynamic permission scanning, menu permissions, API permissions, and permission caching out of the box
  • ๐Ÿ›ก๏ธ JWT Dual-Token Auth โ€” Access Token / Refresh Token, Passport, bcrypt password hashing
  • โšก Deep Redis Integration โ€” session management, online users, rate limiting, distributed locks, Pub/Sub, declarative caching
  • ๐Ÿ—๏ธ NestJS 11 + TypeScript โ€” modular architecture, dependency injection, strict type checking
  • ๐Ÿ“ Prisma 6 ORM โ€” type-safe queries, full support for migrations / seeds / transactions
  • ๐Ÿ“„ Swagger / OpenAPI โ€” auto-generated docs, online debugging with Bearer Token
  • ๐Ÿข Organization Structure โ€” complete system for users / roles / departments / positions
  • ๐Ÿ”‘ Multi-Method Login โ€” username, email, phone number, User ID
  • ๐Ÿ›ก๏ธ Security Hardening โ€” CORS, unified exception handling, parameter validation, log redaction, password hashing
  • ๐Ÿณ Docker First โ€” dev / test / production configurations with rolling updates
  • ๐Ÿค– AI Ready โ€” built-in CLAUDE.md and modular knowledge base, works directly with Claude Code / Cursor / Copilot
  • ๐ŸŽฏ Standardized Engineering โ€” ESLint, Prettier, unified response format, complete seed data

๐Ÿ› ๏ธ Tech Stack

NestJS 11 ยท Prisma 6 ยท TypeScript 5 ยท MySQL 8 ยท Redis 6 ยท Swagger ยท Docker

๐Ÿš€ Quick Start

Requirements

  • Node.js >= 20
  • pnpm >= 9 (built into Corepack, run corepack enable)
  • MySQL >= 8.0
  • Redis >= 6.0
  • Docker (optional)
git clone https://github.com/gvray/gvray-admin.git && cd gvray-admin

pnpm install
cp .env.example .env

# Option 1: Start MySQL + Redis via Docker
docker compose -f docker-compose.dev.yml up -d mysql redis

# Option 2: Use an existing local MySQL + Redis, configure .env and skip the previous step

pnpm prisma migrate dev
pnpm prisma db seed
pnpm start:dev
  • App: http://localhost:3000
  • Swagger: http://localhost:3000/api (click Authorize and enter Bearer <accessToken>)

๐Ÿ‘ค Default Accounts

โš ๏ธ For local development only โ€” do not use in production.

Role Username Email Password
Super Admin super_admin super@example.com 123456
Admin admin admin@example.com 123456
Guest guest guest@example.com 123456

๐Ÿ“ Project Structure

src/
โ”œโ”€โ”€ core/       # Infrastructure (decorators / guards / interceptors / filters / pipes)
โ”œโ”€โ”€ modules/    # Business modules (auth / system / dashboard / profile)
โ”œโ”€โ”€ prisma/     # Prisma Module / PrismaService
โ”œโ”€โ”€ redis/      # Redis infrastructure (cache / rate limiting / distributed locks)
โ”œโ”€โ”€ shared/     # Shared layer (constants / DTOs / utils / BaseService)
โ””โ”€โ”€ main.ts

prisma/         # Schema + migrations + seed
docs/           # Project documentation
docker/         # Docker deployment config
.claude/        # AI knowledge base

๐Ÿ“– Full project structure โ†’

โ“ Why GVRAY Admin

Typical NestJS starters only give you a skeleton โ€” the parts an enterprise project actually needs, you still have to build yourself.

Typical Starter GVRAY Admin
RBAC permissions + dynamic scanning โœ— โœ…
JWT dual-token + refresh โœ— โœ…
Redis rate limiting / distributed locks โœ— โœ…
Full org structure (departments/positions) โœ— โœ…
Swagger auto-docs Basic โœ… with online debugging
Docker three-environment setup โœ— โœ…
AI assistant context โœ— โœ…
Standardized structure + seed data โœ— โœ…

๐Ÿ—บ๏ธ Roadmap

  • JWT dual-token authentication
  • RBAC permission system + dynamic scanning
  • Prisma ORM + complete seed
  • Deep Redis integration
  • Swagger / OpenAPI
  • Docker three-environment deployment
  • User / role / department / position management
  • Menu management
  • System configuration items
  • Dictionary management
  • Announcements & notifications
  • Operation logs / login logs
  • Online users
  • System monitoring (server / cache)
  • WebSocket real-time notifications
  • Scheduled tasks
  • File storage
  • Multi-tenancy
  • OpenTelemetry
  • Kubernetes deployment

๐Ÿค– AI Programming Support

  • CLAUDE.md โ€” Claude Code auto-loaded entry point
  • .claude/project/ โ€” on-demand knowledge base (architecture / DTO / permissions / response format)

๐Ÿ“– AI Development Guide โ†’

๐Ÿ“š Documentation

Document Description
๐Ÿ“– Feature List Complete feature modules and progress
๐Ÿณ Docker Deployment Guide Dev / test / production deployment, rolling updates
๐Ÿ“‹ Unified Response Format API response specification
โš™๏ธ System Configuration Frontend/backend config mapping
๐Ÿ—๏ธ Project Structure Details Directory structure and module descriptions
๐Ÿงช API Testing Guide Swagger debugging and auth flow

๐ŸŒ Companion Frontend

๐Ÿค Contributing

Issues, PRs, and feature suggestions are all welcome. If this project helps you, a โญ Star is the best support!

This project is open-sourced under the MIT License.

About

๐Ÿš€ Enterprise NestJS Admin Template built with NestJS, Prisma, MySQL, Redis, JWT Authentication, RBAC, Swagger and Docker.

Topics

Resources

Stars

22 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages