Architecture
16 Nov 2026
15 min read

Scaling Beyond the Template: When and How to Graduate from SpaceZero

Guidance on when your micro-app has outgrown the SpaceZero template and how to migrate to a custom architecture.

Scaling Beyond the Template

SpaceZero is designed for micro-apps. Here's when and how to graduate.

When to Stay on SpaceZero

Good fit for SpaceZero:

  • Single developer or small team
  • <10k MAU
  • Simple domain logic
  • Standard SaaS features (auth, payments, DB)
  • Fast iteration priority
  • Budget conscious

When to Graduate

Signs you've outgrown SpaceZero:

1. Team Growth

  • >3 developers working simultaneously
  • Merge conflicts in shared files (index.css, tailwind.config.js)
  • Need for separate deploy pipelines

2. Complexity Growth

  • >20 API endpoints
  • Complex domain logic needing separate services
  • Real-time features (WebSockets, presence)
  • Background job processing needs

3. Scale Growth

  • >100k MAU
  • Database performance issues
  • Need for read replicas
  • Multi-region database requirements

4. Feature Requirements

  • Custom authentication flows
  • Complex permission systems
  • Multi-tenancy with data isolation
  • White-label requirements

Graduation Strategies

Keep single deploy, split codebase:

code

my-app/

├── apps/

│ ├── web/ # Frontend (React)

│ ├── api/ # Backend (Hono/Fastify/Express)

│ └── worker/ # Background jobs

├── packages/

│ ├── ui/ # Shared components

│ ├── config/ # Shared config

│ ├── db/ # Database client + schemas

│ └── auth/ # Shared auth logic

└── turbo.json # Turborepo config

Strategy 2: Service Extraction

Extract hot paths to separate services:

code

┌─────────────┐ ┌─────────────┐ ┌─────────────┐

│ Web App │────▶│ API Gateway │────▶│ Auth Svc │

└─────────────┘ └─────────────┘ └─────────────┘

│ │

▼ ▼

┌─────────────┐ ┌─────────────┐

│ Core Svc │ │ Billing │

└─────────────┘ └─────────────┘

Strategy 3: Full Microservices

Only when absolutely necessary:

  • Separate repos
  • Independent deploys
  • Service mesh (Istio/Linkerd)
  • Distributed tracing
  • Dedicated DevOps

Migration Checklist

Phase 1: Prepare (1-2 weeks)

  • [ ] Extract shared packages (ui, config, db, auth)
  • [ ] Set up Turborepo/Nx
  • [ ] Configure shared TypeScript config
  • [ ] Add changesets for versioning

Phase 2: Split Frontend/Backend (2-4 weeks)

  • [ ] Move edge functions to separate API app
  • [ ] Set up API framework (Hono recommended)
  • [ ] Configure CORS, auth middleware
  • [ ] Update frontend to call API URLs

Phase 3: Database (1-2 weeks)

  • [ ] Set up Prisma/Drizzle ORM
  • [ ] Migrate from raw SQL to typed queries
  • [ ] Configure connection pooling (PgBouncer)
  • [ ] Set up read replicas if needed

Phase 4: Infrastructure (2-4 weeks)

  • [ ] Containerize (Docker)
  • [ ] Set up Kubernetes/ECS/Cloud Run
  • [ ] Configure CI/CD per service
  • [ ] Add observability (logs, metrics, traces)

Phase 5: Advanced (Ongoing)

  • [ ] Feature flags
  • [ ] A/B testing
  • [ ] Background job queue (BullMQ, Temporal)
  • [ ] Event-driven architecture (Kafka, NATS)

What You Keep from SpaceZero

  • Design System: Tokens, components, constraints
  • Auth Patterns: Supabase Auth integration
  • Payment Patterns: Gumroad webhook handling
  • PWA Setup: Service worker, manifest
  • Discovery Pack: SEO/GEO/AEO infrastructure
  • Quality Gates: TypeScript, ESLint, Prettier, Vitest

What You Replace

  • Edge Functions → Dedicated API service
  • Single Deploy → Multi-service deploy
  • In-Memory Rate Limit → Redis/KV distributed
  • File-Based Routing → React Router/TanStack Router
  • Simple State → React Query/Zustand/Redux

Decision Framework

FactorStayGraduate
Team size≤3>3
MAU<10k>100k
Endpoints<20>50
Domain complexityLowHigh
Real-time needsNoneYes
BudgetTightAvailable

The SpaceZero Promise

Even if you graduate, the patterns stay with you:

  • Constrained design tokens
  • Component composition over styling
  • Edge-first architecture
  • Quality gates as culture
  • AI-agent-friendly structure

SpaceZero isn't just a template — it's a foundation for thinking about micro-app architecture.