Case study · systems I run

A long line on a Saturday morning

My family sells juice and cut fruit at the St. Petersburg farmers market. The problem was never demand. It was that everyone wanted a coconut at the same time and we had one register. Everything below came out of trying to fix that, and then discovering what fixing it created next.

Dien ElsayedSt. Petersburg, FL2019 – present
01 — THE LINE

Let people pay before they arrive

A market stand gets one rush, and it does not last long. We would watch people look at the queue, do the arithmetic, and keep walking. That is the whole business problem in one sentence: the constraint was never the product, it was how long a single transaction took at the front of the line.

So I built an ordering site. You pick what you want on your phone, pay by card, and walk up to collect it. No register, no cash, no waiting behind someone deciding between flavours. We called it Skip the Line, which is not a clever name but is exactly what it does.

The hard part of taking money is not taking money. It is making sure the number on the screen and the number on the card are the same number, forever, including next spring when prices change.

What it does on an actual Saturday

Three Saturdays, read off the stand's own dashboard:

SaturdayOrdersTakenFirst use
Oct 2483$77686%
Oct 3158$49595%
Nov 791$94196%
Nov 1487$79892%
Nov 2168$63684%
Nov 2872$72081%

Six market Saturdays, 2026. “First use” is the share of that day's orders placed by someone who had never ordered through the site before — first use of the channel, not necessarily a new face at the stand.

Three things changed, and only one of them is the money.

Capacity. Between fifty-eight and ninety-one orders a Saturday now clear without ever touching the register. The stand has one point of sale and a few hours to use it, so this is throughput it simply did not have before.

The timestamps say something I didn't expect when I built it. Almost nothing is ordered in advance. The orders land between eight in the morning and two in the afternoon, peaking in the same hour the queue does — on one recent Saturday, exactly one order out of seventy-two arrived before 9am. These are not people planning ahead from the kitchen table. They are people standing in the market, looking at the line, deciding to use their phone instead. My own read is that thirty to seventy of them a Saturday are sales we would otherwise have lost. The data can't settle that question, but it does show the orders arriving in precisely the moment the queue would have cost us them.

The morning itself. Nobody waits. People order from wherever they are in the market, walk up, and take the bag. The staff spend the rush handing things over instead of ringing things up, which is a better shift for them and a better Saturday for everyone in front of them.

And we know who they are. A cash sale leaves nothing behind — no name, no way to say thank you, no way to tell anyone we deliver midweek. Every one of these orders leaves a customer record instead. That is the only reason the delivery arm and the review loop in the next two chapters have anybody to talk to at all. The queue wasn't just costing us sales on the day; it was costing us every Tuesday after it.

The first version let the browser send the price to the server. That is a mistake you only make once: anyone with developer tools open could have bought a half gallon of orange juice for a penny. Now the browser sends product ids and quantities and nothing else, and the server looks every price up itself. The arithmetic lives in one module that both the page and the server load, so the cart total and the card charge cannot drift apart. Money is stored in integer cents, and a finished order keeps the price it was sold at rather than looking it up again later.

02 — THE DELIVERY ARM

Saturday stopped being the only day

Once people could order ahead, a second question showed up on its own: what if I can't make it Saturday? So the same system grew a midweek delivery arm — order any time, choose a drop-off day, and my mother drives it out Monday, Wednesday or Thursday.

That turned out to be the harder half. Taking the order is one screen. Fulfilling it is a person in a van who needs to know what to make the night before, what to load, where to go, and in what order.

Two phone pages, built for one person standing up

The prep list is the night before: every order due, rolled up into one pick list of what to make and a pack list per customer. It refreshes when the phone wakes rather than on a timer, because a timer doesn't run in someone's pocket.

The run sheet is the morning of: the stops in route order, with a button for on my way and one for delivered, each of which texts the customer. She taps two buttons per stop and never opens a spreadsheet.

The bug I'm least proud of: the code decided who needed telling by reading the order type. When one order type started meaning two different things, the half that needed the most warning read as the half that needed none — and my mother stopped being told about exactly the orders she had to prepare.

The fix was to stop asking what kind of order it is and start asking whether it has a drop-off date. One field, checked the same way by the prep list, the run sheet, her text message and the customer's. Lists that read the same field cannot disagree with each other about what is owed.

03 — RETENTION

Getting people to come back twice

A market stand lives on regulars, and until this point we had no idea who ours were. Everything was cash and a smile. So the ordering system became the place we actually learned something about the people buying.

It is already visible in the numbers above. In early November, ninety-six per cent of a Saturday's orders came from someone using the site for the first time. Three weeks later that was eighty-one per cent. The gap is a returning customer base forming, one Saturday at a time, and before this existed there was no way to have seen it at all.

A first-order offer that knows it's a first order

New customers get a discount on their first delivery. That only works if the system can tell a first order from a fifth one, server-side, so the offer can't be re-used by anyone who reads the page source. One switch in the catalog file turns the whole thing on and off — the banner, the email field and the server-side discount together — which means it can be pulled in ten seconds on a market morning without a deploy.

