Idara Etim
Back to work

Dali Stores

LiveFullstack

The live Dali Wears fashion store at daliwears.shop — Next.js and Supabase, with Paystack payments verified on the server, delivery tracking, and a full admin dashboard.

Role

Full-Stack Developer (Solo)

Status

Deployed

Category

Fullstack

Screenshots

Overview

Dali Stores is the production storefront for the Dali Wears fashion brand, live on its own domain at daliwears.shop. It's a ground-up Next.js (App Router) rebuild that replaced the original Vite site, which now permanently redirects here. Customers browse the catalog with search, filters, sizes, and discounts, save items to a wishlist, pay with Paystack, follow their delivery step by step, review products with photos, and chat with the store. The owner runs everything from an admin dashboard: products with photos and videos, pre-orders, orders and delivery updates, customer messages, users, analytics, store settings, and a coins rewards program. The same Supabase backend and payment API also power the Dali Wears mobile app.

The problem

Dali Wears was selling through social media and an early single-page site. Payments were confirmed by screenshot, customers had no way to see where their order was, and the owner needed a developer to change products or prices. The brand needed a real store: trustworthy payments, delivery updates, and tools the owner could run alone — on the web and on phones.

The solution

A full rebuild on Next.js and Supabase, launched on its own domain. Payments go through Paystack and are only accepted after the server verifies them. Orders move through tracked delivery stages the customer can follow, and the owner manages the catalog, orders, and rewards from an admin dashboard. The website's payment API also serves the mobile app, so both share one backend.

What it does

Paystack checkout (web)

The order and its items are saved first, the database calculates the real total, and only then does the Paystack inline popup open for that exact amount. If prices changed since the item was added to the bag, checkout stops and asks the customer to review it.

Paystack checkout (mobile app)

React Native has no Paystack popup, so the app asks the server to initialize a transaction. The server checks the amount against the order before calling Paystack, then the app opens Paystack's hosted checkout page and returns through a deep link.

Server-side payment verification

A verify endpoint calls Paystack with the secret key and only marks an order paid when the transaction succeeded, the amount matches the order total in kobo, and the reference hasn't already been used for another order.

Delivery tracking

Orders move through Processing → Shipped → In transit → Out for delivery → Delivered, with courier, tracking number (one-tap copy), and a timeline of updates posted by the admin.

Catalog, sizes & pre-orders

Products with multiple photos and videos, a swipeable gallery, sizes (XS–XXL) with a US size guide, time-limited discounts, low-stock badges, and pre-orders for sold-out items.

Coins rewards

Customers earn coins for daily check-ins, 7-day streaks, spending (paid when an order is delivered), and referring friends. The owner sets every rate from the admin settings.

Admin dashboard

Manage products and media, orders and delivery updates, customer chat, users, store contact details, app download links, and rewards — plus analytics for orders by status and top-selling products.

Customer account & support

Profile, order history, wishlist, notifications for new arrivals, reviews with photos, a chat widget to message the store, and a once-a-day personal welcome message.

How it's built

  • Next.js 16 App Router with TypeScript: Server Components for catalog and product pages, Client Components for cart, checkout, and the admin.
  • Supabase Postgres for products, orders, order items, tracking events, reviews, wishlists, messages, announcements, settings, and coin wallets — protected by row-level security.
  • Postgres functions price orders from real product and sale prices, so the total charged never comes from the browser; the client mirrors the same rule only for display.
  • Next.js route handlers (/api/paystack-initialize and /api/paystack-verify) hold the Paystack secret key and use a server-only Supabase service-role client.
  • Cookie-based auth with @supabase/ssr; Next.js proxy refreshes the session and redirects logged-out visitors away from /account, /checkout, and /admin, while each protected page still checks the user on the server.
  • Supabase Storage for product photos, videos, review photos, and avatars. Photos are resized in the browser (max 1600px JPEG) before upload, with timeouts so slow connections never hang.
  • shadcn/ui on Radix primitives, React Hook Form + Zod for forms, and Sonner for toasts.
  • Deployed on Vercel at daliwears.shop, with permanent redirects from the old Vercel addresses and an hourly-rebuilt sitemap that includes every product.

Challenges & how I solved them

Making sure a payment really pays for the order

The browser's "payment successful" message can be faked, so the server verifies every transaction directly with Paystack. It checks that the payment succeeded and that the amount in kobo equals the order total stored in the database. Anything else marks the order as failed.

Stopping a receipt from being reused

Someone could try to submit one successful Paystack reference for a second order. The verify endpoint rejects a reference already attached to another order, and a unique index on paystack_reference blocks it even if two verifications race.

Never trusting prices from the browser

Order totals are calculated in Postgres from the real product prices and active discounts. If the customer's bag shows an outdated price, checkout stops and asks them to review it instead of charging a different amount.

One payment backend for web and mobile

The website uses Paystack's popup, which React Native can't use. I added an initialize endpoint that validates the amount against the order before creating a hosted checkout session, and both platforms share the same verify endpoint.

Moving to a new domain without losing visitors

I made daliwears.shop the official address and added permanent redirects from the old Vercel URLs (keeping the requested page), so old links and search results still land on the right product.

Key highlights

  • Integrated Paystack two ways: the inline popup on the website, and server-initialized hosted checkout for the mobile app
  • Verified every payment on the server — status, exact amount in kobo, and replay protection so one Paystack receipt can't pay for two orders
  • Priced orders in the database from real product and discount prices, so a stale or tampered cart can't change what's charged
  • Built delivery tracking with stages, courier and tracking numbers, and a timeline of updates customers see on web and mobile
  • Built an admin dashboard for products (photos, videos, sizes, discounts, pre-orders), orders, messages, users, analytics, and settings
  • Added a coins rewards program — daily check-ins, streak bonuses, coins per ₦1,000 spent, and referrals — configured from the admin
  • Launched on the custom domain daliwears.shop with permanent redirects from old addresses, a dynamic sitemap, and robots rules
  • Used cookie-based Supabase auth (@supabase/ssr) with route protection in Next.js proxy and server-side checks on every protected page

What I learned

Taking a store to production taught me that payments are mostly about what you don't trust: the browser's success message, the cart's prices, and a receipt someone has used before. Putting that logic on the server and in the database made the same backend safe to share with the mobile app.

Tech stack

Next.js 16 (App Router)TypeScriptTailwind CSS v4shadcn/uiRadix UISupabasePostgreSQLSupabase Auth (@supabase/ssr)Supabase StoragePaystackReact Hook FormZodVercel