supabase/supabase

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

101,134 stars TypeScript 8 components

12 hidden assumptions · 6-stage pipeline · 8 components

Like any codebase, this fullstack makes assumptions it never checks — most are routine. The ones worth your attention are below.

Builds and deploys a PostgreSQL-based development platform with database management, authentication, and web interfaces

The system operates as a multi-application platform where the studio app serves as the primary interface for database management, consuming shared UI components and PostgreSQL utilities. Marketing campaigns flow through the www app using scheduled landing pages, while documentation is served through the docs app with interactive components. The AI system in studio aggregates tools based on deployment type (cloud vs self-hosted) and user permissions, then filters them for safe database operations. Build tools process SVG assets into React components and generate type definitions from OpenAPI specifications.

Under the hood, the system uses 2 feedback loops, 4 data pools, 4 control points to manage its runtime behavior.

A 8-component fullstack. 6622 files analyzed. Data flows through 6 distinct pipeline stages.

Hidden Assumptions

Most of what this code assumes is routine. These 3 are the ones most likely to cause trouble here. The rest are minor; they're under "Show everything".

Worth your attention first

If the target file doesn't exist, has no default export, or exports a non-component, lazy loading fails at runtime with cryptic chunk loading errors that don't surface until users try to access that specific component

Worth your attention first

If IS_PLATFORM is undefined, null, or changes after startup, the tool aggregation logic silently switches between platform and self-hosted tool sets, potentially exposing unauthorized tools or breaking AI functionality

Worth your attention first

FileSystemFunctionsArtifactStore constructor succeeds but file operations fail later with permission or ENOENT errors when trying to read/write function artifacts, breaking function deployment silently

Show everything (9 more)
Shape

Values stored in localStorage are always valid JSON that can be parsed back to the original type T without data corruption

If this fails: If localStorage contains malformed JSON or data that doesn't match type T, JSON.parse throws uncaught errors and the hook returns initialValue instead, causing silent data loss of user progress and preferences

apps/learn/components/use-local-storage.tsx
Temporal

Marketing campaign pages with removal dates in comments (like 'remove after May 31, 2026') will be manually cleaned up by developers checking the comments

If this fails: Expired campaign pages remain accessible indefinitely, serving stale content and potentially invalid offers or registration forms to users, wasting server resources and confusing customers

apps/www/_go/index.tsx
Environment

typeof window === 'undefined' reliably detects server-side rendering and window.localStorage is always available when window exists

If this fails: In environments like WebView, private browsing, or when localStorage quota is exceeded, window.localStorage might be undefined or throw SecurityError, causing the hook to crash with unhandled exceptions

apps/learn/components/use-local-storage.tsx
Resource

Custom font files (CustomFont-Book.woff2, CustomFont-Bold.woff2, etc.) exist in the same directory as this font configuration file

If this fails: If font files are missing, Next.js font loading fails silently and falls back to the fallback fonts without any error indication, potentially breaking the design system's visual consistency

apps/design-system/app/fonts/index.ts
Contract

The getMcpTools, getSchemaTools, and getIncidentTools functions return objects that conform to the ToolSet type structure without validation

If this fails: If any tool function returns malformed tools with missing required properties like name, description, or invalid parameter schemas, the AI system receives broken tool definitions and fails with runtime errors during tool execution

apps/studio/lib/ai/tools/index.ts
Ordering

Object.keys(iconNodes) iteration order matches the expected icon export order and iconName keys are valid filesystem names that can be converted to PascalCase

If this fails: If iconNodes contains keys with invalid characters or the toPascalCase conversion produces duplicate component names, the generated export file has syntax errors or name collisions that break the build

packages/build-icons/src/building/generateExportsFile.mjs
Domain

The API and platform OpenAPI schemas have non-overlapping component names in their schemas, responses, parameters, requestBodies, headers, and pathItems sections

If this fails: If both API specs define components with identical names but different shapes, TypeScript interface merging creates union types that break type safety, causing client code to receive unexpected data structures

