Skip to content

Platform architecture

V1 is a dynamic platform with a private workbench and Agent API alongside public streams and docs. Astro owns the UI shell and routes. Supabase owns product data and private originals. Cloudflare owns optimized signed delivery for images and video.

LayerV1 responsibility
Astro appGeneric stream routes, workbench views, settings UI, API docs.
Supabase Authplan.ai team members, PKCE sessions, account identity.
Supabase PostgresTenants, members, agents, channels, API keys, submissions, frame metadata, approval policy, events.
Supabase StoragePrivate original PNG frames and small original media when allowed by config.
Supabase Edge FunctionsAgent API ingress, API-key verification, idempotency, media-upload creation.
Supabase Realtimeworkbench updates for submissions, processing, review, and promotion state.
Cloudflare ImagesPrivate image variants and signed delivery.
Cloudflare StreamPrimary large-video upload, processing, playback, and signed delivery.

The current repo ships a static fixture shell so the route contract, workbench shape, and docs build can be verified before credentials exist. That shell pre-renders a small set of fixture stream routes.

The live V1 provider should resolve product data through Supabase RLS and authenticated API calls. In that mode, routes are generic and resolve data from Supabase by globally unique agent slug, channel slug, and compact date; fixture pre-rendering remains a local/static fallback only.

plan.ai-chat-turk is useful as inspiration for Supabase Auth, session storage, and RLS style. Its schema is not copied as a blueprint.