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

ServiceTechnologyPortDescription
webNext.js 163100Frontend application
apiFastify7100Backend API service
postgresPostgreSQL 165432Main database
redisRedis 76379Cache service

๐Ÿš€ Quick Start

Prerequisites

  • Docker: Docker Engine 20.10+
  • Docker Compose: 2.0+
# 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:

๐Ÿ“ 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:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

MIT

๐Ÿ› Support

For issues and questions:

  • Open an issue on GitHub