Skip to content

Provilion Broodjes

A self-service ordering system meant to replace the cash and Excel behind a school's sandwich sales: ordering and paying in the Wednesday break, collecting on Friday. Parents top up credits online, Stripe settles the orders and the kitchen works from one live dashboard. The platform was fully built, but never put into use.

Client
Provilion Broodjes
Period
2024 – 2026
Kind of project
Commerce Platform
Status
Finished
provilion-maandmenu.vercel.app
Provilion Broodjes: de website

This is how the site looks today. The picture refreshes itself every week.

What it changed

  • Ordering and paying fully online, with no cash changing hands at break time
  • Parents control spending through a prepaid credit system
  • Admin dashboard turns daily orders into a single prep list

The problem

At the school, orders were taken every Wednesday during the morning break: students placed their order and paid in cash on the spot. On Friday they got their sandwich. Everything in between was managed with cash and Excel: entering the orders in a spreadsheet, counting the money and making it match the list, and working out from that what had to be ready on Friday. It worked, but it depended entirely on manual work, and on one short break a week to place orders.

The approach

The fix wasn't a slightly nicer version of the spreadsheet process. It was removing the manual steps entirely and letting the system be the source of truth for orders, balances, and daily prep.

  • Students place orders themselves; parents top up a prepaid credit balance online
  • Stripe handles payment processing, and webhooks rather than client requests drive what actually happens to a balance
  • Role-based access separates what a student, a parent, and an administrator can each do
  • One live operations dashboard turns the day's orders directly into a kitchen prep list

Where it ended up

User roles, one platform
3

The platform was fully built, but never put into use: the school kept working with cash and Excel. So what is described above is how it was designed, not what it delivered in practice. Parents would control spending through the credit system instead of sending cash in, the kitchen would work from one always-current list, and the payment flow can't silently drift out of sync with what was actually charged.

The technical sidestack, choices and trade-offs

Built with

  • TypeScript
  • MySQL
  • Stripe
  • NextJS

Next.js and TypeScript end to end, MySQL for persistence, and Stripe webhooks driving payment reconciliation. Role-based access control separates student, parent, and administrator capabilities.

Key decisions

  • Webhook-driven payment flow: credit balances only mutate on confirmed events
  • RBAC enforced at the API layer, not just hidden in the UI
  • Transactional order writes keep credit ledger and orders consistent
  • Email notifications decoupled from the request path

The core constraint: money has to be right

A credit-balance system that's "usually" correct isn't good enough, a parent's balance either matches what they actually paid, or the system has a bug that erodes trust immediately. That single requirement shaped most of the architecture below it.

Webhook-driven, not client-driven

The naive version of this system updates a balance the moment the client says "payment succeeded." The problem: a client can lie, retry, or simply lose the response before it confirms anything server-side.

1// Simplified webhook handler shape
2export async function POST(req: Request) {
3 const event = stripe.webhooks.constructEvent(await req.text(), sig, secret);
4
5 if (event.type === 'payment_intent.succeeded') {
6 await db.transaction(async (tx) => {
7 await tx.credits.increment(userId, amount);
8 await tx.paymentLog.insert({ eventId: event.id, amount });
9 });
10 }
11}

Idempotency matters here too. Stripe can and will retry webhook delivery, so the handler keys off `event.id` to avoid double-crediting a balance on a duplicate delivery.

RBAC at the API layer

Role checks live in the API handlers, not just conditionally-rendered UI. A student's request to view another student's order history is rejected server-side regardless of what the client-side UI would have allowed them to click.

Decisions that mattered

  • Payment state is a strict function of confirmed Stripe events. Never of client-reported success
  • Transactional writes keep the credit ledger and order records consistent even if a request fails midway
  • RBAC enforced at the API boundary, so a modified or bypassed client can't escalate its own permissions
  • Email notifications are decoupled from the request path, a slow email provider can't make an order feel slow