Direct-to-home FMCG platform for Ghana: location-matched distributors, in-house delivery, instant Paystack split settlement. Next.js + Supabase + Vercel.
# adepa — everyday goods, delivered from the source
Adepa connects Ghana's FMCG distributors directly to consumers at home.
Customers share their location, Adepa routes the order to the distributor
covering that zone, in-house riders deliver, and Paystack split settlement
pays the distributor **the instant the customer pays** — the platform's cut
is deducted automatically.
**Stack:** Next.js 16 (App Router) · Tailwind CSS v4 · Supabase (Postgres) ·
Paystack (GHS: MTN MoMo, Telecel Cash, AT Money, cards) · Vercel.
## How the money flows
1. Checkout recomputes all prices server-side (client prices are never trusted).
2. A Paystack transaction is initialised against the distributor's
**subaccount**, with `transaction_charge` set to
`platform fee (10% of subtotal) + delivery fee`.
3. Paystack settles the remainder directly to the distributor — no manual
payouts, no float held by the platform.
4. The webhook (`/api/paystack/webhook`, HMAC-verified) marks the order paid.
## Demo mode
With no env vars configured the app runs fully in **demo mode**: bundled
catalog + distributors, simulated instant payment. This is what deploys out
of the box. Configure the env vars below to go live.
## Going live
### 1. Supabase
1. Create a project at database.new.
2. In the SQL editor, run `supabase/migrations/0001_init.sql`, then
`supabase/seed.sql`.
3. Copy the project URL + service role key into env vars (see `.env.example`).
### 2. Paystack
1. Create a Ghana Paystack business, get the secret key.
2. For each distributor, create a **subaccount** (Paystack dashboard →
Subaccounts) with their settlement bank / MoMo details, and store the
`SUB_xxx` code in the distributor's `subaccount_code` column.
3. Set the webhook URL to `https:// /api/paystack/webhook`.
### 3. Vercel
Set the env vars from `.env.example` in Vercel → Project → Settings →
Environment Variables, then redeploy.
## Local development
```bash
npm install
cp .env.example .env.local # optional — demo mode work …