Platform Architecture

Shared infrastructure.
Infinite apps.

Every app on Sangra runs on the same production-grade backend. No duplicated infrastructure, no DevOps overhead.

┌─────────────────────────────────────────────────────────────┐
  │                      Sangra.ai Platform                      │
  │                                                             │
  │   ┌──────────────┐  ┌──────────────┐  ┌──────────────┐    │
  │   │ DailyManager │  │  ApplyPilot  │  │  SalesPilot  │    │
  │   │     .ai      │  │              │  │              │    │
  │   └──────┬───────┘  └──────┬───────┘  └──────┬───────┘    │
  │          │                 │                  │            │
  │          └─────────────────┴──────────────────┘            │
  │                            │                               │
  │                    ┌───────▼────────┐                      │
  │                    │   AI Gateway   │ ← Prompt config DB   │
  │                    │  GPT-4o / mini │                      │
  │                    └───────┬────────┘                      │
  │                            │                               │
  │          ┌─────────────────┴──────────────────┐            │
  │          │                                    │            │
  │  ┌───────▼───────┐                   ┌────────▼──────┐    │
  │  │   Supabase    │                   │  Stripe       │    │
  │  │   Database    │                   │  Connect      │    │
  │  │   (shared)    │                   │  (per app)    │    │
  │  └───────────────┘                   └───────────────┘    │
  └─────────────────────────────────────────────────────────────┘
Core Components

Everything an AI app needs

🧠

AI Gateway

Centralized AI routing layer. Every app accesses GPT-4o and GPT-4o-mini through a shared gateway. Model selection is configured per call type in the database — no code changes required.

Model routing: status_check → gpt-4o-mini · daily_report → gpt-4o
🗄️

Shared Database

Supabase PostgreSQL with row-level security. Apps, users, projects, tasks, AI logs, and usage logs all live in a shared schema. Each app's data is isolated by RLS policies.

8 core tables · RLS enabled · Supabase US East
⚙️

Prompt-Driven Architecture

App behavior is defined through database records, not code. Prompts, model configurations, and response formats are stored in app_config. Developers update behavior without deployments.

System prompts · User prompts · Temperature · Max tokens
🔒

Authentication

Platform-level user authentication. Developers don't write auth logic — users are managed at the Sangra layer and apps receive verified user context on every request.

JWT-based · Per-app user isolation · Session management
💳

Billing Infrastructure

Stripe Connect handles payments across all apps. Revenue is automatically split between the developer and Sangra on every transaction. No billing code needed.

80% developer / 20% Sangra (BETA) · Stripe Connect · Auto payouts
📊

Usage & Analytics

Every AI call is logged with model, token count, cost, and latency. Usage logs track per-user activity across all apps. Developers access their app's analytics through the platform dashboard.

ai_logs · usage_logs · Cost tracking · Token metering
Tech Stack

Built on proven tools

Sangra is built on a production-grade stack of battle-tested technologies. Nothing experimental in the critical path.

Start Building →
Framework
Next.js 14App Router
Database
SupabasePostgreSQL + RLS
ORM
Prisma v7Type-safe queries
AI Models
OpenAIGPT-4o + GPT-4o-mini
Hosting
RailwayAuto-deploy
Payments
Stripe ConnectMulti-party
Monorepo
pnpm workspacesShared packages
Validation
ZodRuntime env + schema

Ready to build on Sangra?

No infrastructure to set up. No AI billing to configure. Just build.

Developer Program →Read the Docs