Skip to content

docs-plus/docs.plus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š docs.plus

Version License PRs Welcome

docs.plus is a free, real-time collaboration tool built on open-source technologies. It empowers communities to share and organize information logically and hierarchically, making teamwork and knowledge sharing straightforward and effective.

πŸ—οΈ Architecture

Monorepo Structure:

  • 🌐 packages/webapp - Next.js frontend with TipTap editor
  • ⚑ packages/hocuspocus.server - REST API, WebSocket server, and background workers
  • πŸ—„οΈ packages/supabase - Database migrations and Supabase configuration
  • πŸ”Œ packages/extension-* - TipTap extensions (hyperlink, multimedia, indent, inline-code)

Tech Stack:

  • Runtime: πŸš€ Bun 1.3.2+
  • Frontend: βš›οΈ Next.js 15, React, TipTap, Tailwind CSS
  • Backend: πŸ”§ Hono, Hocuspocus (Y.js), Prisma ORM
  • Database: 🐘 PostgreSQL 17, πŸ”΄ Redis
  • Infrastructure: 🐳 Docker Compose, Supabase
  • Real-time: πŸ”Œ WebSocket (Hocuspocus), Supabase Realtime

πŸ“‹ Prerequisites

  • 🐳 Docker & Docker Compose v2+ - Install
  • πŸš€ Bun >=1.3.2 - Install
  • πŸ—„οΈ Supabase CLI - Install

πŸš€ Quick Start

1️⃣ Clone & Install

git clone https://github.com/docs-plus/docs.plus.git
cd docs.plus
bun install

2️⃣ Environment Configuration

cp .env.example .env.development

Update .env.development with your configuration. See .env.example for all available variables.

3️⃣ Initialize Supabase

πŸ—„οΈ Supabase Setup (One-time, ~5-10 min)

Step 1: Start Supabase πŸš€

make supabase-start

First run downloads Docker images. Verify with make supabase-status.

Step 2: Activate Extensions πŸ”Œ

Step 3: Run Migrations πŸ“Š

  • Open SQL Editor
  • Execute scripts from packages/supabase/scripts/ in order: 01-enum.sql through 17-database-extensions.sql

Step 4: Configure Queues βš™οΈ

  • Queue Settings β†’ Enable "Expose Queues via PostgREST"
  • Queues β†’ Select message_counter β†’ Manage permissions
  • Enable Select/Insert/Update/Delete for: authenticated, postgres, service_role
  • Add RLS policy: "Allow anon and authenticated to access messages from queue"

4️⃣ Start Development Environment

make up-dev

Services: 🎯

πŸš€ Production Deployment

Production-ready setup for mid-level scale deployments (small-medium teams, moderate traffic).

Architecture: πŸ—οΈ

  • πŸ“ˆ Horizontal scaling: REST API (2), WebSocket (3), Worker (2), Webapp (2)
  • πŸ”€ Nginx reverse proxy with load balancing
  • ⚑ Resource limits and health checks
  • πŸ“Š Production-optimized logging and connection pooling

Setup

  1. βš™οΈ Configure Environment

    cp .env.example .env.production

    Update: database credentials, JWT secret, Supabase URLs, storage credentials, CORS origins.

  2. πŸ”¨ Build & Deploy

    make build
    make up-prod
  3. πŸ“ˆ Scaling Adjust replicas in .env.production:

    REST_REPLICAS=2
    WS_REPLICAS=3
    WORKER_REPLICAS=2
    WEBAPP_REPLICAS=2

Production Recommendations: πŸ’‘

  • πŸ—„οΈ Use managed database (AWS RDS, DigitalOcean, Supabase Cloud)
  • πŸ”’ Configure SSL/TLS certificates
  • πŸ“Š Set up monitoring (Prometheus, Grafana)
  • πŸ’Ύ Implement database backups
  • πŸ” Secure all secrets and credentials

πŸ“– Command Reference

# Building
make build             # Production build
make build-dev         # Development build

# Running
make up-prod           # Start production
make up-dev            # Start development

# Management
make down              # Stop services (auto-detects env)
make restart           # Restart services (auto-detects env)
make logs              # All logs
make logs-webapp       # Webapp logs
make logs-backend      # Backend logs
make ps                # Container status
make stats             # Resource usage
make clean             # Cleanup (auto-detects env)

# Scaling (production)
make scale-webapp      # Scale webapp to 3 replicas
make scale-hocuspocus  # Scale backend services

# Supabase
make supabase-start    # Start local Supabase
make supabase-stop     # Stop local Supabase
make supabase-status   # Show Supabase status

Run make help for complete command list.

πŸ“ Project Structure

docs.plus/
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ webapp/              # 🌐 Next.js frontend
β”‚   β”œβ”€β”€ hocuspocus.server/   # ⚑ REST API, WebSocket, Workers
β”‚   β”œβ”€β”€ supabase/            # πŸ—„οΈ Database migrations
β”‚   └── extension-*/         # πŸ”Œ TipTap extensions
β”œβ”€β”€ docker-compose.dev.yml   # 🐳 Development orchestration
β”œβ”€β”€ docker-compose.prod.yml  # πŸš€ Production orchestration
β”œβ”€β”€ Makefile                 # πŸ› οΈ Build & deployment commands
└── .env.example             # βš™οΈ Environment template

🀝 Contributing

PRs welcome! See contributing guidelines for details.

πŸ“„ License

Apache License 2.0 - See LICENSE.md

πŸ’¬ Support