# context
A study project to learn how an e-commerce with dashboards works: a store with a calculator, orders, client, booster and admin dashboards, and a wallet. Next.js, PostgreSQL on Supabase, Prisma and Zod.
The screenshots were taken on a local copy with the repository’s demo catalog. The demo below uses a made-up catalog with the same structure.
# the price
The browser only sends the choices (ids and quantities). The server looks up the prices in its own catalog and redoes the math: the amount on screen is just a preview. Money always in whole cents.
Two kinds of calculation: ladder, which adds up the price of each division along the way (and the price changes per tier), and table, the option’s price times the quantity. Add-ons stack with each other on top of the service price.
# the order
Each order keeps a snapshot of the moment: description, add-ons and the amount from when it was placed. Changing the price tomorrow doesn’t touch old orders.
States follow a fixed map (queued, in progress, completed, with a return to the queue), and each change is an atomic condition in the database: if two boosters hit “take” at the same time, only one gets the order.
# the money
The payout is a percentage of the total paid, frozen when the booster takes the order. The booster gets the rounded amount and the platform keeps the rest, so the sum adds up.
Booster level and wallet balance are never stored: they’re calculated from completed orders and from the ledger, which only grows. Mistakes get fixed with a reversal.
# demo
Build an order, simulate it and follow it through the three dashboards: client, booster and admin. The math is the same formula as the server, with an invented catalog.
Service
A booster plays on your account until the goal.
Your elo and your goal
Current elo
Where you want to get
Your elo
Your eloAdd-ons added together on top of the service
Build an order up there. When you like the price, click Simulate order and I will take it to the dashboards.
