Skip to content

Architecture

QuotaDeck is a local application with a deliberately small trust boundary.

text
provider adapters


provider → accounts → windows[]

      ├── SQLite WAL history
      ├── loopback JSON API + SSE
      ├── provider control boundary
      │        ├── cswap switch
      │        └── private Z.ai / Claude settings
      └── embedded Preact dashboard
               ├── browser
               ├── Wails desktop
               └── Cinnamon applet

Dynamic domain model

Quota windows are data, not columns. Each window carries an ID, label, kind, percentages, optional quantities, and optional reset/projection metadata. Unknown future windows can therefore travel from a provider response to storage and UI without a session/weekly schema migration.

See ADR 0002 for the decision record.

Local API

MethodRoutePurpose
GET/api/v1/stateComplete current dashboard state
GET/api/v1/providersEnabled provider metadata
GET/api/v1/accountsDiscovered accounts
GET/api/v1/accounts/{id}/historyAccount snapshots
GET/api/v1/healthService health
GET/api/v1/doctorRedacted diagnostics
GET/api/v1/eventsServer-Sent Events stream
GET/api/v1/controlRedacted active-plan status
POST/api/v1/refreshLoopback-only manual refresh
POST/api/v1/control/claude/switchActivate a validated cswap account
PUT/api/v1/control/zaiSave and optionally activate Z.ai

Refresh requests require X-QuotaDeck-Request: refresh. Plan mutations require X-QuotaDeck-Request: control. Both enforce loopback origin checks; control request bodies are size-limited and reject unknown fields.

Local-first. Zero telemetry.