Skip to content
Blog Post
Pip & Peel: A Greengrocer Website With Prices From a Google Sheet

Pip & Peel: A Greengrocer Website With Prices From a Google Sheet

Pip & Peel is one of my website designs, made for a greengrocer or farm shop. The shop is made up: every name, price, farm and review on it is an example. It's a template, ready to be turned into a real shop's site.

It looks like the chalkboard outside a market stall. The fruit and veg are drawn in coloured chalk, and today's prices are chalked up on a board with a note for anything on offer.

For a customer, it does what they'd want from their local greengrocer online:

  • See what's in today and what it costs, by section.
  • Add produce or a veg box to a basket from any page.
  • Collect from the shop, or have it delivered on Thursday if they live nearby.
  • Pay by card when they order.

There are also pages for the veg boxes, what's in season month by month, the farms the shop buys from, and opening hours with an "Open now" badge.

The stack

  • Framework: Next.js 16 (App Router), React 19 and TypeScript
  • Payments: Stripe Checkout, called through its REST API with no Stripe package
  • Prices: a published Google Sheet, read as CSV
  • Drawings: SVG drawn in code, with a filter that makes the lines look like chalk

Today's prices from a Google Sheet

Greengrocer prices change all the time. Carrots are cheaper this week, the strawberries have sold out, there's 10p off the leeks. A shop owner isn't going to log in to a website every morning to change that.

So the board reads from a Google Sheet. The shop publishes the sheet to the web as a CSV and puts its link in the site's settings. The sheet has four columns:

id, price, in_stock, special
carrots, 110, yes, 10p off today

Price is in pence. Put "no" under in_stock and the item shows as sold out. Anything in special gets chalked up under the item as an offer.

The code in lib/board.ts starts from the product list in the site's own content file, then lays the sheet over the top. Only the items in the sheet change. If a price cell is blank or isn't a number, the normal price stays:

const res = await fetch(url, { next: { revalidate: 300 } });
const rows = parseCsv(await res.text());
// ...
return { ...p,
  price: Number.isFinite(price) && price > 0 ? Math.round(price) : p.price,
  inStock: stock !== "no",
  special: special || p.special };

The revalidate: 300 means the sheet is fetched at most every five minutes, not on every visit. If the sheet can't be reached, the site logs the error and shows the built-in prices, so the board never goes blank. With no sheet set up at all, it just uses those prices.

The basket and click-and-collect

The basket lives in the browser's local storage, so it's still there when the customer moves between pages. They can add things from any page and open it from the header.

At checkout they pick collection or delivery, then a day:

  • Collection: any day the shop is open, for the next week or so. Today counts if they order before 2pm.
  • Delivery: one of the next three Thursdays, ordering by Tuesday 6pm for that week. The postcode is checked against the delivery area, and delivery is free over £20.

The opening days come from the same hours file that drives the "Open now" badge, so changing the hours in one place changes both.

Checking the order on the server

The basket works out the total in the browser, but the server doesn't trust it. When an order is placed, app/api/order/route.ts fetches today's board again, drops anything sold out, and re-prices every line using the same function the basket uses. It checks the day is still a real collection or delivery day and the postcode is in the area.

That means the price the shop is paid is the price on today's board, and nobody can order something that sold out while it sat in their basket.

Paying with Stripe

The order is then sent to Stripe Checkout, Stripe's own payment page, with each item as a line and delivery as its own line if there's a fee. The shop never handles card details.

When the payment goes through, Stripe calls the site back. The site checks that call's signature with the webhook secret, then forwards the paid order to the shop: items, collection or delivery day, name, phone and address. Where it lands is up to the shop, through a webhook URL such as Zapier or a Google Apps Script.

Without a Stripe key, the site runs in demo mode: orders go straight through unpaid and are still sent to the shop. For a template site, a Stripe test key works too, so test cards can be used.

Why this suits a greengrocer

  • Prices in a spreadsheet fit how a small shop already works. A sheet can be edited from a phone as well as a computer.
  • Sold-out items stay on the board, marked as sold out, so regulars can see what's usually in.
  • Collection first, delivery on one day matches a shop with one van and a busy counter.

See it and make it yours

You can try the live demo of Pip & Peel, add things to the basket and go through checkout. The Pip & Peel design page has the details, and it starts from £149.

If you run a greengrocer, farm shop or market stall and want a site like this with your own name, produce and prices, get in touch.

Thanks for reading! Got a question or an idea for a build? Get in touch.