Introduction
Two years ago I launched a tiny digital-goods store from a café in Lisbon. I had no Stripe approval, no local merchant account, and no desire to chase PayPal sandbox flags. I picked Supabase for the database and NOWPayments for the checkout because both accept founders from non-standard countries and give immediate API access. The result is a stack you can own in two days with no ongoing middlemen.
Supabase Schema for Digital Orders
I started with one table:
orders id uuid primary key default uuid_generate_v4() customer_email text not null product_id text not null payment_id text unique not null status text not null default 'pending' check (status in ('pending','paid','failed','refunded')) amount_usd numeric(10,2) not null tx_hash text created_at timestamp with time zone default now()
Indexes: create index idx_orders_payment_id on orders(payment_id); create index idx_orders_status on orders(status);
I expose three functions via PostgREST: - post_rest /orders – create new order - post_rest /webhook – NOWPayments calls here - get_rest /orders?status=paid – fetch completed orders nightly
Supabase gives 500 MB free, 50K rows, and 250k API calls per day—more than enough for a solo store before you hit any limit.
NOWPayments Checkout, No Stripe Attached
NOWPayments supports 20+ coins and 10+ fiat on-ramps. I route EUR, USD, and USDC through it because founders outside the US can receive stablecoins instantly.
Flow: 1. Customer clicks Checkout on GitHub Pages static site. 2. Frontend POSTs to Cloudflare Worker Checkout that returns a NOWPayments invoice URL. 3. Customer pays invoice in their wallet or card. 4. NOWPayments webhook hits my worker /webhook endpoint. 5. Worker verifies signature, updates orders.status = paid, inserts tx_hash. 6. Nightly script emails license key via SendGrid API.
I track NOWPayments payouts in a spreadsheet. It takes 15 minutes weekly to reconcile.
Cloudflare Workers as the Payment Switchboard
Worker 1 – Checkout Handler export default { async fetch(req, env) { const body = await req.json(); const invoice = await fetch( https://api.nowpayments.io/v1/invoice, { method: POST, headers: { x-api-key: env.NOW_KEY }, body: JSON.stringify({ ...body }) } ); const { invoice_url, id } = await invoice.json(); await env.DB.prepare('INSERT INTO orders(payment_id, customer_email, product_id, amount_usd, status) VALUES(?,?,?,?,?)') .bind(id, body.email, body.product, body.amount, 'pending').run(); return new Response(JSON.stringify({ url: invoice_url }), { status: 200 }); } }
Worker 2 – Webhook Receiver async fetch(req, env) { const sig = req.headers.get('nowpayments-sig'); const raw = await req.text(); const hash = crypto.subtle.digest('SHA-256', raw + env.NOW_SECRET); if (hash !== sig) return new Response('Bad sig', { status: 400 });
const { payment_id, status } = JSON.parse(raw); if (status === paid) { await env.DB.prepare('UPDATE orders SET status = ? WHERE payment_id = ?') .bind('paid', payment_id).run(); } return new Response('', { status: 200 }); }
Total Worker cost: < $5 per month for all invocations and KV reads/writes.
GitHub Pages or Cloudflare Pages for the Storefront
Static site runs on GitHub Pages—100 GB bandwidth, 10 GB storage, $0. Zero build minutes, zero lock-in.
If you need edge redirects or image resizing, clone the repo to Cloudflare Pages and keep the same Worker checkout URL. The front end calls the same endpoint regardless of host.
Cost Breakdown After 1 Year
Supabase free tier still covers me (30k rows, 250k API calls). NOWPayments fees: 0.5 % on stablecoins, 1 % on crypto. Cloudflare Workers: $4.20 last month. SendGrid: $9.95 for 100k emails. Total spend: $14.15 per month at current volume. MRR: $2,300. Churn (30-day rolling): 1.7 %.
Deploy Checklist in 48 Hours
Day 0 (2 h) - Create Supabase project, enable PostgREST, set Row Level Security to public for INSERT and GET only. - Create NOWPayments account, copy API key and secret.
Day 1 (4 h) - Build Checkout Worker, add secrets to Cloudflare. - Write GitHub Pages HTML form