Real-time collaboration server for Returfs extensions using Yjs.
# Install dependencies
pnpm install
# Start development server
pnpm dev
# Build for production
pnpm build
# Start production server
pnpm startCopy .env.example to .env and configure:
APP_NAME=hocuspocus
APP_PORT=1234
APP_HOST=localhost
RETURFS_API_URL=http://project.test- Extensions connect via WebSocket with document name and API routes
- Server fetches initial content from Returfs API
- Yjs synchronizes changes between all connected clients
- Changes are periodically persisted back to the Returfs API
Extensions should connect with these query parameters:
resourceRoute: API endpoint to fetch contentresourceUpdateRoute: API endpoint to save contentapiKey: Developer API key (for authentication)
client (Tiptap/Yjs) <--> Hocuspocus <--> Returfs API
|
v
Yjs CRDT
(conflict resolution)