packages/api-types/index.ts
Scale

The number of lazy-loaded components in the registry won't exceed browser limits for concurrent dynamic imports or chunk loading

If this fails: With hundreds of components, simultaneous lazy loading could hit browser connection limits or cause memory pressure, leading to failed imports or degraded performance in the design system showcase

apps/design-system/__registry__/index.tsx
Contract

The dynamically imported './AppleSecretGenerator' component exists and exports a default React component that doesn't require SSR

If this fails: If the component doesn't exist, has no default export, or accidentally uses SSR-only APIs, the dynamic import fails and users see loading state indefinitely or get runtime errors

apps/docs/components/AppleSecretGenerator/index.tsx

Open the standalone hidden-assumptions report for supabase →

How Data Flows Through the System

The system operates as a multi-application platform where the studio app serves as the primary interface for database management, consuming shared UI components and PostgreSQL utilities. Marketing campaigns flow through the www app using scheduled landing pages, while documentation is served through the docs app with interactive components. The AI system in studio aggregates tools based on deployment type (cloud vs self-hosted) and user permissions, then filters them for safe database operations. Build tools process SVG assets into React components and generate type definitions from OpenAPI specifications.

  1. AI tool aggregation — The getTools function checks deployment type (IS_PLATFORM) and user permissions, then aggregates studio tools with platform-specific tools like MCP and schema tools for cloud deployments, or fallback tools for self-hosted instances [AiOptInLevel → ToolSet] (config: catalog.@supabase/supabase-js)
  2. Tool filtering — filterToolsByOptInLevel removes AI tools that require higher permission levels than the user has opted into, ensuring privacy and security boundaries are respected [ToolSet → ToolSet]
  3. Campaign page routing — The www app uses the static pages array to serve marketing campaign pages, with each GoPageInput containing expiration dates for automatic cleanup of time-limited campaigns [GoPageInput]
  4. Component registry lookup — The design system and ui-library registries use lazy loading to serve component demos, mapping component names to their implementations with React.lazy for performance
  5. Asset compilation — Build tools read SVG files from directories, convert filenames from kebab-case to PascalCase, and generate TypeScript export files for icon components [IconNode → TypeScript export files] (config: packages)
  6. Type definition merging — The api-types package combines OpenAPI schemas from both internal API and platform services into unified TypeScript interfaces for type-safe client development (config: catalog.@types/node, catalog.@types/react)

Data Models

The data structures that flow between stages — the contracts that hold the system together.

ToolSet apps/studio/lib/ai/tools/index.ts
Record<string, Tool> where Tool contains name, description, parameters schema, and execution function for AI-powered database operations
Created by combining studio, schema, MCP, and incident tools, then filtered based on user's AI opt-in level before being provided to AI assistant
GoPageInput apps/www/_go/index.tsx
Configuration object containing route path, component reference, and metadata for marketing campaign pages
Defined statically in the pages array, used by the routing system to serve campaign-specific landing pages with scheduled removal dates
AiOptInLevel apps/studio/lib/ai/tools/index.ts
Enum with values 'disabled' | 'basic' | 'advanced' controlling which AI features and tools are available to users
Set by user preference, used to filter available AI tools and determine which database metadata can be accessed by AI features
IconNode packages/build-icons/src/building/generateExportsFile.mjs
Object mapping icon names to their SVG content and metadata, generated from filesystem SVG files
Created by reading SVG files from directory, transformed into React components with PascalCase names, then exported as barrel exports
APIComponents packages/api-types/index.ts
TypeScript interface merging schemas, responses, parameters, requestBodies, headers, and pathItems from both API and platform OpenAPI specifications
Auto-generated from OpenAPI specs, merged into unified type definitions, consumed by client applications for type-safe API interactions

System Behavior

How the system operates at runtime — where data accumulates, what loops, what waits, and what controls what.

Data Pools

