MosaicπŸ“”

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 migrations

API Endpoints

EndpointDescription
/api/auth/loginUser login
/api/memosMemo CRUD
/api/diariesDiary management
/api/botsBot configuration
/openapi.jsonOpenAPI 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.

On this page