Wednesday, June 3, 2026

Supabase as the Order Database for Digital Stores — No Stripe Required

Supabase as the Order Database for Digital Stores — No Stripe Required

Introduction

Most digital stores start with a platform that bundles payments, inventory, and hosting in the same dashboard. Convenient until the platform bans a product, pauses payouts, or tells you to rebuild because youre outside its acceptable KYC vertical. The alternative is composing your own order database and payment rail, stitching the pieces together so no single API can shut you down. Supabase provides the order store (Postgres), the realtime layer (Realtime server), and the compute edge (Edge Functions) under one project umbrella. NOWPayments or any of 300+ other gateways can process transactions while your order records remain yours. The first step is to decide which stack variant matches your traffic profile and compliance needs.

Stack Variants: Which One Stays Online When Others Freeze

Two proven compositions exist: Stack 01 – Single-Region, Zero Edge Dependency Frontend: GitHub Pages, Cloudflare Pages, or Vercel static build Backend: Supabase Project (Postgres + Auth + Realtime) Payment: NOWPayments checkout URL or hosted fields embedded in the storefront Webhooks: Supabase Edge Function listens to NOWPayments events via HTTPS endpoint Order Records: One table called orders with computed transaction state Risk Profile: Low latency, standard PCI SAQ A-EP, but accepts any processor that can call a webhook Stack 02 – Multi-Region, Edge-Powered Frontend: Cloudflare Pages (global CDN + Functions) Backend: Supabase Project + Cloudflare Worker that proxies payment intents to gateways Payment: NOWPayments API or CoinGate, depending on crypto/CC mix Webhooks: Worker forwards events to Supabase Realtime channel so the UI updates instantly Order Records: Same orders table with region-specific read replicas enabled Risk Profile: High availability under DDoS or regional outage, still owns every order

Choose Stack 01 if monthly volume is under 5,000 orders and you need the fastest path to compliance. Choose Stack 02 if you expect bursts above 10,000 orders per day or operate in multiple time zones.

Setting Up the Order Database in Supabase

Create a new Supabase project from the dashboard or CLI. Run the following schema to create an orders table with all required fields for NOWPayments and alternate gateways:

create table orders ( id uuid default gen_random_uuid not null primary key, external_id text unique not null, customer_email text not null, product_id text not null, quantity integer default 1, currency text default 'usd', total_amount numeric not null, status text default 'pending', payment_method text, address_json jsonb, metadata jsonb, created_at timestamptz default now(), updated_at timestamptz default now() );

Create an index on status and created_at for fast reporting, and enable Row Level Security so only authenticated users can read their own orders.

Grant the necessary roles via Supabase SQL:

alter publication supabase_realtime add table public.orders;

This single command enables Realtime updates for the orders table, so your frontend can stream status changes without polling.

Payment Processor Integration Without Stripe Lock-in

NOWPayments is the simplest gateway to start because it accepts both card and crypto and exposes a single webhook format. In your Supabase Edge Function:

export default async (req, res) => { const payload = req.body; const order = await supabase .from('orders') .update({ status: payload.status, external_id: payload.payment_id, updated_at: new Date().toISOString() }) .eq('external_id', payload.order_id) .select(); return res.json({ ok: true }); }

Deploy the function and register its URL in NOWPayments webhook settings. If you switch to Coinbase Commerce or Adyen, only the webhook handler changes; the order table remains identical.

Frontend & Checkout Flow in 48 Hours

Day 1 - Fork a Supabase + GitHub Pages starter - Add environment variables for SUPABASE_URL and SUPABASE_ANON_KEY - Build a checkout page that POSTs to NOWPayments with order data - Use Supabase Auth for customer login so returning users see their history

Day 2 - Wire the orders table to the UI via realtime subscription - Add a tiny worker or edge function to redact PII in logs - Run an ACH test transaction and verify the order record updates in under 2 seconds

On completion, the store accepts payments, stores orders, and can migrate gateways without touching the database schema or front-end components.

Compliance & Auditing: What Most Merchants Overlook

Stripes automated fraud model suspends accounts for missing fields like product