Docs.plus
A real-time community collaboration platform
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. The project is written primarily in TypeScript, distributed under the MIT License license, first published in 2020. Key topics include: collaboration, collaborative-framework, collaborative-research, collaborative-writing, document.
๐ docs.plus
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
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 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:
- ๐
apps/webapp- Next.js frontend with TipTap editor - ๐ฅ๏ธ
apps/admin-dashboard- Admin panel for platform management - โก
apps/hocuspocus.server- REST API, WebSocket server, and background workers - ๐๏ธ
packages/supabase- Database migrations and Supabase configuration - ๐
extensions/extension-*- Five publishable TipTap extensions (hyperlink, hypermultimedia, indent, inline-code, placeholder) under the@docs.plusnpm scope โ see extensions/README.md - ๐ฆ
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
๐ Prerequisites
- ๐ณ 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
๐ Quick Start
1๏ธโฃ Clone & Install
bashgit clone https://github.com/docs-plus/docs.plus.git cd docs.plus bun install
2๏ธโฃ Environment Configuration
Create environment files based on your development mode:
bash# Required: Create .env.development first (used by Docker dev and as base for local dev) cp .env.example .env.development
Environment 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.
3๏ธโฃ Initialize Supabase
<details> <summary><strong>๐๏ธ Option A: Local Supabase Setup (One-time, ~5-10 min)</strong></summary>Step 1: Start Supabase ๐
bashbun --filter @docs.plus/supabase_back start
First run downloads Docker images. Verify with bun --filter @docs.plus/supabase_back 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"
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:
bash# 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-here
Step 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:
env# 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.com
Generate 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:
sql-- 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.
</details>4๏ธโฃ Start Development Environment
Choose one of three options:
<details> <summary><strong>๐ณ Option A: Full Docker (Default)</strong></summary>All services run in Docker containers. Best for consistent environments.
โ ๏ธ macOS Silicon users: Docker Desktop has slow IO performance (slow Next.js compile/hot reload). Use OrbStack instead for better performance.
bashmake up-dev
Services: ๐ฏ
- ๐ 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
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 ๐
bashmake infra-up
Step 2: Start Supabase ๐๏ธ
bashbun --filter @docs.plus/supabase_back start
Step 3: Start Apps ๐ป
Option 3a: All in one command (recommended)
bashmake dev-local
Option 3b: Separate terminals (better for debugging)
bash# Terminal 1 - Backend REST API bun --filter @docs.plus/hocuspocus dev:rest # Terminal 2 - Backend WebSocket bun --filter @docs.plus/hocuspocus dev:ws # Terminal 3 - Backend Worker bun --filter @docs.plus/hocuspocus dev:worker # Terminal 4 - Frontend bun run dev
Or use convenience commands:
bashmake dev-backend # Start all backend services (REST + WS + worker) bun run dev # Start frontend only
Environment 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.localviadotenv -e ../../.env.local --(uniform across backend, frontend, and admin). - 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:
</details>bashmake infra-down
๐ Production Deployment
Production-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
Setup
-
โ๏ธ Configure Environment
bashcp .env.example .env.productionImportant:
.env.productionis used bydocker-compose.prod.ymlfor production deployment.Update: database credentials, JWT secret, Supabase URLs, storage credentials, CORS origins.
-
๐จ Build & Deploy
bashmake build make up-prod -
๐ Scaling
Adjust replicas in.env.production:bashREST_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
bash# 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 dev-local # Start all services (backend + frontend) make dev-backend # Start backend services (REST, WS, Worker) # Frontend / Admin / Supabase (Bun, not Make) bun run dev # Webapp bun run dev:admin # Admin dashboard bun --filter @docs.plus/supabase_back start # Supabase bun --filter @docs.plus/hocuspocus prisma:migrate # Run DB migrations # Management make down # Stop services (auto-detects env) make logs # All logs make ps # Container status make clean # โ ๏ธ Cleanup + delete volumes (DATA LOSS!)
Run make help for the complete Make surface; bun run (no args) for all root scripts.
๐ 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.
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.
๐จ Badges
Using docs.plus? Add a badge to your README and link back.
Variants
| Style | Preview | File |
|---|---|---|
| Default | badge-docsplus.svg | |
| Light | badge-docsplus-light.svg | |
| Dark | badge-docsplus-dark.svg | |
| Flat-square | badge-docsplus-flat-square.svg | |
| For-the-badge | badge-docsplus-for-the-badge.svg |
Usage
Markdown:
markdown[](https://docs.plus)
HTML โ auto light/dark switching for GitHub READMEs:
html<a href="https://docs.plus"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://docs.plus/badges/badge-docsplus-dark.svg" /> <img alt="docs.plus" height="20" src="https://docs.plus/badges/badge-docsplus.svg" /> </picture> </a>
Swap the filename for any variant in the table above.
๐ License
MIT License - See LICENSE
๐ฌ Support
- ๐ฌ Discord: Join our server
- ๐ฆ Twitter: @docsdotplus
- ๐ GitHub: docs.plus
- ๐ง Email: contact@newspeak.house
<a href="https://patreon.com/docsplus"><img src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Ddocsplus%26type%3Dpatrons&style=for-the-badge" /></a>
Contributors
Showing top 3 contributors by commit count.
