# Architecture ```txt browser / desktop / mobile │ HTTPS + WebSocket ▼ docwell-web ──(optional proxy)──▶ docwell-server ──▶ docwell-db (serves the app) (API, live editing, (PocketBase: search, admin panel) SQLite + files) ``` - **docwell-db** is [PocketBase](https://pocketbase.io) with Docwell's schema. It stores accounts, pages, history, comments and files (on disk or in S3), and sends the account emails. It is private: only docwell-server talks to it, as a superuser. - **docwell-server** (Go) is the only public API. It enforces every access rule, relays live edits between editors (Yjs, merged with yrs compiled to WebAssembly), keeps the full-text index (Bleve) and serves the admin panel. - **docwell-web** (Go) serves the web app and can proxy the API, so browsers need one address. Page content is a Yjs document; the server keeps a compacted copy plus the Tiptap JSON and plain text derived from it, which history, search, export and public links use.