# Supatype > Zero drift: one set of TypeScript types runs the whole stack, database to component. Define `Model<>` types and Supatype derives the Postgres tables, migrations, row-level security, REST and GraphQL APIs, auth, storage, realtime, Studio editing views and the typed client your components use. Change a field once; rename a field and the build fails instead of production. Supatype is a type-first backend platform on real Postgres 17. The TypeScript schema is the single source of truth; SQL, policies, APIs, the typed client and admin UI are generated from it rather than kept in step by hand. `supatype dev` runs the full stack locally (Docker Compose by default), applies schema changes as you save and regenerates the typed client. Production can self-host with Docker Compose (`supatype self-host compose up`) or use Supatype Cloud (hosted in the EU, with a free tier: sign up at https://supatype.com/). Licensing: client SDKs, framework bindings and plugins are MIT; the CLI, Studio and services are Apache 2.0; the schema engine is source-available under the Business Source License 1.1 (production use allowed except offering a competing hosted service or product; each version becomes Apache 2.0 four years after release). Primary audience: TypeScript developers on Postgres who want end-to-end type safety without stitching a backend, a separate CMS and hand-written migrations together. Official site: https://supatype.com/ Organization: https://github.com/supatype Contact: GitHub and Discord, linked from the site. Licensing questions: licensing@supatype.com ## Product - [Home](https://supatype.com/): Overview: one set of types from database to component, how it works, frameworks, comparison, quick start - [Full LLM context](https://supatype.com/llms-full.txt): A product summary, then every docs and guide page as Markdown, in one file for agents with limited round-trips - [Licensing](https://supatype.com/licensing.html): What is MIT, Apache 2.0 and BSL 1.1, what you can and cannot do, Change Dates, contributing - [Sitemap](https://supatype.com/sitemap.xml): Machine-readable list of public URLs ## Docs & guides - [Docs](https://supatype.com/docs/): Local development, self-hosting, deploying changes, upgrading, plus the guides below - [Schema](https://supatype.com/docs/schema.html): Models, field types, relations, access rules, field rules and masking, drafts and versions, slugs, rich text, blocks, buckets, auth user ids, renames, what a push refuses - [Client](https://supatype.com/docs/client.html): `@supatype/client` from the generated file: queries, filters, embeds, writes, drafts and publishing, auth, storage, realtime, functions, errors - [Frameworks](https://supatype.com/docs/frameworks.html): React, Vue, Svelte, Solid and React Native bindings, and @supatype/ssr server clients for Next.js - [Auth](https://supatype.com/docs/auth.html): Email and password, magic links, phone codes and OAuth, sessions and tokens, how tokens reach access rules, the React and React Native auth UI - [Storage](https://supatype.com/docs/storage.html): Buckets declared in the schema, file and image fields, bucket access rules, uploads, signed URLs, image transforms, limits - [Realtime](https://supatype.com/docs/realtime.html): Table changes filtered by read access and field rules, filters, broadcast and presence, React and Vue hooks - [Functions](https://supatype.com/docs/functions.html): TypeScript functions on Deno at /functions/v1, the caller's token, secrets, local dev and self-host - [Seeding](https://supatype.com/docs/seeding.html): `seeds/*.ts`, the generated builder, create vs upsert, nested children, relations by key, `expr.default()`, sign-in users, `supatype seed` - [Studio](https://supatype.com/docs/studio.html): The CMS and admin app generated from your models: editors, rich text, media, drafts and versions, live preview, API docs, GraphQL explorer, SQL runner, history - [Studio roles](https://supatype.com/docs/studio-roles.html): Admin, developer, editor and viewer: what each can do, full access vs Studio mode, masking, Send as, drafts and publishing, granting roles - [CLI reference](https://supatype.com/docs/cli.html): Every supatype command with its subcommands and main flags - [Local development](https://supatype.com/docs/#local-dev): `supatype init` and `supatype dev` run a full local stack - [Self-hosting](https://supatype.com/docs/#self-host): Docker Compose on a server you own - [Upgrading](https://supatype.com/docs/#upgrading): Updating images and binaries, then pushing the schema - [Running in production](https://supatype.com/docs/#production): Status, logs, backups with pg_dump, and rolling back a push - [Upgrade notes for 0.7.0](https://github.com/supatype/supatype/blob/main/UPGRADING.md): Ownership checks, declared renames, identity columns, realtime DELETE rules, lock waits, licence - [VM deploy with GitHub Actions](https://supatype.com/docs/guides/deploy-vm-github-actions.html): Self-host deploy path using GitHub Actions onto a VM - [Coming from Supabase](https://supatype.com/docs/guides/from-supabase.html): How Supabase tables, RLS, supabase-js, storage, auth, realtime and functions map to Supatype, and adopting existing tables - [Coming from Prisma](https://supatype.com/docs/guides/from-prisma.html): How schema.prisma, prisma migrate and Prisma Client map to Supatype types, push and the typed client - [Agent skill](https://github.com/supatype/supatype/tree/main/skills/supatype): Schema, config, CLI and self-host reference for coding agents ## Postgres - [supatype/postgres](https://supatype.com/postgres): PostgreSQL 17 with PostGIS, pgvector, pg_cron and more, our own extensions, and safe defaults. The image under every Supatype project, usable on its own - [pg_keyspace](https://supatype.com/postgres/pg-keyspace): A Redis and Valkey compatible cache inside Postgres. Stock Redis clients connect, and SQL reads the same keys. Reference: https://supatype.com/docs/postgres/pg-keyspace.html - [pg_topics](https://supatype.com/postgres/pg-topics): A Postgres table as a Kafka topic for stock Kafka clients, with publish inside your own transaction. Not in the image yet. Reference: https://supatype.com/docs/postgres/pg-topics.html - [pg_guard](https://supatype.com/postgres/pg-guard): Extensions, event triggers and publications without SUPERUSER. Reference: https://supatype.com/docs/postgres/pg-guard.html - [supatype_mask](https://supatype.com/postgres/supatype-mask): Per-row column masking and write rejection, enforced in the planner. Reference: https://supatype.com/docs/postgres/supatype-mask.html ## Platform capabilities - [Migrations](https://supatype.com/#how-it-works): The Rust schema engine diffs types against the live database, classifies each change as safe, cautious or destructive, applies it in one transaction with a recorded rollback, and never guesses a rename (renames are declared with `supatype rename`) - [Access rules](https://supatype.com/#how-it-works): `Public`, `LoggedIn`, `Owner<>`, `OwnerFrom<>`, `Role<>` on models and fields compile to Postgres row-level security - [Studio](https://supatype.com/#how-it-works): Schema-generated admin and CMS: lists, forms, rich text, blocks, media library, drafts, versions, live preview. Four roles on self-host (admin, developer, editor, viewer; Cloud adds owner and billing); the SQL editor is for admins and developers, and owners on Cloud - [Storage](https://supatype.com/#how-it-works): `Bucket<>` types with accept lists, size limits and access rules; image transforms; time-limited signed URLs - [Realtime](https://supatype.com/#how-it-works): Change subscriptions, presence and broadcast; each event, deletes included, reaches only subscribers allowed to read that row - [APIs](https://supatype.com/#how-it-works): REST through PostgREST and GraphQL through pg_graphql, both running as the caller so row-level security applies. PostgREST 14; in production, browsers may call the API from the site URL and the origins you allow ## Community - [GitHub organization](https://github.com/supatype): Source repositories - [supatype/supatype](https://github.com/supatype/supatype): Main monorepo: CLI, client SDKs, framework bindings, Studio, storage, realtime - [Discord](https://discord.gg/TzMtynufEH): Community and product discussion ## Optional - [Robots policy](https://supatype.com/robots.txt): Allows search indexing and AI crawl/training/reference use - [Brand mark (SVG)](https://supatype.com/supatype.svg): Logo asset - [Icon (SVG)](https://supatype.com/supatype-icon.svg): Favicon / app icon