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.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CLIENT LAYER β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββββββ ββββββββββββββββββββ ββββββββββββββββββββββ β
β β Webapp β β Admin Dashboard β β TipTap Extensions β β
β β (Next.js) β β (Next.js) β β hyperlink, media β β
β β Port 3000 β β Port 3100 β β indent, code β β
β ββββββββββ¬ββββββββββ ββββββββββ¬ββββββββββ ββββββββββββββββββββββ β
β β β β
ββββββββββββββΌββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββ
β HTTP/WS β HTTP
βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BACKEND LAYER β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββββββ ββββββββββββββββββββ ββββββββββββββββββββ β
β β REST API β β WebSocket β β Worker β β
β β (Hono) β β (Hocuspocus) β β (BullMQ) β β
β β Port 4000 β β Port 4001 β β Port 4002 β β
β β β β β β β β
β β β’ Auth β β β’ Real-time β β β’ Doc storage β β
β β β’ Documents β β collaboration β β β’ Email queue β β
β β β’ Workspaces β β β’ Y.js sync β β β’ Push notifs β β
β ββββββββββ¬ββββββββββ ββββββββββ¬ββββββββββ ββββββββββ¬ββββββββββ β
β β β β β
ββββββββββββββΌββββββββββββββββββββββββΌββββββββββββββββββββββββΌβββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DATA LAYER β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββ β
β β PostgreSQL β β Redis β β
β β (Supabase) β β β β
β β Port 5432 β β Port 6379 β β
β β β β β β
β β β’ Users & Auth β β β’ Job queues (BullMQ) β β
β β β’ Documents & Workspaces β β β’ Pub/Sub (WS sync) β β
β β β’ Realtime subscriptions β β β’ Session cache β β
β β β’ Row Level Security β β β’ Rate limiting β β
β βββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββ
β Supabase Studio β
β Port 54323 β
β (Dev only) β
βββββββββββββββββββ
Monorepo Structure:
- π
packages/webapp- Next.js frontend with TipTap editor - π₯οΈ
packages/admin-dashboard- Admin panel for platform management - β‘
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) - π¦
packages/eslint-config- Shared ESLint configurations
Tech Stack:
- Runtime: π Bun 1.3.7+
- Frontend: βοΈ Next.js 15/16, React 19, TipTap 3, Tailwind CSS 4
- Backend: π§ Hono, Hocuspocus (Y.js), BullMQ, Prisma ORM
- Database: π PostgreSQL 17, π΄ Redis
- Infrastructure: π³ Docker Compose, Supabase
- Real-time: π WebSocket (Hocuspocus), Supabase Realtime
- π³ Docker & Docker Compose v2+ - Install
β οΈ macOS Silicon users: Docker Desktop has IO performance issues. Use OrbStack instead (drop-in replacement, faster, lighter).
- π Bun >=1.3.7 - Install
- ποΈ Supabase CLI - Install
git clone https://github.com/docs-plus/docs.plus.git
cd docs.plus
bun installCreate environment files based on your development mode:
# Required: Create .env.development first (used by Docker dev and as base for local dev)
cp .env.example .env.developmentEnvironment File Mapping:
| Docker Compose File | Environment File | Usage |
|---|---|---|
docker-compose.prod.yml |
.env.production |
Production deployment |
docker-compose.dev.yml |
.env.development |
Docker development (all services in containers) |
docker-compose.local.yml |
.env.local |
Local development (infra in Docker, apps native) |
Important Differences:
.env.development (Docker Development):
- Uses Docker service names for inter-container communication:
SERVER_RESTAPI_URL=http://rest-api:4000/api(Docker service name)REDIS_HOST=redis(Docker service name)DATABASE_URLis set by Docker Compose (not in file)
.env.local (Local Development):
- Uses localhost for native apps connecting to Docker infrastructure:
SERVER_RESTAPI_URL=http://localhost:4000/api(localhost)REDIS_HOST=localhost(localhost)DATABASE_URL=postgresql://...@localhost:5432/...(explicit connection string)
- Auto-created from
.env.developmentwhen you runmake dev-localormake infra-up - Gitignored - safe for local customizations
Note: .env.local is automatically created from .env.development on first run. You only need to create .env.development manually.
ποΈ Option A: Local Supabase Setup (One-time, ~5-10 min)
Step 1: Start Supabase π
make supabase-startFirst run downloads Docker images. Verify with make supabase-status.
Step 2: Activate Extensions π
- Open Supabase Studio
- Go to Integrations
- Activate: pg_cron and pgmq (Queues)
Step 3: Run Migrations π
- Open SQL Editor
- Execute scripts from
packages/supabase/scripts/in order:01-enum.sqlthrough17-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"
βοΈ Option B: Supabase Cloud Setup
If you prefer not to run Supabase locally, you can use a cloud project instead:
Step 1: Create Supabase Project π
- Go to Supabase Dashboard
- Create a new project
- Copy your project URL and anon key from Settings β API
Step 2: Update Environment Variables βοΈ
Update .env.development with your cloud project credentials:
# Server-side (containers β Supabase Cloud)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-anon-key-here
# Client-side (browser β Supabase Cloud)
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_WS_URL=wss://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key-hereStep 3: Configure Extensions & Migrations π You still need to configure your cloud project:
- Activate pg_cron and pgmq (Queues) extensions in the Dashboard
- Run SQL scripts from
packages/supabase/scripts/in order via SQL Editor - Configure queues and permissions (same as local setup)
Backend Environment Variables:
# Supabase connection (for pgmq polling)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
# VAPID keys for Web Push
VAPID_PUBLIC_KEY=your-vapid-public-key
VAPID_PRIVATE_KEY=your-vapid-private-key
VAPID_SUBJECT=mailto:support@yourdomain.comGenerate VAPID keys: npx web-push generate-vapid-keys
See docs/PUSH_NOTIFICATION_PGMQ.md for detailed architecture.
Step 5: Configure OAuth Redirect URLs π
Go to Authentication β URL Configuration in Supabase Dashboard and add your Redirect URLs:
https://yourdomain.com
https://yourdomain.com/*
https://admin.yourdomain.com
https://admin.yourdomain.com/*
Replace yourdomain.com with your actual domain.
Step 6: Add Admin Users π€
Only users in the admin_users table can access the admin dashboard. Run this SQL to grant access:
-- Add admin user by email
INSERT INTO public.admin_users (user_id, created_at)
SELECT id, now() FROM auth.users WHERE email = 'your-admin@example.com';
-- Verify admin users
SELECT u.email, a.created_at
FROM public.admin_users a
JOIN auth.users u ON a.user_id = u.id;Note: Make sure your Supabase project allows connections from your Docker network or configure network settings accordingly.
Choose one of three options:
π³ Option A: Full Docker (Default)
All services run in Docker containers. Best for consistent environments.
make up-devServices: π―
- π Webapp: http://localhost:3000
- π REST API: http://localhost:4000
- β‘ WebSocket: ws://localhost:4001
- π· Worker: http://localhost:4002
- π PostgreSQL: localhost:5432
- π΄ Redis: localhost:6379
- ποΈ Supabase Studio: http://127.0.0.1:54323
π» Option B: Local Development (macOS-friendly, No Docker IO)
Best for macOS users - Avoids Docker volume IO performance issues. Only infrastructure (PostgreSQL, Redis) runs in Docker. Apps run natively with hot reload.
Step 1: Start Infrastructure π
make infra-upStep 2: Start Supabase ποΈ
make supabase-startStep 3: Start Apps π»
Option 3a: All in one command (recommended)
bun run dev:localOption 3b: Separate terminals (better for debugging)
# Terminal 1 - Backend REST API
cd packages/hocuspocus.server && bun run dev:rest
# Terminal 2 - Backend WebSocket
cd packages/hocuspocus.server && bun run dev:hocuspocus.server
# Terminal 3 - Backend Worker
cd packages/hocuspocus.server && bun run dev:hocuspocus.worker
# Terminal 4 - Frontend
cd packages/webapp && bun run devOr use convenience scripts:
bun run dev:backend # Start all backend services
bun run dev:webapp # Start frontend onlyEnvironment Variables:
- β
.env.localfile at root - automatically created from.env.developmenton first run .env.development- Used bydocker-compose.dev.yml(Docker service names:rest-api:4000,redis).env.local- Used bydocker-compose.local.ymland native apps (localhost addresses, gitignored)- Scripts automatically load root
.env.local:- Backend: Uses
bun --env-file ../../.env.local - Frontend: Uses
dotenv-clito load root.env.local
- Backend: Uses
- Key differences:
.env.localuseslocalhostinstead of Docker service names:SERVER_RESTAPI_URL=http://localhost:4000/api(vshttp://rest-api:4000/apiin.env.development)REDIS_HOST=localhost(vsredisin.env.development)DATABASE_URL=postgresql://...@localhost:5432/...(explicit, vs set by Docker Compose in.env.development)
- See Step 2: Environment Configuration section above for complete details
Benefits:
- β Native file system performance (no Docker volume overhead)
- β Faster hot reload
- β Better debugging experience
- β Lower resource usage
Access points:
- π Webapp: http://localhost:3000
- π REST API: http://localhost:4000
- β‘ WebSocket: ws://localhost:4001
- π· Worker: http://localhost:4002
- π PostgreSQL: localhost:5432
- π΄ Redis: localhost:6379
- ποΈ Supabase Studio: http://127.0.0.1:54323
Stop infrastructure:
make infra-downProduction-ready setup for mid-level scale deployments (small-medium teams, moderate traffic).
Architecture: ποΈ
- π Horizontal scaling: REST API (2), WebSocket (2), Worker (2), Webapp (2)
- π Traefik v3 reverse proxy with automatic SSL (Let's Encrypt) and load balancing
- β‘ Resource limits, health checks, and zero-downtime blue-green deploys
- π Production-optimized logging and connection pooling
-
βοΈ Configure Environment
cp .env.example .env.production
Important:
.env.productionis used bydocker-compose.prod.ymlfor production deployment.Update: database credentials, JWT secret, Supabase URLs, storage credentials, CORS origins.
-
π¨ Build & Deploy
make build make up-prod
-
π 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
# Building
make build # Production build
make build-dev # Development build
# Running (Full Docker)
make up-prod # Start production
make up-dev # Start development (all in Docker)
# Running (Local Development - macOS-friendly)
make infra-up # Start infrastructure only (postgres, redis)
make infra-down # Stop infrastructure
make infra-logs # View infrastructure logs
make dev-local # Start all services (backend + frontend)
make dev-backend # Start backend services (REST, WS, Worker)
make dev-webapp # Start frontend only
make dev-rest # Start REST API only
make dev-ws # Start WebSocket server only
make dev-worker # Start Worker only
make migrate # Run database migrations
# 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 + delete volumes (DATA LOSS!)
# Scaling (production)
make scale-webapp # Scale webapp to 3 replicas
make scale-hocuspocus # Scale backend services
# Supabase (uses .env.local)
make supabase-start # Start local Supabase
make supabase-stop # Stop local Supabase
make supabase-status # Show Supabase statusRun make help for complete command list.
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
PRs welcome! See contributing guidelines for details.
First contribution? Start here:
- Pick an issue labeled good first issue or help wanted.
- Confirm your setup with
bun run checkbefore opening a PR. - Use our issue and PR templates to speed up review.
MIT License - See LICENSE.md
- π¬ Discord: Join our server
- π¦ Twitter: @docsdotplus
- π GitHub: docs.plus
- π§ Email: contact@newspeak.house