Component Registry (registry)
Maps component names to lazy-loaded React components for the design system showcase
Campaign Pages Store (in-memory)
Static array of marketing campaign configurations with scheduled expiration dates
Local Storage (cache)
Browser-based persistent storage for user preferences and learning progress
Functions Artifact Store (file-store)
File system storage for Edge Functions artifacts in self-hosted deployments

Feedback Loops

Delays

Control Points

Technology Stack

TypeScript (runtime)
Primary language for type-safe development across all applications and libraries
React (framework)
UI framework for building all web applications and shared component libraries
Next.js (framework)
Full-stack React framework powering the studio app, marketing site, and documentation
pnpm (build)
Package manager with workspace support for managing dependencies across the monorepo
PostgreSQL (database)
Core database technology that the entire platform is built around managing and extending
React Router (framework)
Client-side routing for the lite-studio application
Tailwind CSS (framework)
Utility-first CSS framework for consistent styling across all applications

Key Components

Package Structure

studio (app)
Main dashboard application for managing PostgreSQL databases, users, APIs, and infrastructure with AI-powered assistance.
www (app)
Marketing website and landing pages for events, webinars, and lead generation campaigns.
docs (app)
Documentation site with interactive components and code examples for the platform.
ui (library)
Shared React component library providing consistent UI elements across all applications.
ui-patterns (library)
Higher-level UI patterns and composed components built on top of the base UI library.
pg-meta (library)
PostgreSQL metadata extraction and schema introspection library.
design-system (tooling)
Design system showcase and component registry for UI development.
api-types (shared)
TypeScript type definitions for platform and API schemas.

Explore the interactive analysis

See the full architecture map, data flow, and code patterns visualization.

Analyze on CodeSea

Compare supabase

Related Fullstack Repositories

Frequently Asked Questions

What is supabase used for?

Builds and deploys a PostgreSQL-based development platform with database management, authentication, and web interfaces supabase/supabase is a 8-component fullstack written in TypeScript. Data flows through 6 distinct pipeline stages. The codebase contains 6622 files.

How is supabase architected?

supabase is organized into 4 architecture layers: Applications, UI Libraries, Core Libraries, Tooling. Data flows through 6 distinct pipeline stages. This layered structure keeps concerns separated and modules independent.

How does data flow through supabase?

Data moves through 6 stages: AI tool aggregation → Tool filtering → Campaign page routing → Component registry lookup → Asset compilation → .... The system operates as a multi-application platform where the studio app serves as the primary interface for database management, consuming shared UI components and PostgreSQL utilities. Marketing campaigns flow through the www app using scheduled landing pages, while documentation is served through the docs app with interactive components. The AI system in studio aggregates tools based on deployment type (cloud vs self-hosted) and user permissions, then filters them for safe database operations. Build tools process SVG assets into React components and generate type definitions from OpenAPI specifications. This pipeline design reflects a complex multi-stage processing system.

What technologies does supabase use?

The core stack includes TypeScript (Primary language for type-safe development across all applications and libraries), React (UI framework for building all web applications and shared component libraries), Next.js (Full-stack React framework powering the studio app, marketing site, and documentation), pnpm (Package manager with workspace support for managing dependencies across the monorepo), PostgreSQL (Core database technology that the entire platform is built around managing and extending), React Router (Client-side routing for the lite-studio application), and 1 more. A focused set of dependencies that keeps the build manageable.

What system dynamics does supabase have?

supabase exhibits 4 data pools (Component Registry, Campaign Pages Store), 2 feedback loops, 4 control points, 3 delays. The feedback loops handle self-correction and cache-invalidation. These runtime behaviors shape how the system responds to load, failures, and configuration changes.

What design patterns does supabase use?

5 design patterns detected: Monorepo Package Isolation, Lazy Component Registry, Progressive Enhancement, Permission-Based Feature Gating, Asset Generation Pipeline.

How does supabase compare to alternatives?

CodeSea has side-by-side architecture comparisons of supabase with appwrite. These comparisons show tech stack differences, pipeline design, system behavior, and code patterns. See the comparison pages above for detailed analysis.

Analyzed on April 20, 2026 by CodeSea. Written by .