Skip to content

πŸ—οΈ Architecture (MVP)

Overview

Simple, pragmatic architecture for a 3-person startup building an MVP. No over-engineering, just proven patterns that work.

Key Documents

Core Technical Decisions

Architecture Principles

1. Edge-First

  • Deploy to Cloudflare's edge network
  • Fast globally without complexity
  • Workers for API, Pages for frontend

2. Monolith First

  • Single React 19 SPA with Vite for frontend
  • Supabase backend services
  • Shared TypeScript types
  • Split later if needed (probably won't)

3. Managed Services

  • Supabase for database (PostgreSQL)
  • Kinde for authentication
  • Cloudflare for hosting
  • Less to manage = more time to build

4. Security by Default

  • HTTPS everywhere (Cloudflare)
  • Row Level Security in database
  • Authentication required for all data
  • No shortcuts on security

System Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Cloudflare    β”‚     β”‚   Kinde Auth    β”‚
β”‚     Pages       │────▢│    (OAuth)      β”‚
β”‚  (React + Vite) β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    Supabase     β”‚     β”‚    SendGrid     β”‚
β”‚  (PostgreSQL)   β”‚     β”‚    (Email)      β”‚
β”‚   + Edge Fns    β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Development Workflow

  1. Local Dev: pnpm dev with hot reload
  2. Test: Basic unit tests, no over-testing
  3. Deploy: Push to GitHub, auto-deploy
  4. Monitor: Cloudflare Analytics + Sentry

What We're NOT Building

  • Microservices (monolith is fine)
  • Kubernetes (Cloudflare handles scaling)
  • Complex caching (CDN is enough)
  • Custom authentication (Kinde works great)
  • GraphQL (REST is simpler)
  • Event sourcing (just use PostgreSQL)

Performance Targets

  • Page load: < 3 seconds on 3G
  • API response: < 500ms globally
  • Uptime: 99.9% (Cloudflare SLA)
  • Concurrent users: 1000+ (easy with edge)

Cost Estimates (Monthly)

  • Cloudflare: $5-20 (Workers + Pages)
  • Supabase: $0-25 (free tier β†’ pro)
  • Kinde: $0-75 (free β†’ growth)
  • Total: < $150/month for MVP

Next Steps

  1. Set up GitHub repo
  2. Initialize React 19 + Vite project
  3. Deploy hello world to Cloudflare Pages
  4. Add Supabase + Kinde Auth
  5. Build first feature

Keep it simple. Use managed services. Focus on product-market fit.