Skip to main content
Back to Projects
FeaturedMarketplaces & E-CommerceE-CommerceNext.jsSupabaseMulti-VendorRow-Level Security

Afriva E-Commerce Platform

A marketplace for African fashion: a storefront where shoppers buy from independent sellers, and a separate dashboard where each seller runs its orders, products and returns, on one Supabase database. Built for a DevoraX client.

Afriva E-Commerce Platform
Store + seller dashboard
Apps
Supabase + RLS
Data
Set in the database
Pricing
Next.js 15
Framework

Facts about the build and who it was for. Any figure here is shown on a public store listing or site linked on this page. See how we present portfolio work.

Walkthrough

2-minute walkthrough: the storefront, a category sorted by price, a product page, a demo shopper paying for two shirts with a test card, then the seller packing that order and confirming a return.1:50

Screens

Project Story

The Challenge

A marketplace has two kinds of user writing to the same data. Shoppers must not be able to set their own prices or mark an order delivered, sellers must see only the orders for their own products, and both apps talk to the database straight from the browser, so the rules have to live in the database rather than in the screens.

What Was Built

A storefront with new arrivals, best sellers, category filters, price sorting, search and a wishlist; product pages with the seller's brand, the colours and sizes in stock and shopper reviews; checkout where the database sets each price, discount and delivery fee and takes the stock, with every line its own order; a seller dashboard with order counts, monthly sales, dated fulfilment steps and returns with photos; and row-level security with guard triggers, so shoppers see only their own orders and sellers only orders for their products.

The Result

Live demo on sample shops, products and shoppers, with one-click logins for a shopper and a seller, and a 2-minute walkthrough recorded on it.

Project Details

Afriva is two connected apps for an African-fashion marketplace, built for a DevoraX client. Shoppers browse new arrivals and best sellers, filter and sort categories, search, keep a wishlist, pay by card or cash, follow their orders and ask for returns. Each seller works from its own dashboard: order counts and monthly sales, fulfilment steps (packed, shipped, delivered) stamped with the date and time, its products, and return requests with the reason, pickup address and photos. Both apps query Supabase from the browser, so the rules live in the database: row-level security limits what each shopper and seller can read and write, and triggers set every order's price, discount, delivery fee and stock, and allow only the permitted status steps. The live demo runs on sample shops, products and shoppers with card payments simulated, and a 2-minute walkthrough is recorded on it.

Tech Stack

Next.js 15 (App Router), two apps
Supabase Postgres with row-level security and triggers
Supabase Auth and Storage
Redux Toolkit, Tailwind CSS
Try the live demo

Opens the project’s page on the demo hub in a new tab, with any logins the demo needs.

Category

Next.js & Supabase
Written by DevoraXReviewed by Sameem Amjad, Founder & Lead Architect EngineerLast updated Based on project records and public sources (case study)

Afriva is a marketplace for African fashion made of two connected apps: a storefront where shoppers buy from independent sellers, and a separate dashboard where each seller handles its orders, products and returns. Afriva is a DevoraX client project: Sameem built it for a client of DevoraX. Both apps run on Next.js 15 and query one Supabase Postgres database from the browser, so the rules live in the database. Row-level security keeps shoppers to their own orders and sellers to orders for their own products, and triggers set every price, discount and delivery fee, take the stock and allow order statuses only in sequence. The demo runs on sample shops, products and shoppers at demoprojectsforclients.sameemamjad.com/projects/afriva, and a 2-minute walkthrough is on this page.

What you can check

  • Live demo: demoprojectsforclients.sameemamjad.com/projects/afriva, with one-click logins for a shopper and a seller
  • A 2-minute walkthrough on this page: the storefront, a price-sorted category, a product page, a card checkout, then the seller packing the order and confirming a return
  • In the demo, an order sent with a one-cent total is stored at its real price, and a seller sees only orders for its own products

Each item points to something public: a store listing, a live site or a demo build. See our terms for how we present portfolio results.

What problem does a two-sided fashion marketplace have to solve?

A marketplace has two kinds of user writing to the same records. Shoppers create orders, carts, addresses and reviews; sellers create products and move orders through packing, shipping and delivery. Each side needs to see only its own part of the data, and neither should be able to change what belongs to the other.

Afriva makes that harder in one specific way: both apps talk to the database straight from the browser, using Supabase's public key, rather than through a custom API that could check every request. A shopper with the browser's developer tools open can send any query that key allows. So the rules cannot live in the screens. A price shown on a product page, a status button a seller presses, or a filter that hides another seller's orders proves nothing unless the database enforces the same thing.

Fashion adds its own shape to the data. A product is sold in several colours and sizes, each with its own price, stock and discount, and an order has to name exactly one of those combinations so the right stock goes down.

What does a shopper see in the storefront?

The storefront opens on new arrivals and best sellers, each card showing the product's rating from shopper reviews and its price. Categories (men's, women's, children's and accessories) can be narrowed by subcategory, price range and size, and sorted by newest or by price in either direction. A search box in the header finds products by name as the shopper types, and a heart on each product adds it to a wishlist kept on the shopper's account.

A product page shows the seller's brand logo, the colours and sizes actually in stock, a quantity picker and the description, with tabs for details, reviews and the return policy and a row of similar products underneath. Colour, size and quantity are real buttons with names, so they work from the keyboard and with screen readers.

The brands page groups products by shop, with each shop's name and location. In the demo there are three: Osu Weave Co. in Accra, Lekki Loom in Lagos and Westlands Thread in Nairobi, all sample shops.

How does checkout keep prices and stock honest?

The cart shows each line's colour and size, adds up the subtotal, the discount and each line's delivery fee, and checks stock before the shopper moves on. Checkout takes a delivery address, saved to the shopper's address book, and offers a card or cash on delivery.

