Skip to content

Oldwarma/nextjs-base

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NextJS Base

A production-ready full-stack admin platform built with Next.js

License: MIT Node.js Version Next.js

English · 中文 · Documentation· Website · Demo


✨ Features

  • 🔐 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

🛠️ Tech Stack

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+)

🚀 Quick Start

Prerequisites

  • Node.js 20.9+
  • PostgreSQL 16+
  • bun (recommended) / pnpm / npm / yarn

Installation

# 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 dev

Open http://localhost:3000 to see the application.

Environment Variables

# 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=""

📁 Project Structure

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

📖 Documentation

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Quick Links

Development Workflow

  1. Fork the repository
  2. Create a branch from develop: git checkout -b feature/your-feature
  3. Make your changes
  4. Submit a Pull Request to develop

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

💬 Community

Join our community for discussions, questions, and updates!

*Scan to add me on WeChat, then I'll invite you to the group*

🙏 Acknowledgments


⬆ Back to Top

Built with ❤️ by huglemon

About

A production-ready full-stack admin platform built with Next.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 98.7%
  • CSS 1.3%