A production-ready full-stack admin platform built with Next.js
English · 中文 · Documentation· Website · Demo
- 🔐 Authentication - Email/password + OAuth (Google, GitHub) via Better Auth
- 👥 RBAC System - Role-based access control with permissions and menus
- 📊 Admin Dashboard - Configuration-driven CRUD with SmartCrudPage
- 📝 Action Logging - Comprehensive audit trail for all operations
- 📁 Asset Management - File upload and manage with Cloudflare R2 support
- 🌐 i18n Ready - Multi-language support via next-intl
- 🎨 Modern UI - Ant Design + ProComponents
| Category | Technology |
|---|---|
| Framework | Next.js 16 (App Router) |
| Database | PostgreSQL + Prisma |
| Authentication | Better Auth |
| UI Components | Ant Design, ProComponents |
| Styling | Tailwind CSS |
| Language | JavaScript (ES6+) |
- Node.js 20.9+
- PostgreSQL 16+
- bun (recommended) / pnpm / npm / yarn
# Clone the repository
git clone https://github.com/huglemon/nextjs-base.git
cd nextjs-base
# Install dependencies
bun install
# Configure environment
cp .env.example .env.local
# Initialize database and create admin
bun run init
# Start development server
bun run devOpen http://localhost:3000 to see the application.
# Database (Required)
DATABASE_URL="postgresql://user:password@localhost:5432/nextjs_base"
# Better Auth (Required)
BETTER_AUTH_SECRET="your-secret-key-at-least-32-characters"
BETTER_AUTH_URL="http://localhost:3000"
# OAuth (Optional)
GOOGLE_CLIENT_ID=""
GOOGLE_CLIENT_SECRET=""
GITHUB_CLIENT_ID=""
GITHUB_CLIENT_SECRET=""
# Cloudflare R2 (Optional - for file uploads)
R2_ACCOUNT_ID=""
R2_ACCESS_KEY_ID=""
R2_SECRET_ACCESS_KEY=""
R2_BUCKET_NAME=""
R2_PUBLIC_URL=""nextjs-base/
├── app/
│ ├── (admin)/ # Admin panel
│ │ ├── admin/ # Admin pages
│ │ └── actions/ # Server Actions
│ ├── (client)/ # Frontend with i18n
│ │ └── [locale]/ # Language routes
│ └── api/ # API routes
├── components/
│ ├── admin/ # Admin components (SmartCrudPage, SmartForm)
│ └── ui/ # Base UI components
├── lib/
│ ├── auth/ # Authentication
│ ├── core/ # Core utilities (wrapAction, createCrudActions)
│ └── database/ # Prisma client
├── prisma/
│ └── schema.prisma # Database schema
└── docs/ # Documentation
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a branch from
develop:git checkout -b feature/your-feature - Make your changes
- Submit a Pull Request to
develop
This project is licensed under the MIT License - see the LICENSE file for details.
Join our community for discussions, questions, and updates!
*Scan to add me on WeChat, then I'll invite you to the group*
- Next.js - The React Framework
- Prisma - Next-generation ORM
- Better Auth - Authentication library
- Ant Design - UI component library
Built with ❤️ by huglemon