Skip to content

Work / Trunk / Wiki / Decisions

2026-10-23-stack-revisited

Decisioncanonicalverified 2026-10-23

DECISION.2026-10-23.STACK-REVISITED

The stack, checked again before the rebuild

Decision

Keep the core (Turborepo, Next.js 16, tRPC, Prisma, Postgres, Playwright, Better Auth, the table queue) and settle what 2026-10-12 left open or what has changed since:

Part 2026-10-12 Now
Hosting one Docker Compose server Staging: Vercel Hobby, free; the worker runs on the owner's machine when needed. Production: held until the first customer; then one small server for the web app and the worker (Oracle Cloud Always Free in Mumbai or Hyderabad, ₹0, else OVHcloud Mumbai 2 vCPU / 4 GB, about ₹586 a month with GST)
Database Postgres Neon Free (0.5 GB) for staging and for production until it is outgrown; Prisma pinned to 7.10.1 (latest is an 8.0 RC); RLS via set_config(..., true) per transaction
Files Cloudflare R2 Cloudflare R2, free to 10 GB, with no fee for reads; staging moves off Vercel Blob in the rebuild
Email Amazon SES Resend Free (3,000 a month) + React Email; staging may log to the console
Payments not chosen Polar (merchant of record): its sandbox on staging; on production only a fee per sale
Accessibility Lighthouse @axe-core/playwright; Lighthouse removed
MCP SDK v1 over stdio @modelcontextprotocol/server v2 on spec 2026-07-28, remote at babul.dev/mcp via mcp-handler, OAuth 2.1 from Better Auth; stdio through mcp-remote
CLI own commander 15 bundled by esbuild; personal tokens now, Better Auth device flow next
Editor — real HTML in an iframe with an own overlay; @xyflow/react 12 for Journey; own undo stack
Versioning — property change rows and an own three-way merge; no CRDT
Presence — Postgres heartbeat
Errors and abuse — Sentry Free, Postgres counters for limits; on the server, Caddy for HTTPS and its rate limits

The whole picture is architecture-overview.

Why

The owner asked for the best libraries and tools before any code. Four research passes (capture and compare; editor and versioning; platform; CLI, MCP, codegen and AI) checked current versions on the npm registry and vendors' pages on 2026-10-23. The rule was the simplicity rules: the smallest set that works, battle-tested, own code only where it is the product.

Versions checked (npm, 2026-10-23): playwright 1.64.1 · pixelmatch 8.0.0 · svgo 4.1.0 · css-tree 3.2.1 · @axe-core/playwright 4.14 · @xyflow/react 12.12.0 · better-auth 1.7.12 · @polar-sh/sdk 1.0.2 · resend 6.34.1 · react-email 6.11.3 · prisma 7.10.1 · @vercel/blob 2.8.2 · @sentry/nextjs 11.8.0 · botid 1.5.11 · commander 15.0.0 · esbuild 0.28.2 · @modelcontextprotocol/server 2.3.1 · mcp-handler 2.3.0 · @anthropic-ai/sdk 1.1.0.

What was weighed and not taken: Crawlee (a second crawl state beside Postgres), hosted browsers (send role passwords and egress control to a third party; short sessions), canvas engines such as tldraw, Konva or Fabric (cannot lay out real CSS; tldraw needs a paid licence), CRDTs such as Yjs, Automerge or Loro (they merge silently; Babul must show conflicts), realtime vendors (Liveblocks, Ably, Pusher) for "who is here", Stripe (no Indian individuals; not a merchant of record), Paddle (usage billing in beta), Lemon Squeezy (being folded into Stripe), pg-boss, Inngest and Trigger.dev (the table queue is enough), Mitosis (a compiler Babul cannot steer), Style Dictionary and Terrazzo (no Figma-variables output), AI SDK + AI Gateway (one provider; add only for fallbacks).

Impact

  • architecture-overview is the plan the rebuild follows.
  • The rebuild removes packages/kit, Lighthouse and anything knip finds unused, and moves packages/mcp to SDK v2.
  • Ops now: a Polar sandbox, a Resend account, an R2 bucket, a Sentry project, all free. A production server only with the first customer. Each new secret goes to ~/git/local/secrets/ the day it exists.
  • Releases go to staging only until then (T009, T065).

Status

Active. Approved by the owner on 2026-10-23, with two changes: staging uses only free plans, and production waits for the first customer, then runs on the cheapest server that fits, priced in INR.

Cost

Staging Production, from the first customer
Server (web app and worker) ₹0 — Vercel Hobby; the worker on the owner's machine ₹0 on Oracle Always Free, else ~₹586 (OVHcloud Mumbai)
Neon, R2, Resend, Sentry ₹0 ₹0 until a free plan is outgrown
Polar ₹0 (sandbox) about 5% + ₹44 a charge, +1.5% on foreign cards
Claude ₹0 (a stand-in answers) paid per use, inside each plan's AI limit
A month ₹0 ₹0–600, plus per-sale fees

Move up (Vercel Pro, a managed worker) only when customers make the server too small. Assumed $1 ≈ ₹88.

Sources

  • The four research reports of the session of 2026-10-23, with links to the npm registry, vendors' pricing pages and docs.