Skip to main content

Core Components

Core components of the ChyperAI platform:

  • Frontend (Remix + Vite): app/ routes and UI, built for Cloudflare Pages.
  • API layer (Pages Functions): functions/api/* endpoints (hello, containers, projects).
  • Worker backend: src/worker.ts defines WorkspaceLock Durable Object.
  • Persistence: D1 database with tenants, projects, chats, logs tables.
  • Configuration: wrangler.toml (Pages) and wrangler.worker.toml (Worker) with bindings.

Durable Object: WorkspaceLock

  • Provides per-workspace mutual exclusion for operations (e.g., provisioning containers).
  • Registered and exported in src/worker.ts.

Multi-tenancy

  • tenants table with slug; default tenant slug resolves to id t_default.
  • APIs accept X-Tenant-ID header or tenantId query param; fallback to default.