Asking how we did, in a way people answer

After an order, customers get one email with five stars in it. The stars are images wrapped in links, so tapping one inside the inbox records the rating immediately — the page they land on is just the receipt. That's the difference between a rating someone gives and one they intend to give later and never do.

Three stars or fewer emails me straight away, while the customer still remembers why. The public review ask lives on the page after the rating and is shown to everyone regardless of score, because showing the Google link only to happy customers is review gating and I'm not doing that.

The whole thing now runs itself: every Saturday at 4pm a scheduled job finds that day's customers who have never been asked, and asks them once. A log of who has been asked is the only thing stopping a second ask, so it is the one record the job is careful about.

04 — THE ENGINE

The second shop is where the real design happened

When another vendor wanted the same thing, the obvious move was to copy the folder and change the names. I did that once and immediately disliked it — two copies of the pricing arithmetic would have disagreed with each other inside a month.

So I pulled it apart. A vendor, in this system, is six things and nothing else: prices in a catalog file, copy in a page template, two serverless functions for charging and recording, and an identity tab in their own spreadsheet holding their name, phones, emails and delivery days. Everything else is the engine, unchanged.

The rule I hold myself to: if standing up a new shop needs me to edit engine code, that is a bug in the engine. The fix is a new config field, not a new branch.

Each vendor keeps their own Stripe account, their own phone number, their own hosting and their own spreadsheet. Nothing routes through me — no money, no credentials. That is partly good architecture and mostly good manners: it means any of them can walk away with everything they own, and none of them has to trust me more than they'd like to.

05 — A DIFFERENT SHAPE

Automating a coach's income

Then a running coach asked for something that looked unrelated and turned out to be the same problem wearing a different hat. She signs clients, coaches them monthly, and pays a second coach out of what comes in. All of it lived in a spreadsheet she updated by hand, which meant she was the bottleneck and also the single point of failure.

What she needed: clients sign themselves up, cards get charged automatically every month, a failed payment raises an alert instead of quietly going unnoticed, a dashboard shows paid against unpaid at a glance, and her staff's share is calculated from what actually cleared rather than what was invoiced.

Money needs a ledger, not a spreadsheet

The schema is append-only. Nothing is ever edited after the fact — a refund is a new row, a cancellation is a new date. Amounts are integer cents. A client's price is copied onto their agreement at signing, so changing the price list next year doesn't silently rewrite what existing clients agreed to; the staff payout rate is looked up fresh per invoice, so a rate change applies going forward and never backwards.

Those two rules look like the same rule and are opposites, and getting them the wrong way round is how billing systems quietly cheat someone. Writing down why each one points the direction it does was most of the design work.

She owns every account outright — her Stripe, her database, her hosting, her sending domain. I'm a listed collaborator on things she can see, never a credential she doesn't know about.

06 — WHAT IT TAUGHT ME

Rules I'd bring to the next system

Every one of these exists because something broke first. That's the only reason any of them are written down.

The server owns every price.

The browser sends what you want, never what it costs. Learned when a page could have been edited to buy a half gallon of juice for a penny.

Two lists that must agree should read the same field.

Not the same idea expressed twice. Learned when a prep list and a notification disagreed about which orders existed, and someone's groceries didn't get made.

Never parse a human field with a delimiter a human might type.

Splitting an order's items on commas turned one jar of "Homemade Hummus, Tabouleh & Babaghanush" into three things to make. The parser now matches against real product names and shows whatever it couldn't account for, rather than dropping it.

Know the encoding your message actually uses.

A curly quote or an em dash in a text message silently switches it to a wider character set and cuts the single-message limit from 160 characters to 70. Every outbound text is checked for both before it ships.

Give every send one chokepoint and a second rail.

Mail goes through one function that checks the remaining daily quota and falls through to a second provider when it runs out. The first overflow of a day writes one row to an error log — visible, not noisy.

Measure the number, don't look it up.

Documentation said the daily email ceiling was one thing; the account said another. A busy Saturday would have found the difference before I did.

A failure that can't complain is the expensive kind.

A check wrapped in a silent catch ran wrong for days without a single error. Now the things that must not fail quietly are the things that are allowed to throw.

07 — STACK

What it's built on

PaymentsStripe Checkout & subscriptions
HostingNetlify, serverless functions
MessagingTwilio SMS & voice
DataGoogle Sheets, PostgreSQL, Supabase
AutomationGoogle Apps Script, scheduled jobs
MailGmail API with a fallback sender
DeliverabilitySPF, DKIM, DMARC, carrier registration
LanguagesJavaScript, Python, PowerShell, SQL
monasmarket.shop coconutking.shop curbsidebros.com github.com/DienDoesData

The repositories behind these systems are private because they hold other people's customers and money. Everything above describes the design rather than the source, and I'm glad to walk through any of it live.