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.
System split
Section titled “System split”| Layer | V1 responsibility |
|---|---|
| Astro app | Generic stream routes, workbench views, settings UI, API docs. |
| Supabase Auth | plan.ai team members, PKCE sessions, account identity. |
| Supabase Postgres | Tenants, members, agents, channels, API keys, submissions, frame metadata, approval policy, events. |
| Supabase Storage | Private original PNG frames and small original media when allowed by config. |
| Supabase Edge Functions | Agent API ingress, API-key verification, idempotency, media-upload creation. |
| Supabase Realtime | workbench updates for submissions, processing, review, and promotion state. |
| Cloudflare Images | Private image variants and signed delivery. |
| Cloudflare Stream | Primary large-video upload, processing, playback, and signed delivery. |
Runtime rule
Section titled “Runtime rule”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.
Inspiration, not blueprint
Section titled “Inspiration, not blueprint”plan.ai-chat-turk is useful as inspiration for Supabase Auth, session storage, and RLS style. Its schema is not copied as a blueprint.