NextDoc is a modern, clean, and powerful documentation management and collaboration platform built with Next.js 16+. It aims to help teams manage knowledge bases and project documentation more efficiently through a premium UI/UX experience.
English | 简体中文
- 🔐 Authentication: Powered by
Better-Auth, supporting email registration, social login (GitHub/Google), password reset, and mandatory email verification. - 📄 Multi-project Management: Create multiple documentation projects with flexible visibility settings (Public, Private, Password protected).
- 📝 Premium Editing Experience: Built-in Markdown editor with real-time preview to meet all creator needs.
- 👥 Role-Based Access Control (RBAC): Three-tier roles including Admin, Editor, and Viewer.
- 🎨 Modern UI: Built with the latest Tailwind CSS 4.0 and Shadcn UI, featuring a sleek and premium Dark Mode.
- 📧 Email System: SMTP configuration for sending verification emails and password recovery links.
- 🛠️ Admin Dashboard: Integrated management panel to easily handle users, projects, and global system settings.
- Framework: Next.js 16 (App Router)
- Auth: Better Auth
- ORM: Drizzle ORM
- Styling: Tailwind CSS 4.0
- UI Components: Shadcn UI
- State Management: Zustand
- Form Validation: React Hook Form + Zod
git clone https://github.com/your-username/next-doc.git
cd next-docpnpm installCopy .env.example to .env and fill in your configurations:
# Core Configuration
BETTER_AUTH_SECRET=your_auth_secret
BETTER_AUTH_URL=http://localhost:3000
# Database (LibSQL/SQLite Example)
DATABASE_URL=file:./dev.db
# Social Login (Optional)
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
# SMTP Email Configuration (For verification and password reset)
SMTP_HOST=
SMTP_PORT=
SMTP_USER=
SMTP_PASSWORD=
SMTP_FROM=# Generate migrations
pnpm db:generate
# Push schema to database
pnpm db:push
# Create default admin account
pnpm db:seedDefault Admin Account:
- Email:
admin@example.com- Password:
Password123
pnpm devOpen http://localhost:3000 to see the results.
NextDoc supports multiple database engines through Drizzle ORM. You can choose the database that fits your needs.
Modify the DB_TYPE variable in your .env file:
- SQLite (Default): Perfect for small teams or personal use, no extra setup required.
- MySQL: Suitable for medium to large-scale projects.
- PostgreSQL: Ideal for projects requiring advanced features or high scalability.
DB_TYPE=sqlite
SQLITE_PATH=./data/nextdoc.dbDB_TYPE=mysql
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=your_user
MYSQL_PASSWORD=your_password
MYSQL_DATABASE=next-docDB_TYPE=postgres
POSTGRES_URL=postgresql://user:password@localhost:5432/next-docAfter modifying DB_TYPE or updating your models, run the following commands:
# Generate migrations for the specific database
pnpm db:generate
# Push schema change to database
pnpm db:pushRun the following command to open Drizzle Studio:
pnpm db:studio- Landing Page: Modern glassmorphism design showcasing public projects.
- Admin Panel: Manage users, permissions, and system configurations.
- User Settings: Update profile and security settings (change password).
For production deployment, it is recommended to use PM2 to manage the process.
pnpm buildThe project includes an ecosystem.config.js file for easy deployment.
# Register or update the process in PM2
pm2 start ecosystem.config.js
# To restart after updates
pm2 restart next-doc
# Monitoring logs
pm2 logs next-docThis project is licensed under the MIT License.
💡 If this project helps you, please give us a Star 🌟!