Each cart line becomes its own order, because each line can come from a different seller. The browser sends only which product, which colour and size, and how many. A Postgres trigger that runs before every new order then does the rest inside the database: it finds that colour and size in the product's options, refuses the order if fewer are left ("Only 2 left in stock"), sets the subtotal, applies the discount, adds the delivery fee, takes the stock and adds to the product's sales count. It also sets the status to pending and the owner to the signed-in shopper, whatever the browser sent.

In the walkthrough, two Kente Stripe Shirts at $48 with 10% off and a $5 delivery fee come to $91.40. An order sent straight to the database with a total of one cent and a status of delivered is stored at its real price as pending.

How does a seller run its shop from the dashboard?

The seller dashboard is a separate app with its own sign-in. Its first screen counts the shop's orders and those waiting to be packed, each compared with last month, charts recent sales with this month's discounted total, and lists recent orders with the customer, total and status.

The orders page lists the shop's orders newest first. Opening one shows the product, the shopper's delivery details and three steps: packed, shipped and delivered. Each step asks for the time, already set to now, and stamps it on the order, and the shopper's own order page shows the same steps with their dates.

The products page lists the shop's products and opens a form for a new one: photos, title, category and subcategory, description, an optional discount, colours from a picker, sizes, a size chart, and a price and stock for every colour and size together. A new product appears in the storefront straight away.

Returns come in with the reason, the quantity, the refund amount, the pickup address and the shopper's photos. The seller confirms or declines each one.

Which rules does row-level security enforce?

Row-level security, a Postgres feature that attaches rules to each table, decides what any query from the browser can read or change. Afriva turns it on for all sixteen of its tables.

Shoppers read and write their own profile, addresses, cart, orders, saved cards and payment records, and nobody else's. Products, categories, brands and reviews are public to read. A seller reads and updates only the orders that contain one of its own products, and edits only its own products and brand.

Order statuses can only move forward one step at a time, and only the right side can move them: a seller packs, ships and delivers, and a shopper can only turn their own delivered order into a return request. A second trigger on orders checks every status change and stamps the packing, shipping and delivery dates. A trigger on products keeps the sales count, rating, owner and sample flag out of reach of any browser, so a seller can't inflate its sales or move a product to another shop. The demo's sample products can't be deleted.

New sellers join by invitation: a seller account can be created only for an email that has been invited.

How are sign-up codes and passwords handled?

A new shopper confirms their email with a four-digit code before the account is created. The code is generated and checked in Next.js server routes, stored with an expiry and an attempt count, and limited to a few requests per email every fifteen minutes. A correct code returns a short-lived signed token, and only a request carrying that token can set a password, so knowing an email address alone is not enough to take over an account.

The demo sends no email, so it shows the code on screen instead and switches password reset off with a note saying why. The two shared demo logins can't have their password changed or their account closed.

Files go to storage buckets of their own, each limited to images of up to 5 MB. Sellers upload product photos and size charts; shoppers upload profile pictures, review images and return photos only into a folder named after their own account.

What was found and fixed while testing the demo?

An end-to-end test suite drives both apps in a real browser against the live demo: browsing and sorting, search, the wishlist, a card and a cash checkout, packing and delivering an order, a return, a review, a new account, a new product, phone layouts, and direct calls to the database that should be refused.

It found real bugs, all fixed. Add to Cart reported success without waiting for the save, so a failed save still said "added". Sorting by price compared prices as text, putting $120 ahead of $36; price sorts now compare numbers. The product page showed a hard-coded logo instead of the seller's brand. The dashboard's pending count included shipped orders and returns, and its two month-on-month figures were on the wrong cards. On phones the seller menu opened over the dashboard because its open and closed states were swapped.

Where can you see Afriva?

Afriva is a DevoraX client project: Sameem built it for a client of DevoraX. The demo is reached from demoprojectsforclients.sameemamjad.com/projects/afriva, with the storefront and the seller dashboard each a click away, and runs on sample data: three shops, seventeen products, seven shoppers and twenty-seven orders across every status. The product pictures are original illustrations made for the demo.

Both apps have one-click demo logins, listed on the hub page: Amara, a shopper with a cart, a wishlist and orders in progress, and the Osu Weave Co. seller. Card payments use a test card and nothing is charged.

The 2-minute walkthrough on this page shows the storefront, a category sorted by price, a product page, the shopper paying for two shirts with a test card, then the seller packing that order and confirming a return.

Why this stack

  • Next.js 15 (App Router): both apps are Next.js, so the storefront's pages and the seller dashboard share one way of routing and building. The few things that must stay on a server, such as sign-up codes and password changes, run as route handlers with keys the browser never sees.
  • Supabase Postgres: a marketplace's data is relational (sellers own products, products appear in orders, orders belong to shoppers), and foreign keys, check constraints and triggers keep those links true however a row is written.
  • Row-level security and triggers: because both apps query the database from the browser, the access rules and the order maths live in Postgres. The policies limit each user to their own rows, and the triggers set prices, take stock and allow status changes only in order.
  • Supabase Auth and Storage: one service signs users in, and the same identity is what the database policies read, so there is no gap between who the app thinks you are and what the database allows. Storage buckets hold product, review, profile and return images under the same rules.
  • Redux Toolkit: holds the cart, filters, the signed-in user and each dashboard's lists, so a change made on one screen, such as an item added to the cart, shows everywhere at once.
  • Tailwind CSS: utility classes keep the storefront's product grids and the dashboard's tables consistent across both apps and responsive down to phone width.

Start with a free 30-minute call

Tell us where the app is stuck and what has to happen by when. We tell you whether an audit makes sense.

Book your free call