Cheap, Scalable Stack — Cloudflare-first
Constraint: run the whole business on < Rp1,5jt/mo until 1.000 paying accounts, then scale by adding nodes, not by re-architecting. Prices are bands as of Dec 2026 — verify before purchase; Cloudflare changes free-tier limits quietly.
1. Split of responsibilities
┌──────────────────────── Cloudflare (edge, free→$5/mo) ───────────────────────┐
marketing site │ Pages (static) · Turnstile · Web Analytics · Images · R2 assets │
API + webhooks │ Workers (FastAPI-equivalent) · Queues · D1 (config/funnel) · KV (cache/ratelimit)│
status + uptime │ Worker cron (1-min) · D1 checks · status page · notifier fanout │
email in/out │ Email Routing (inbound) · Resend/SES (outbound) · Email Workers (parse replies) │
LLM/AI surface │ static /llms.txt /facts.json /pricing.md on Pages · /mcp on a Worker │
funnel + analytics │ Pages forms → Worker → D1 leads · Zaraz server-side → PostHog · Web Analytics │
└────────────────────────────────────────────────────────────────────────────────┘
┌──────────── Hetzner / Fly (containers, the part CF cannot do) ─────────────┐
ingestion │ Playwright robots, adapter workers, scheduler consumer │
mutation ledger │ Postgres 16 + RLS (self-hosted or Neon) │
└────────────────────────────────────────────────────────────────────────────┘
Hard truth: Cloudflare Workers cannot run Chromium or hold long sockets to bank portals. Ingestion stays on containers. Everything else belongs on the edge — that is what keeps the bill near zero.
2. Capability → tool table
| Capability | Tool | Plan / limit | Cost band | Why this one |
|---|---|---|---|---|
| Marketing site + blog + docs | Cloudflare Pages | free, 500 builds/mo, unlimited requests | Rp0 | static, fast, no server to patch |
| Bot defence on signup/forms | Turnstile | free | Rp0 | replaces reCAPTCHA; Playwright-safe UX |
| API + webhook receiver | Workers | Free 100k req/day → Paid $5/mo 10M req | Rp0–80k | global, cold-start-free enough for webhooks |
| Queue for webhook fanout / retries | Cloudflare Queues | paid, per-op | ~Rp5–60k | replaces Redis+Sidekiq for delivery |
| Config, plans, leads, status data | D1 (SQLite) | free 5GB / 5M row-reads/day | Rp0–100k | enough for anything except the mutation ledger |
| Cache, rate limit, sessions | KV + Durable Objects | free tier → paid | Rp0–80k | token-bucket per tenant |
| Assets, DB backups, logs archive | R2 | 10GB free, zero egress | Rp0–50k | statement PDFs, dumps, log archive |
| Uptime checks + downtime log | own Worker cron (1-min) + D1 + Pages status page | included in Workers | Rp0 | you own the history; no vendor lock; publishable 30-day uptime |
| External vantage point | Hetzner cron or BetterStack free (10 monitors) | free | Rp0 | second opinion so CF cannot hide its own outage |
| Incident notify | Worker → Telegram + email (Resend) + RSS | free | Rp0 | Telegram is instant and free |
| Transactional email | Resend free 3k/mo → $20/50k; or Amazon SES $0,10/1k | free→ | Rp0–300k | Resend for DX, SES for volume |
| Inbound email (verification, replies) | Cloudflare Email Routing + Email Workers | free | Rp0 | parse verify@ / support@ without a mail server |
| WhatsApp notifications | Meta Cloud API direct (utility templates) or Indonesian BSP | per message | Rp150–400/msg est. | do not buy an "unlimited" gateway for compliance-critical alerts |
| Telegram channel | Bot API | free | Rp0 | default notification channel; groups supported |
| Web push (PWA) | OneSignal free 10k subs, or self-host web-push |
free | Rp0 | no app store needed for push |
| Error tracking | Sentry free 5k events/mo | free→$26 | Rp0–400k | stack traces beat log grepping |
| Structured logs / query | Workers Logpush → R2 (paid plan) + Axiom free ingest tier | free→ | Rp0–300k | Workers logs are not queryable without Logpush |
| Product analytics + funnels | PostHog Cloud free 1M events/mo | free→ | Rp0–500k | funnels, session replay, feature flags in one |
| Traffic floor analytics | Cloudflare Web Analytics | free, cookieless | Rp0 | no consent banner needed, no sampling games |
| Server-side conversion events | Zaraz → PostHog/GA4/Meta CAPI | free tier | Rp0 | ad-blocker-proof attribution |
| A/B + feature flags | PostHog flags | included | Rp0 | no separate tool |
| Ingestion containers | Hetzner CX22/CX32 (2–4 vCPU) | — | €3,79–6,80/mo | cheapest real CPU; Playwright fits |
| Mutation ledger | Postgres 16 — self-host on Hetzner or Neon free 0,5GB | — | Rp0–300k | RLS is the isolation model |
| Cron/scheduler for robots | systemd timers or Celery beat on the Hetzner box | — | Rp0 | no orchestrator tax |
| Payments/subscription billing | Midtrans/Xendit recurring or manual VA + points top-up | per txn | % of txn | you already integrate them |
3. Uptime monitoring that is actually publishable
Design (T-owned, ~120 lines):
Worker cron "* * * * *"
for provider in providers: # 12 banks + 4 rails, not per account
probe sandbox/synthetic endpoint (signed SNAP call or status endpoint)
write {provider, ts, ok, latency_ms, error_code} → D1
rollup_job (hourly): 30-day success %, p95 latency, incident windows
notify: transition to DOWN/UP → Telegram + email + RSS, one message per incident (state machine, no flapping spam)
status page (Pages, static generated every 5 min):
per-provider: status, 30-day %, p95, last success, incident history
global: "all systems" banner, incident timeline with postmortem link
Rules that make it trustworthy:
- Probe the provider endpoint, not our own app — customers care whether BCA is reachable.
- One incident object per outage, with start/end, cause, remediation; auto-generate the timeline.
- Publish rolling 30-day, never a cherry-picked window.
- Keep a second vantage (Hetzner cron) so a Cloudflare outage cannot erase evidence.
- Synthetic checks run against sandbox credentials; never touch customer accounts.
Cost: Rp0 at this scale. This is the single highest-ROI engineering item in the marketing plan — incumbents average 40% uptime; publishing it is the pitch.
4. Funnel + attribution
ad / creator / organic → landing on Pages (UTM preserved in cookie-less way via CF Zaraz + first-touch field in form)
→ signup form (Turnstile) → Worker → D1.leads + PostHog "signup_started"
→ trial activation (WhatsApp verify) → PostHog "trial_active"
→ first mutation detected → "aha"
→ top-up → "paid"
- PostHog holds the funnel + cohorts; D1 keeps the raw lead row for sales follow-up; Zaraz sends server-side events to Meta CAPI/GA4 for paid channels.
- Attribution rule: first-touch stored on the lead row, last-touch from Zaraz; report both, never blend them.
- Weekly report = 6 numbers: sessions by template, signups, trial activation %, paid %, MRR, CAC by channel.
5. Cost at three scales
| Item | 200 accounts (month 3) | 1.000 accounts (month 12) | 10.000 accounts (month 24) |
|---|---|---|---|
| Cloudflare Workers paid | $5 | $5 | $5–25 |
| D1 + KV + Queues + R2 | Rp0–30k | Rp50–150k | Rp300–800k |
| Hetzner ingestion (1–3 boxes) | €4 (Rp70k) | €14 (Rp245k) | €40–80 (Rp700k–1,4jt) |
| Postgres | Rp0 (Neon free) | Rp300k | Rp1,5jt (or self-host) |
| Resend/SES | Rp0 | Rp0–150k | Rp300k |
| WhatsApp messages | Rp100k | Rp600k | Rp5jt (metered per customer) |
| Sentry + PostHog + Axiom | Rp0 | Rp0–400k | Rp800k–1,5jt |
| Total infra | ≈Rp200k/mo | ≈Rp1,3–2jt/mo | ≈Rp9–12jt/mo |
At 10.000 accounts with base ARPU the revenue is ~Rp660M MRR; infra is ~1,5% of revenue. That is the definition of scalable-cheap.
6. Migration triggers (do not pre-build)
| Trigger | Action |
|---|---|
| >100k Worker requests/day or CPU-ms limit hit | Workers Paid → split webhook receiver into its own Worker |
| D1 >2GB or write contention | move config/status to Postgres; D1 stays for leads only |
| >50 webhook deliveries/s | Queues + per-tenant DLQ, batch consumer |
| Postgres >50GB | columnar archive to R2 (Parquet), retention policy |
| Ingestion >10k accounts | shard by bank, 3 worker nodes, queue backpressure (T37) |
| WhatsApp spend >Rp3jt/mo | negotiate BSP rate, default channels to Telegram/email for Personal tier |
7. What Cloudflare cannot do (avoid the trap)
| Need | CF cannot | Use |
|---|---|---|
| Chromium / bank robots | no browser runtime in Workers | Hetzner containers |
| Long-running jobs (>30s CPU, >15min wall) | CPU/wall limits | containers + systemd/celery |
| Heavy SQL / analytics joins over 100M rows | D1 is SQLite-at-edge | Postgres + columnar archive |
| Inbound WhatsApp webhooks with heavy processing | doable, but keep light | Worker verify → Queue → container |
| Full-text search on mutations | weak | Postgres tsvector or Meilisearch on Hetzner |
| Email deliverability reputation for cold outbound | not a mail provider | Resend/SES + warmed domain |
8. 10-day setup order
- Domain on Cloudflare; Pages project for marketing; Turnstile on forms.
- Worker:
/api/lead→ D1leads; PostHog + Zaraz wired; Web Analytics on. - Worker cron: uptime probes for 4 banks + D1
checks; static status page generated. - Email Routing for
verify@,support@; Resend domain verification (SPF/DKIM/DMARC). - Hetzner CX22: Postgres +
mutasipackage + systemd timer; SSH keys only. - Sentry DSN into API + workers; Axiom token; log drains.
- Queues + webhook receiver Worker with HMAC + retry → DLQ.
- Telegram bot + email incident notifier wired to the uptime state machine.
/llms.txt,/facts.json,/pricing.mdpublished on Pages;/mcpstub on a Worker.- Dashboards: uptime, funnel, cost. One page each, no BI tool.