Database
NativeExpress uses Supabase Postgres for chat history, scan results and generated image records. The app reads them through a typed client and React Query hooks.
Your agent can query this database, run migrations and deploy functions directly. Scope the connection first: see agent tools.
Prerequisites
Complete the Supabase project setup.
The schema
| Table | Holds |
|---|---|
threads | One row per AI conversation |
messages | One row per chat message, with its parts as JSON |
generations | One row per generated image |
scans | One row per scan result |
The users entity in the diagram is Supabase Auth’s auth.users table. The
boilerplate creates the four tables listed above, two storage buckets, and the
count_monthly_usage function used for the free allowance.
The avatars bucket is public. The chat-media bucket is private and holds chat
attachments, generated images and scan photos under each user’s ID.
The four tables have owner-scoped row-level security. Queries through the app’s
authenticated Supabase client return only the signed-in user’s rows without an
extra user_id filter.