AI app builder

Docs

The engine primitives the AI composes and the AppSpec shape it emits.

How it works

You describe an app in plain English. The AI (DeepSeek) calls typed tools to extend an AppSpec — a JSON document that lists your tables, pages, workflows, integrations, and permissions. Codegen turns the spec into a real Vite + React app; the platform runs a per-project Postgres (PGlite) and exposes a PostgREST-shaped HTTP API.

Every AI patch runs through a verify-repair loop (tsc on the generated template). Every apply creates a new immutable spec version — you can roll back at any time from the History tab.

Engine primitives

Compose these inside a page's composition array. The AI is taught to prefer them over writing raw code.

DataTableLists rows of a table. Handles paging/loading.
  • resourcetable name
  • columns[{ key, label?, format? }]
DataFormCreate-row form. Auto-validates and submits.
  • resourcetable name
  • fields[{ name, type: text|email|number|select|textarea|date, required?, options? }]
StatCardSingle metric — count, sum, or average of a column.
  • resourcetable name
  • metriccount | sum | avg
  • columnfor sum/avg
  • labelhuman label
KanbanBoardRows grouped into lanes by a column (e.g. status).
  • resourcetable name
  • groupBycolumn name
  • titleFieldtext column to show on cards
  • lanesoptional fixed lane order
DataChartBar or line chart with xKey + yKey.
  • resourcetable name
  • typebar | line
  • xKeyx-axis column
  • yKeyy-axis column (numeric)

Workflow steps

Workflow triggers: event (e.g. deals.updated), cron, or webhook.

emailSend an email.
  • torecipient
  • templatetemplate id
slackPost a Slack message. Real if integration.webhookUrl is set.
  • integrationIdid of a slack integration
  • channel#chan
  • messagetext; {colName} interpolates row values
dbUpdatePatch a row.
  • resourcetable
  • idrow id
  • patch{col: value}
apiCallPOST to any URL.
  • urltarget
  • methodGET|POST|PUT|DELETE
  • bodyoptional
delaySleep.
  • duratione.g. 30s, 1h

Prompt guide

  • Be specific about the domain (contacts + deals, not "stuff").
  • Mention what integrations should fire (e.g. Slack on new deal).
  • Say "use a Kanban board" if you want status columns as lanes.
  • Refinements work — after building, say things like "add a comments field to deals".

Test suites

pnpm --filter @app/codegen      exec tsx src/e2e-test.ts   # codegen determinism + shape
pnpm --filter @app/tenant-api   test                       # PGlite + PostgREST-shaped HTTP
pnpm --filter @app/provisioner  test                       # versioning + rollback
pnpm --filter @app/agent        test                       # verify-repair
pnpm --filter @app/platform-api test                       # multi-project + tenant mount