Server
Mosaic Go backend overview
Server
The Mosaic production server is built with Go, chi, pgx, and PostgreSQL.
The Go server lives in server-go/ and is what the published image runs. The server/ tree is a Rust reference implementation (Actix Web + SQLx): it speaks the same HTTP contract and reads the same schema, and it also hosts the shared admin UI that the Go image builds and serves.
Tech Stack
- Web Framework: chi
- Database Driver: pgx
- Database: PostgreSQL + pgvector
- Auth: JWT (access + refresh tokens)
- Admin UI: React build from
server/admin-ui/, served by the Go server
Project Structure
server-go/
βββ cmd/
β βββ mosaic-server/ # Server entry point
β βββ baseline-sqlx/ # One-time migration bookkeeping
βββ internal/
β βββ httpapi/ # Routing, handlers, middleware
β βββ service/ # Business logic
β βββ store/ # PostgreSQL access
β βββ domain/ # Types and shared contracts
βββ migrations/ # SQL migrationsAPI Endpoints
| Endpoint | Description |
|---|---|
/api/auth/login | User login |
/api/memos | Memo CRUD |
/api/diaries | Diary management |
/api/bots | Bot configuration |
/openapi.json | OpenAPI 3.1 document for the served API |
OpenAPI
The running server exposes a machine-readable OpenAPI 3.1 document at
http://localhost:8080/openapi.json. See
OpenAPI for how to import it into Swagger Editor or Postman.
Reference Implementation
The Rust server in server/ is kept for reference and rollback. It is not the
deployed backend. See server-go/CUTOVER.md for the cutover notes and the
rollback procedure.