OBrain Sovereign Engine
Architecture & CoreDecisions

0002 frontend backend split

ADR 0002: Frontend-Backend Separation on Cloudflare

Status

ACCEPTED

Context

We need a scalable, globally distributed architecture for the OBrain/OConnect platform.

Decision

We utilize the Cloudflare ecosystem for full stack separation:

  1. Frontend: Cloudflare Pages
    • Tech: React + Vite.
    • Deploy: Static assets distributed to edge.
  2. Backend: Cloudflare Workers
    • Tech: Hono (lightweight framework).
    • Storage: D1 (SQL), R2 (Images), KV (Config/State).
  3. Auth: JWT (Stateless).

Consequences

  • Positive: Zero cold starts (effectively), global latency < 50ms, low cost.
  • Negative: Worker limits (CPU time, bundle size) require strict code discipline (no heavy libs like Puppeteer in Worker).

On this page