Supabase Studio is an open-source administrative dashboard for managing PostgreSQL databases, authentication, storage, and edge functions.
- Language
- TypeScript
- Database
- PostgreSQL
- Hosting
- Docker
- License
- Apache-2.0
- Running for
- 4 years 6 months
- Team
- 20+ people
Why this architecture
Centering the developer experience around PostgreSQL allows Supabase Studio to provide spreadsheet-like table editing and SQL execution directly on production databases.
Tech stack by layer
7 technologies · audited Sep 17, 2026- Next.jsPowers application routing, server-side data fetching, and API route proxies in apps/studio.
- ReactRenders the Table Editor, SQL Scratchpad, Database Visualizer, and Auth user panels.
- Tailwind CSSProvides utility styling adhering to the Supabase dark theme and design system tokens.
- Monaco EditorEmbedded code editor powering the SQL Scratchpad with syntax highlighting and autocompletion.
- TypeScriptEnsures strict type-checking across frontend interfaces, database models, and API proxies.
- DenoServerless runtime executing Supabase Edge Functions in TypeScript at the network edge.
- PostgreSQLThe primary database engine, extended with pgvector, PostGIS, pg_cron, and RLS policies.
- DockerDocker Compose orchestration suite in docker/ running local PostgreSQL, PostgREST, and Kong.
Supabase Studio architecture diagram
Open SVGDiagram as text
- Studio UI (React · Monaco) → Studio server (Next.js API routes): fetch
- Studio server (Next.js API routes) → PostgreSQL (pgvector · RLS): SQL (pg pool)
- Studio server (Next.js API routes) → API gateway (Kong): HTTP
- API gateway (Kong) → PostgREST (REST over tables): /rest
- API gateway (Kong) → Auth (GoTrue): /auth
- API gateway (Kong) → Realtime (WebSockets): /realtime
- PostgREST (REST over tables) → PostgreSQL (pgvector · RLS): queries
- Auth (GoTrue) → PostgreSQL (pgvector · RLS): auth schema
- Realtime (WebSockets) → PostgreSQL (pgvector · RLS): changes
Key architectural decisions
5 decisions- 01
PostgreSQL as the central application and authorization engine
Supabase Studio delegates authorization, table schemas, and data manipulation directly to PostgreSQL system catalogs and Row-Level Security (RLS) policies rather than custom proprietary application servers.
- 02
Next.js App and Pages architecture for administrative tooling
Studio (apps/studio) is structured as a Next.js application that combines client-side grid components (DataGrid, Table Editor) with server-side API proxy routes that interface with PostgreSQL.
- 03
Interactive SQL Scratchpad with Monaco Editor and query snippets
Studio embeds Monaco Editor (@monaco-editor/react) with customized PostgreSQL SQL language definitions, providing autocomplete, query execution history, and pre-built administrative script templates.
- 04
Modular open-source service composition via Kong API gateway
The Supabase stack in docker/ unifies independent open-source services (PostgreSQL, PostgREST, GoTrue, Realtime, Storage API) behind a single Kong API gateway proxy.
- 05
Client-side state synchronization with TanStack Query and Zustand
Studio leverages TanStack Query for caching schema catalogs and table structures, paired with Zustand stores for ephemeral UI state (sidebar collapses, active editor tabs, modal overlays).
How Supabase Studio is built
How Supabase Studio is structured
Supabase Studio is maintained as a core application within the Supabase monorepo (package.json, pnpm-workspace.yaml). The repository coordinates the cloud platform, documentation, CLI tools, and the web dashboard:
apps/studio/: The primary Next.js web application (apps/studio/package.json). It houses the Table Editor, SQL Editor scratchpad, Database Role manager, Storage bucket explorer, Auth user management dashboard, and Logs explorer.apps/docs/: The official Supabase documentation portal built with Next.js and MDX.apps/design-system/: Component library and token showcase for the Supabase UI design system.docker/: The canonical local development and self-hosted deployment suite (docker/docker-compose.yml), orchestrating PostgreSQL, PostgREST, GoTrue auth, Realtime WebSocket servers, and Kong gateways.examples/: Reference applications showcasing AI embeddings, Next.js integrations, and Flutter backends.
Frontend
The user interface in apps/studio is implemented in TypeScript on React 19 (react, react-dom in apps/studio/package.json):
- Table Editor: Delivers an Excel-like spreadsheet experience for managing database rows. It uses high-performance virtualized grids that support inline editing, column sorting, foreign key lookups, and JSON payload inspection without loading thousands of DOM nodes.
- SQL Editor: Powered by the Monaco Editor (
@monaco-editor/react), the same editor engine that drives VS Code. It features syntax highlighting for PL/pgSQL, query explain plans, and an extensive library of pre-authored SQL snippets (e.g., configuring Row-Level Security, creating vector indexes). - Design System & Styling: Styled using Tailwind CSS combined with custom CSS variables, delivering the signature Supabase dark mode aesthetic with high contrast and accessible data density.
- State Management: Asynchronous server state (database tables, column definitions, RLS policies) is synchronized and cached using TanStack Query (
@tanstack/react-query), while ephemeral client state is managed via Zustand.
Backend & APIs
Supabase Studio utilizes Next.js API routes (apps/studio/pages/api/) and server components to interface with backend services:
- Database Connection Pool: Studio routes administrative SQL commands to PostgreSQL via dedicated connection pools using
pgor the Supabase Management API. - PostgREST Integration: Relational tables and views exposed by PostgreSQL are queried directly over HTTP through PostgREST, providing instant REST endpoints.
- GoTrue Authentication: Manages user signups, magic links, social OAuth2 providers, and multi-factor authentication (MFA) credentials stored in the
authschema. - Edge Functions with Deno: The dashboard provides status monitoring and invocation logs for TypeScript serverless edge functions running on Deno.
Data & persistence
The entire Supabase architecture is centered directly on PostgreSQL:
- Core Database Engine: Runs standard PostgreSQL (versions 15 through 17 supported in
docker/). - Extensions: Supabase incorporates popular PostgreSQL extensions out of the box:
pgvector: For storing vector embeddings and running cosine similarity searches for AI applications.postgis: For geographic data and spatial queries.pg_cron: For scheduling recurring SQL jobs inside the database.
- Row-Level Security (RLS): Access control is declared via PostgreSQL RLS policies (
CREATE POLICY ...). Studio provides a visual policy builder that inspects and tests security policies against simulated user roles.
Build, test & deploy
The build and continuous integration pipelines include:
- Monorepo Tasks: Coordinated via Turborepo (
turbo.json) and pnpm workspaces. - Testing: End-to-end user workflows (creating tables, running SQL scripts, altering columns) are verified using Playwright in
e2e/studio. - Local Development: Running
docker compose upinside thedocker/directory boots up the entire Supabase stack locally, including PostgreSQL, Studio on port 3000, and Kong on port 8000.
Self-hosting notes
Operating Supabase Studio on-premises or in a private cloud:
- Clone the repository and navigate to
docker/. - Copy
.env.exampleto.envand set secure random keys forPOSTGRES_PASSWORD,JWT_SECRET, andANON_KEY. - Run
docker compose up -dto launch the multi-container stack. - Access Supabase Studio in your browser at
http://localhost:3000to manage the local database.
What to copy (and what not to)
Architectural patterns to emulate from Supabase Studio:
- Postgres as the application platform: Leaning into PostgreSQL features (RLS, stored procedures, JSONB, native extensions) eliminates custom middleware layers and ensures database portability.
- Monaco Editor for in-browser developer tooling: Integrating a full-featured code editor like Monaco provides developers with familiar IDE capabilities inside web management dashboards.
- Virtualized table grids for data density: Implementing virtualized row and column rendering allows administrative tables to browse millions of records smoothly.
Avoid exposing raw database connections directly to client browsers; always route database queries through an authenticated server-side proxy or gateway (like PostgREST or Next.js API routes) to prevent credential exposure.
Sources & repo audit
- Audited
- Sep 17, 2026
- Commit
- 66d4b4c
- License
- Apache-2.0
- apps/studio/package.json (Next.js dashboard, Monaco Editor, Tailwind CSS, TanStack Query)
- package.json (Monorepo root scripts, npm workspaces, Turborepo tasks)
- docker/docker-compose.yml (Local development stack: PostgreSQL, Kong, PostgREST, GoTrue)
Independent analysis of repository at github.com/supabase/supabase. Spotted an inaccuracy? Use the claim form to request a correction.
Show this stack on your README or website
[](https://stackitfast.com/project/supabase-studio)Paste it into your README. It shows your current stack and links to this page.
Scaffold it with your agent
Paste this prompt into Claude Code, Cursor, Windsurf or AGY to start a project with Supabase Studio's architecture.
- 1Copy the promptThe full markdown spec, with every layer and decision.
- 2Open your AI toolClaude Code, Cursor, Windsurf or Copilot, in a new repo.
- 3Paste and scaffoldUse it as the first instruction; review before you ship.
# MISSION: Scaffold "Supabase Studio" Production Architecture
You are an expert Senior Staff Software Architect and Full-Stack Engineer. Your mission is to scaffold and implement a production-grade, highly reliable, and modular codebase following the proven architecture of **Supabase Studio**.
---
## 1. PROJECT SPECIFICATIONS & BENCHMARK
- **Reference Architecture**: Supabase Studio
- **What It Does**: Supabase Studio is an open-source administrative dashboard for managing PostgreSQL databases, authentication, storage, and edge functions.
- **Domain & Category**: Developer Tool
- **Production Scale**: 20+ people
- **Development Mode**: CLASSIC
- **Architectural Rationale**: Centering the developer experience around PostgreSQL allows Supabase Studio to provide spreadsheet-like table editing and SQL execution directly on production databases.
- **Live Website Reference**: https://supabase.com
- **Source Repository**: https://github.com/supabase/supabase
---
## 2. PRODUCTION TECH STACK
- **Full Stack Array**: Next.js, React, TypeScript, PostgreSQL, Tailwind CSS, Docker, Deno
- **Primary Language(s)**: TypeScript, MDX, JavaScript
- **License of the reference repo**: Apache-2.0
- **Frontend**: Next.js — Powers application routing, server-side data fetching, and API route proxies in apps/studio.; React — Renders the Table Editor, SQL Scratchpad, Database Visualizer, and Auth user panels.; Tailwind CSS — Provides utility styling adhering to the Supabase dark theme and design system tokens.; Monaco Editor — Embedded code editor powering the SQL Scratchpad with syntax highlighting and autocompletion.
- **Backend & APIs**: TypeScript — Ensures strict type-checking across frontend interfaces, database models, and API proxies.; Deno — Serverless runtime executing Supabase Edge Functions in TypeScript at the network edge.
- **Data & persistence**: PostgreSQL — The primary database engine, extended with pgvector, PostGIS, pg_cron, and RLS policies.
- **Infrastructure & deploy**: Docker — Docker Compose orchestration suite in docker/ running local PostgreSQL, PostgREST, and Kong.
---
## 3. KEY ARCHITECTURAL DECISIONS (audited from https://github.com/supabase/supabase @ 66d4b4c)
1. **PostgreSQL as the central application and authorization engine**: Supabase Studio delegates authorization, table schemas, and data manipulation directly to PostgreSQL system catalogs and Row-Level Security (RLS) policies rather than custom proprietary application servers.
2. **Next.js App and Pages architecture for administrative tooling**: Studio (apps/studio) is structured as a Next.js application that combines client-side grid components (DataGrid, Table Editor) with server-side API proxy routes that interface with PostgreSQL.
3. **Interactive SQL Scratchpad with Monaco Editor and query snippets**: Studio embeds Monaco Editor (@monaco-editor/react) with customized PostgreSQL SQL language definitions, providing autocomplete, query execution history, and pre-built administrative script templates.
4. **Modular open-source service composition via Kong API gateway**: The Supabase stack in docker/ unifies independent open-source services (PostgreSQL, PostgREST, GoTrue, Realtime, Storage API) behind a single Kong API gateway proxy.
5. **Client-side state synchronization with TanStack Query and Zustand**: Studio leverages TanStack Query for caching schema catalogs and table structures, paired with Zustand stores for ephemeral UI state (sidebar collapses, active editor tabs, modal overlays).
---
## 4. NON-NEGOTIABLE ARCHITECTURAL GUARDRAILS
1. **Monorepo & Modular Separation**:
- Structure as a Turborepo monorepo with strict package boundaries:
- `apps/web`: Application UI, routing, layouts, and server endpoints.
- `packages/ui`: Shared design tokens, CSS variables, and Radix UI primitive components.
- `packages/db`: Database schemas, client singleton, declarative migrations, and seed scripts.
- `packages/config`: Shared TypeScript, ESLint, and build configurations.
2. **Strict Type Safety & Zero `any` Policy**:
- Enable `strict: true`, `noImplicitAny: true`, and `strictNullChecks: true`.
- Validate ALL external inputs, API request bodies, and query parameters with **Zod** schemas before execution.
3. **Frontend & Rendering Guidelines**:
- Utilize Next.js 15 App Router: default to React Server Components (RSC) for data fetching. Handle mutations through Server Actions with Zod validation. Keep 'use client' directives restricted strictly to interactive leaf components.
4. **Design System & Aesthetics**:
- Keep every color, radius, shadow and font in a single token file (CSS variables) and consume tokens everywhere; never hardcode hex values in components.
- Prefer crisp 1px borders and one subtle shadow scale over blurry default shadows. Pair one sans-serif for body/headings with one monospace for tags, badges, metrics, and code.
5. **Data Layer & Reliability**:
- Write declarative schema definitions with foreign keys, composite indexes on queried filters, and automated timestamp triggers.
- Use connection pooling and prepared statements for serverless database execution.
---
## 5. STEP-BY-STEP SCAFFOLDING ROADMAP
- **Phase 1: Workspace & Root Config**: Initialize package manager, monorepo configuration (`turbo.json`, `tsconfig.base.json`, `package.json`).
- **Phase 2: Database Schema & Client**: Set up the data layer (PostgreSQL): client, connection pool, models, and migration scripts.
- **Phase 3: Design Tokens & UI Primitives**: Build accessible `Button`, `Input`, `Card`, `Badge`, and layout wrappers inside `packages/ui`.
- **Phase 4: Core Application Routes & Handlers**: Implement primary authentication, user session handling, and application routes.
- **Phase 5: Quality Assurance & Build Verification**: Run `tsc --noEmit`, ESLint, Prettier, and smoke test suites to ensure zero compilation or runtime errors.
---
## 6. EXECUTION INSTRUCTIONS
1. Review all specifications, architectural guardrails, and stack choices above.
2. Present the full monorepo directory tree structure.
3. Systematically generate the complete, production-ready codebase according to the 5-phase roadmap above — starting with the root workspace setup, followed by the database schema, UI design system package, and full-stack application routes until the repository is fully scaffolded and ready to run.Copied 2 times · 1 of 1 reported launches succeeded (100%)
Frequently asked about Supabase Studio
What is Supabase Studio built with?
Supabase Studio is built with Next.js, React, and TypeScript, utilizing Tailwind CSS, Monaco Editor for SQL queries, and PostgreSQL for backend persistence.
Can Supabase Studio be self-hosted without the Supabase cloud?
Yes. Supabase Studio is included in the official Docker Compose suite in docker/docker-compose.yml, allowing full local or on-premises deployment.
How does Supabase Studio communicate with PostgreSQL?
Studio uses Next.js server-side API endpoints that execute SQL queries directly against the PostgreSQL database connection pool or via the Supabase management API.
Does Supabase Studio support PostgreSQL extensions like pgvector?
Yes. Studio provides dedicated visual configuration panels for enabling and managing over 50 PostgreSQL extensions, including pgvector, PostGIS, and pg_cron.
What UI stack does Supabase Studio use?
Supabase Studio is a Next.js and React app written in TypeScript, styled with Tailwind CSS, with the Monaco Editor powering its SQL editor.
Is Supabase Studio part of a Turborepo monorepo?
Yes. Studio lives in the main Supabase monorepo next to the docs and other apps, with tasks coordinated by Turborepo (turbo.json) and pnpm workspaces (pnpm-workspace.yaml).
One email a month: new deep dives and stack trends
New source-audited architectures, head-to-head comparisons and the monthly stack report. No spam, unsubscribe anytime.
Similar architectures
- shadcn/uiHybridCopy-Paste UI Component Architecture · 1M+ MAUShares React · Tailwind CSS · TypeScript
- tRPCHybridEnd-to-End Typesafe API Framework · 1M+ MAUShares TypeScript · React · Next.js
- Cosmo (WunderGraph)HybridFederated GraphQL API Gateway · 6-20 PeopleShares TypeScript · PostgreSQL · Next.js
- UmamiHybridWeb Analytics · SoloShares TypeScript · Next.js · React
- FormbricksAI-agentSurvey & Feedback SaaS · 2-5 peopleShares Next.js · TypeScript · PostgreSQL
- PrismaClassicNext-Generation Node.js & TypeScript ORM · 1M+ MAUShares TypeScript · PostgreSQL · Docker