Files
Sauci/docs/architecture/system.md
T
jjbrunton 01bb8225ae chore(harness): make repository agent-ready
Add concise routed context, task-aware agent roles, focused skills, and structured learning promotion.\n\nUnify local development and workspace tooling, add layered test and E2E verification, harden MCP authentication, and gate deployment behind verification and explicit production promotion.
2026-08-27 20:58:48 +01:00

1.5 KiB

System architecture

Sauci is an npm workspace coordinated by Turborepo.

Component Technology Responsibility
Mobile Expo / React Native / Expo Router primary customer product
Admin Vite / React content and administrative operations
Web Next.js App Router marketing, policies, redemption
Backend Supabase Postgres/Auth/Realtime/Edge Functions identity, data, workflows
MCP Hono / MCP SDK authenticated internal administrative tools
Shared TypeScript types cross-application contracts only

Trust boundaries

  • Mobile and web use public Supabase credentials and depend on RLS.
  • Administrative access requires both an authenticated identity and role checks.
  • Service-role edge functions authenticate and authorize callers before user-data operations.
  • MCP has privileged access and requires SAUCI_MCP_API_KEY; absent credentials must never make a non-local deployment public.
  • Local verification uses local Supabase, never a remote project.

Product flow

Two profiles join a couple, answer questions independently, and the submit-response edge function creates a match when answers are compatible. Realtime subscriptions surface matches and chat messages to the partner.

Change boundaries

  • Database shape: migration plus generated/shared types plus affected clients.
  • Edge function contract: function tests plus calling UI/store behavior.
  • Shared contract: update every consumer in the same change.
  • UI flow: component/unit coverage and observable E2E evidence.