Skip to main content

Architecture

Foundry uses pnpm workspaces + Turborepo to manage a monorepo with multiple apps and packages.

Directory Structure

foundry/
├── apps/
│   ├── web/        Next.js 15 — frontend + SSR
│   ├── server/     Express 5 — API server
│   ├── supabase/   Migrations + config
│   └── docs/       Mintlify docs
├── packages/
│   └── shared/     Types + constants
└── scripts/        Automation utilities

Data Flow

Browser → Next.js (SSR) → Supabase (auth + data)

         Express Server → Supabase (service role)
Both the web app and server connect directly to Supabase. There is no inter-service communication by default.

Key Decisions

DecisionChoiceWhy
Package managerpnpmFast, strict, disk-efficient
Monorepo toolTurborepoZero-config, task caching
CSSTailwind v4CSS-first config, no JS config file
AuthSupabase magic linkPasswordless, simple, secure
Server runtimetsxNo bundler needed, TypeScript directly
Shared packageNo build stepRaw TypeScript via exports field