1 — Inputs del proyecto (Karpathy #1)
team_size
6 eng
team_size_12mo
14 eng
cadence
daily
user_facing
true
budget_usd/mo
$6,000
traffic_p99_rps
80 RPS
data_sensitivity
pii-only
read_write_ratio
1:1
2 — Perfil recomendado
saas-startup
FIT 100%
Customer-facing SaaS product, < 10 engineers, < $10M ARR. Pre-product-market-fit o justo pasándolo. Cadencia: daily+. Cloud ceiling: $3-8K/mo. Hiring against the stack via standard recruiter pipeline.
✓team_size ≤ 10
✓team_size_12mo ≤ 25
✓cadence ~ daily-or-per-pr
✓budget ≤ $8000/mo
✓user_facing = true
✓data_sensitivity ~ pii-only
3 — Stack recomendado
▶ Frontend
framework
Next.js 14+
rendering
RSC default
styling
Tailwind CSS
state
RSC + Zustand
ts
strict mode
▶ Backend
pattern
modular monolith
api
Next API routes
db
PostgreSQL
orm
Prisma / Drizzle
cache
Redis (optional)
▶ Infra
hosting
Vercel / Fly.io
database
Neon / Supabase
observ.
Sentry / Axiom
flags
GrowthBook
ci/cd
GitHub Actions
🎯 SLO Floor — Criterios verificables
| Métrica | Target | Estado |
|---|---|---|
| p50 API latency | ≤ 100ms | DEFINED |
| p95 API latency | ≤ 300ms | DEFINED |
| p99 API latency | ≤ 800ms | DEFINED |
| LCP mobile 4G | ≤ 2,500ms | DEFINED |
| INP | ≤ 200ms | DEFINED |
| Uptime SLO | 99.5% | DEFINED |
| Deploy time max | 15 min | DEFINED |
| Test coverage min | 60% | DEFINED |
🔍 Auditoría Codebase Actual (Express.js Prototipo)
0
F
Score actual
CRITICAL
0
HIGH
1
MEDIUM
3
LOW
77
Files
3 archivos
Lines
1,961 LOC
Test coverage
0%
Complexity avg
80.0
⚠ Credentials hardcodeadas detectadas + sin TypeScript + complejidad ciclomática muy alta. Migración requerida antes de GA.
4 — Estructura scaffolded: flowdesk-saas (Next.js 14 + App Router)
flowdesk-saas/
├── app/ # Next.js App Router
│ ├── (auth)/
│ │ ├── login/page.tsx # Login con Google + email
│ │ └── register/page.tsx
│ ├── (dashboard)/
│ │ ├── projects/page.tsx # RSC — lista proyectos
│ │ ├── projects/[id]/page.tsx
│ │ ├── time-tracking/page.tsx
│ │ └── billing/page.tsx
│ ├── api/
│ │ ├── projects/route.ts # REST endpoints
│ │ ├── time-entries/route.ts
│ │ └── auth/[...nextauth]/route.ts
│ ├── layout.tsx
│ └── globals.css
├── components/
│ ├── ui/ # Atomic Design — Shadcn/ui
│ ├── features/ # Container components
│ └── layouts/
├── lib/
│ ├── db.ts # Prisma client singleton
│ ├── auth.ts # Auth.js config
│ └── validations.ts # Zod schemas
├── prisma/
│ └── schema.prisma # PostgreSQL schema (multi-tenant)
├── tests/
│ ├── unit/ # Jest + Testing Library
│ └── e2e/ # Playwright
├── .github/workflows/ci.yml # GitHub Actions CI/CD
├── docker-compose.yml # Dev: postgres + redis
├── .env.example # Sin secrets en repo ✓
├── package.json
└── tsconfig.json # strict: true
5 — Anti-patrones prohibidos en este perfil
microservices
KILL — wrong team-size shape. Con 6 eng la overhead de comunicación supera el beneficio.
kubernetes
KILL — Vercel/Fly ya gestiona el runtime. K8s añade 2 SREs de overhead mínimo.
event-sourcing
KILL — pre-PMF YAGNI. PostgreSQL con timestamps cubre todos los casos de FlowDesk ahora.
graphql-federation
KILL — sin segundo equipo para federar. Una sola API Next.js routes es suficiente.
kafka
KILL — Postgres LISTEN/NOTIFY o PgQ maneja 80 RPS p99. Kafka introduce Zookeeper/MSK cost.
service-mesh
KILL — no hay servicios que meshear. Istio/Linkerd añade latencia sin beneficio.
6 — Plan de acción priorizado
-
P0
SECURITY — Eliminar credentials hardcodeadas del repoRotar secretos inmediatamente. Mover a .env.local + vault. Añadir git-secrets pre-commit hook. Auditar git history con BFG repo-cleaner.
-
P0
MIGRATION — Scaffoldear nuevo proyecto Next.js 14 con TypeScript strictEjecutar project_scaffolder.py nextjs flowdesk-saas. Migrar módulo a módulo con feature flags (GrowthBook). No big-bang rewrite.
-
P1
TESTING — Test coverage 0% → 60% mínimoInstalar Jest + Testing Library. Empezar por lógica de facturación (alto riesgo). CI gate: merge bloqueado si coverage < 60%.
-
P1
DATABASE — Migrar a PostgreSQL con Prisma (multi-tenant row-level security)Usar Neon o Supabase hosted. Implementar RLS para aislar datos de cada agencia. Schema-first con Prisma migrations.
-
P2
OBSERVABILITY — Configurar Sentry + Axiom desde día 1Un solo tool de observabilidad (no mezclar Datadog+New Relic+Sentry). Definir alertas para p99 > 500ms y error-rate > 0.1%.
-
P2
REAL-TIME — Usar Postgres LISTEN/NOTIFY para notificaciones (no WebSocket DIY)Con 80 RPS p99, Postgres LISTEN/NOTIFY es suficiente. Evaluar Supabase Realtime si el equipo quiere abstracción managed.
7 — Forcing-question library (Matt Pocock grill) — FlowDesk answers
- Q1 Team size today + 12-month headcount? 6 hoy → 14 en 12mo
- Q2 Deployment cadence — per-PR, daily, weekly, quarterly? daily con feature flags
- Q3 Customer-facing, internal tool, or marketing site? customer-facing SaaS (PII)
- Q4 One-year p50/p99 traffic forecast? p99 ≈ 80 RPS en pico
- Q5 Hiring against the stack or training the team? hiring contra Next.js + TS
- Q6 Year-one monthly cloud + SaaS ceiling? $6,000/mes (dentro de $8K ceiling)
- Q7 Three verifiable success criteria with numeric targets? p95 < 200ms · LCP < 2.5s · uptime 99.9%
8 — Named approvers (este tool NUNCA auto-aprueba)
stack_change
tech-lead
production-data-migration
tech-lead + on-call
external-service-add
tech-lead + cfo
9 — Canon de referencia
-
◆
Will Larson — An Elegant Puzzle (2019)
Team-size-to-architecture mapping. Con <10 eng, monolito modular supera microservicios en velocity y reliability. -
◆
Sam Newman — Building Microservices 2e (2021), ch. 1
MonolithFirst: no extraigas servicios hasta tener boundaries estables. FlowDesk está en fase de descubrimiento de producto. -
◆
Tomasz Tunguz — Cloud Cost Discipline essays (2020-2024)
$6K/mes en Vercel + Neon + Sentry es predecible y escalable hasta ~$1M ARR sin re-arquitectura de infra. -
◆
DORA State of DevOps 2023
Elite cadence (daily+) en monolito outperforma Medium cadence en microservicios en 4 de 4 métricas DORA.