Monorepo Documentation
Welcome to the project documentation! This site covers the architecture, technologies, and implementation details of our offline-first desktop application.
What We've Built
An offline-first desktop CRM with:
- 📱 Tauri desktop app with React frontend
- 🔄 Real-time sync between local and cloud databases
- 📝 Rich text editing with collaborative features
- 🔒 Type-safe APIs with full TypeScript support
Technology Stack
| Category | Technologies |
|---|---|
| Frontend | React, Tauri, WatermelonDB, Lexical.js, Material UI |
| Backend | Cloudflare Workers, D1, Hono, tRPC |
| Sync | Custom pull/push protocol, Yjs CRDT |
| Communication | REST, tRPC HTTP, tRPC WebSocket |
Documentation Guide
🚀 Quick Start
- Getting Started - Installation and running the apps
🏗️ Architecture
- Overview - High-level system design with diagrams
- Frontend Stack - React, Tauri, WatermelonDB, Lexical
- Backend Stack - Workers, D1, Hono, tRPC
- Communication - REST vs tRPC vs WebSocket
- tRPC API Reference - Complete endpoint documentation
🔄 Data & Sync
- Sync Architecture - Offline-first sync protocol
- CRDT Collaboration - Yjs and conflict resolution
- WebSocket Adapter Internals - How real-time tRPC works
- Versioning & Releases - Release management strategy
📚 Reference
- Monorepo Overview - Project structure
- API Reference: Client - TypeScript API (Tauri)
- API Reference: Server - TypeScript API (Worker)
Key Features
Offline-First
The app works completely offline using WatermelonDB (SQLite). Changes sync automatically when online.
Type-Safe End-to-End
tRPC provides full type inference from backend to frontend without code generation.
Collaborative Editing
Rich text fields use Yjs CRDTs for conflict-free merging across multiple users.
Multiple Communication Protocols
Choose between REST, tRPC HTTP, or tRPC WebSocket based on your needs.