NodeBBS
December 16, 2025 ยท View on GitHub
A modern, high-performance forum platform built with Turborepo monorepo architecture.
็ฎไฝไธญๆ | English
๐ Tech Stack
Backend (API)
- Framework: Fastify - High-performance Node.js web framework
- Database: PostgreSQL 16 with Drizzle ORM
- Authentication: JWT + OAuth2
- Cache: Redis 7
- Email: Nodemailer
- API Documentation: Swagger/OpenAPI
- Process Management: PM2
Frontend (Web)
- Framework: Next.js 16 with Turbopack
- UI Library: React 19
- Styling: Tailwind CSS 4
- Components: Radix UI
- Form Handling: React Hook Form
- Markdown: React Markdown with GitHub Flavored Markdown
- Theme: next-themes (dark/light mode)
Development & Deployment
- Monorepo: Turborepo
- Package Manager: pnpm 10+
- Environment Variables: dotenvx
- Containerization: Docker + Docker Compose
- Reverse Proxy: Nginx (production)
๐๏ธ Architecture
| Service | Technology | Port | Description |
|---|---|---|---|
| web | Next.js 16 | 3100 | Frontend application |
| api | Fastify | 7100 | Backend API service |
| postgres | PostgreSQL 16 | 5432 | Main database |
| redis | Redis 7 | 6379 | Cache service |
๐ Quick Start
Prerequisites
- Docker: Docker Engine 20.10+
- Docker Compose: 2.0+
One-Click Deployment (Recommended)
# Run the interactive deployment tool
# Prerequisite: Please install CLI tool first
# npm install -g nodebbs (or use npx nodebbs)
# Details: https://www.npmjs.com/nodebbs
npx nodebbs
The script supports three environment configurations:
- Standard Production (2C4G+) - Memory: API 768M, Web 768M
- Low Memory (1C1G/1C2G) - Memory: API 512M, Web 512M
- Basic (for testing) - No resource limits
๐ Access Points
After deployment, access:
- Web Frontend: http://localhost:3100
- API Documentation: http://localhost:7100/docs
- API Health Check: http://localhost:7100/api
๐ Common Commands
Common Commands
$ nodebbs
? Select command:
โฏ start Start deployment
stop Stop services
restart Restart all services (force recreate)
upgrade Upgrade services (pull latest images or rebuild)
status Check service status
logs View logs [+]
shell Enter container shell [+]
db Database operations (backup, migrate, seed, etc.) [+]
pack Generate offline deployment package
clean Clean Docker cache and residual resources
help Show help
โ Exit
For more commands and detailed instructions, please visit the NodeBBS CLI project homepage: https://www.npmjs.com/nodebbs
๐ ๏ธ Development Setup (Without Docker)
Prerequisites
- Node.js >= 22
- pnpm >= 10.0.0
- PostgreSQL
- Redis
Steps
# 1. Install dependencies
pnpm install
# 2. Configure environment
cd apps/api && cp .env.example .env
cd ../web && cp .env.example .env
# 3. Setup database
cd ../api
pnpm db:push
pnpm seed
# 4. Start development servers
cd ../..
pnpm dev
# API: port 7100 | Web: port 3100
๐ฆ Project Structure
nodebbs/
โโโ apps/
โ โโโ api/ # Fastify backend
โ โ โโโ src/
โ โ โ โโโ routes/ # API routes
โ โ โ โโโ plugins/ # Fastify plugins
โ โ โ โโโ db/ # Database schemas
โ โ โ โโโ utils/ # Utilities
โ โ โโโ Dockerfile
โ โ โโโ package.json
โ โโโ web/ # Next.js frontend
โ โโโ app/ # Next.js App Router
โ โโโ components/ # React components
โ โโโ Dockerfile
โ โโโ package.json
โโโ packages/ # Shared packages (future)
โโโ scripts/ # Deployment scripts
โโโ docker-compose.yml # Docker Compose base config
โโโ docker-compose.prod.yml # Standard production config
โโโ docker-compose.lowmem.yml # Low memory config
โโโ Makefile # Command shortcuts
โโโ deploy.sh # Auto deployment script
โโโ nginx.conf.example # Nginx configuration template
โโโ .env.docker.example # Environment variables template
โโโ turbo.json # Turborepo configuration
๐ค Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
MIT
๐ Support
For issues and questions:
- Open an issue on GitHub