Introduction
The first week I tried to launch a digital product store in Vietnam, I picked Shopify because it was easy. By week two I realized 3% fees on international cards plus Stripe downtime during peak hours were killing my profit margin. After migrating to a self-hosted setup, I discovered Supabase gives me PostgreSQL plus instant APIs, file storage, and realtime subscriptions without learning a new language. I pair it with NOWPayments so customers can pay in crypto, USDT, or 80 other options without me touching Stripe. This article shows the two production stacks I use, the exact configuration files, and the hidden costs I wish I had known before clicking deploy.
The Two Stacks That Ship in 48 Hours
Stack 01 is for makers who want zero DevOps. You push HTML/CSS/JS to GitHub Pages, the frontend talks to Supabase directly through its REST API, and NOWPayments handles checkout. Supabase gives you a products table, orders table, and email confirmation via Edge Functions. I launched a design template store this way from Ubud in less than 48 hours and have not touched a server since.
Stack 02 is for builders who want caching and speed. Same frontend, but you push it to Cloudflare Pages so assets sit on Cloudflares edge. A Cloudflare Worker rewrites the API calls to Supabase so you can rate-limit and cache responses. The Worker also intercepts webhooks from NOWPayments to update orders in real time. This stack costs $20 a month for Cloudflares pro plan but saves $150 a month in bandwidth compared to hosting the frontend on Supabase Storage.
Either stack keeps you location-independent because both GitHub and Cloudflare are accessible from any coworking space with decent Wi-Fi. I keep a hotspot and eSIM as backup so a sudden power cut in Bogotá never becomes a store blackout.
Supabase Setup: The Orders Table That Actually Works
I used to store orders in Airtable until sync delays caused refund disputes. Supabases PostgreSQL gives me foreign keys, row-level security, and triggers that auto-send confirmation emails. Here is the minimal schema I run:
orders id uuid primary key default gen_random_uuid(), product_id uuid references products(id), customer_email text, status text default 'pending', payment_id text, created_at timestamptz default now(), updated_at timestamptz default now()
I add a trigger that fires after insert:
NEW.status = 'paid', perform send_email(NEW.customer_email, 'Your download link');
Supabase Edge Functions handle the email; you can use Resend or Postmark. Total cost: $0 if you stay under 50k rows.
NOWPayments: Skip Stripe, Keep Chargebacks Low
Stripes chargeback system is built for physical goods; digital products get hit with 15% dispute fees. NOWPayments lets customers pay with USDT on Tron or BUSD on BNB Smart Chain, networks where chargebacks are impossible. Integrate it in three steps:
1. Create a payment request through NOWPayments API with order_id and success_url. 2. Show the generated payment link or QR code on your store page. 3. Listen for the payment status webhook and mark the order paid in Supabase.
Fees are 0.5% for stablecoins and 1% for other cryptos, which is lower than Stripe when you factor in cross-border fees. The only catch: you must run a small hot wallet on each chain. I keep $500 worth of USDT on Tron so I never have to top up during a sale rush.
Deployment Checklist: What Breaks and What Doesnt
The day before launch I always double-check:
- GitHub Actions or Cloudflare Pages build logs show no errors. - Supabase Row-Level Security policy allows only the stores service role to write to orders. - NOWPayments webhook secret is set in both NOWPayments dashboard and your Worker or Edge Function. - Domain SSL certificate is valid; I use Cloudflares proxy for free certs. - Backup the Supabase project every week with the built-in export tool to avoid data loss.
The one thing that broke for me was a misconfigured CORS policy in Supabase. I fixed it by running:
update auth.users set raw_user_meta_data = jsonb_set(raw_user_meta_data, '{store_id}', '12345') where id = auth.uid();
in the SQL editor. After that, the frontend could query orders without CORS errors.
Cost Breakdown: Freedom vs Monthly Burn
In Saigon my monthly spend is:
- Supabase Pro: $25 (3 users, 250k rows, 10 GB storage) - Cloudflare Pages/Workers: $20 (100k requests, 1 GB bandwidth) -