Documentation

Architecture

The repository is intentionally app-oriented. Each bounded context owns its models, views, forms and services.

Request flow#

Browser → Nginx → Gunicorn → Django
  ├─ security / sessions / locale / csrf / auth
  ├─ ActiveWorkspaceMiddleware
  ├─ maintenance / license / demo guard
  └─ view → service → ORM → template/JSON

Apps#

core
SiteSettings, ThemeSettings, AuditLog, health, status, contact, newsletter, template tags, middleware.
accounts
Custom user, workspaces, memberships, invitations, auth, 2FA, sessions, profile.
catalog
Vendors, models, tiers, endpoints, reviews, benchmarks, vendor console.
gateway
Keys, subscriptions, metering, request logs, alerts, webhooks, playground, API, sandbox routing.
billing
Plans, credits, invoices, payment methods, payouts.
notifications / support
In-app notifications, preferences, tickets and replies.
cms
Pages, sections, banners, email templates, media, studios.
content
Docs, blog, FAQ, changelog, roadmap, jobs, press, integrations, events.
marketing
Segments, campaigns, leads and email events.
dashboard
Staff console and settings workbench.
mcp
MCP server, outbound connections and tool-call audit.
licensing
LicenseHub client (Dakid Arts edition only).

Workspace scoping#

Every console request resolves an active workspace from the session, validating membership each time. Session switching is a POST. API keys, subscriptions, usage, logs and alerts are foreign-keyed to a workspace; staff pages use platform-wide queries.

Gateway path#

API key → workspace → model → endpoint
      ↓
  rate/spend/key checks → upstream or sandbox
      ↓
  RequestLog + UsageDaily + CreditTransaction + workspace debit

Exactly one ledger row is written per metered request. The MCP chat_completion tool calls the same service.