CodeAgentSwarm — local backend

Stand-in for the cloud API on port 3005. Nothing here talks to production.

Preproduction

Multi-user backend on PostgreSQL. Accounts and plans are managed from the admin panel; there is no billing anywhere.
Mobile Connect: on · Swarmi: offline replies

Actions

Sign in to the app Admin panel Health

Implemented

GET  /health
GET  /api/auth/login/:provider      → deep-links back into the app
POST /api/auth/refresh
GET  /api/subscription/status | /config | /invoices
POST /api/subscription/create-checkout-session | create-portal-session
POST /api/subscription/create-subscription | cancel | reactivate
GET  /api/user/subscription | /api/user/me
POST /api/analytics/clicks
POST /api/errors/report
POST /api/feedback                  (JSON and multipart)
GET  /api/skills | /api/skills/version
GET  /api/swarmi/app-context
POST /api/swarmi/chat | /api/swarmi/chat/stream

Mobile Connect
WS   /api/mobile/ws?runtime=:id     → the relay (desktop + phone)
POST /api/mobile/desktop-ticket | /device-token | /notify
GET  /api/mobile/devices            DELETE /api/mobile/devices/:id
GET  /api/mobile/pairing-code/:code → pairing by typed code
POST /api/mobile/refresh | /push-token | /telemetry
DELETE /api/mobile/device           → the phone forgets this computer
ANY  /preview/:runtime/:share/*     → localhost preview through the desktop

Admin panel (browser, its own cookie session — never the app's JWT)
GET  /admin/login | /admin/users | /admin/users/:id
POST /admin/users                   → creates a password account
POST /admin/users/:id/plan | /role | /disable | /sessions/revoke

State lives in PostgreSQL (db:5432/fenixiacodeagent); users, plans and sessions are managed from the admin panel. Configuration: environment variables only.