Skip to Content
ProductArchitecture

Architecture

A buyer-friendly map of how AI Starter is put together. For implementation rules and code layout, see Architecture (technical).

High-level picture

Rule of thumb: the browser never holds secrets. Credits, billing, and generation finalize on the server; the UI only calls ports.

Hexagonal design (why it matters to you)

BenefitWhat it means for your team
Demo without DockerSales and design use apps/demo while backend catches up
Testable featuresMock adapters in CI; swap one line for production
Fork-friendlyReplace fal with another provider at the Edge layer, not in every component

Ports live in libs/ports. Supabase implementations live in libs/data-access-supabase. Feature code does not import SQL or SDKs directly.

Trust boundaries

LayerResponsibility
Angular guardsUX routing only — not security
RLS policiesWho can read/write which rows
Edge FunctionsService-role writes, webhooks, provider calls
WebhooksStripe / custom billing verified before plan changes

See Security model.

Main domain modules

DomainResponsibility
Auth & orgUsers, workspaces, members, invites
CreditsLedger RPCs, reserve/finalize, monthly reset
GenerationBoards, jobs, batches, provider registry
BillingPlans, checkout, subscription sync
ShellLayout, nav, help, shared UX patterns

Generation and credits are tightly coupled by design: a job only debits when it succeeds.

Apps in the monorepo

AppBackendTypical use
apps/demoMock adapters onlyPublic demo, fast UI iteration
apps/webSupabaseStudio — your production-shaped app
apps/api-consoleSupabaseAPI keys, usage, billing, playground
apps/docsStatic (this site)Customer + engineer documentation

Marketing landing (ai-saas-starter-landing) is a separate repository — Vite + React, links here for pre-purchase research.

Extending without forking blindly

ChangeWhere to work
New AI modellibs/generation-core catalog + provider adapter
New payment regionCustom billing webhook + BillingPort adapter
New vertical UINew libs/features-* consuming existing ports
White-label emailEdge env (BRAND_*, Resend)

Philosophy and layer boundaries: Philosophy & layers.

Next

Last updated on