All projects

FreshTrack

Live

A mobile-first PWA for restaurant inventory — batch-level FEFO tracking, barcode scanning, expiry alerts, waste analytics, and rule-based reorder forecasting.

Open Live Demo The deployed app requires an account, so this link lands on the sign-in screen — see the note below.
What you'll see on the live link FreshTrack is a real, deployed multi-tenant app with account-gated data, so the public link opens straight to sign-in rather than a live dashboard. No demo account exists for this app, and it hasn't been altered to add one — what's live today is exactly what ships in production. The walkthrough below covers the actual feature set and the FEFO logic behind it.

1 The Problem

Restaurants track inventory by item — "we have 40kg of tomatoes" — which hides the thing that actually matters: which tomatoes expire first. Without batch-level visibility, kitchens either over-order out of caution or under-order and run out, and waste gets discovered only after it happens, as a bad smell in the walk-in.

The goal: a system that tracks stock at the batch level, always tells staff what to use first, and turns waste from a surprise into a forecastable, trackable cost.

2 The Approach — FEFO batch tracking

Every delivery creates its own batch — a specific quantity with its own expiry date, supplier, and cost. Nothing is deleted; batches move through a lifecycle (active → depleted / expired / wasted) so the full history stays auditable. When stock is consumed, the system always deducts from the batch with the earliest expiry date first — First-Expired-First-Out — which is what turns "we have 40kg of tomatoes" into "3kg of tomatoes expire Thursday, use those."

Every item also carries a four-tier expiry status so staff can triage at a glance:

> 7 days
Good
4–7 days
Warning
0–3 days
Critical
< 0 days
Expired

3 Architecture

Every stock movement — received, used, wasted, adjusted — is written to a transaction log tied to its batch, which is what makes both the audit trail and the forecasting possible. Reorder points are computed with a transparent formula rather than a black-box model:

Reorder point
avg_daily_usage × lead_time_days + safety_stock
Safety stock = 1.5 × standard deviation of daily usage, from a 4-week moving average. No ML — just math a manager can audit.

Waste is tracked the same way: every wasted batch is logged with a reason (expired, spoiled, damaged, overproduction) and a value-lost figure, so the waste-rate metric is wasted_value ÷ total_received_value — a real number, not a guess.

4 Tech Stack

Next.js 16 React 19 TypeScript Tailwind CSS v4 Drizzle ORM PostgreSQL Supabase Auth + SSR Zustand Recharts react-zxing (barcode) papaparse (CSV import) date-fns PWA

5 Result

A complete multi-tenant operations app: dashboard, inventory with item detail, barcode scan, waste log, reports, expiry alerts, CSV bulk import, an activity feed, and team management — installable to a phone's home screen as a full-screen PWA.

4Expiry status tiers
5Bottom-nav sections
1.5σSafety stock formula
PWAInstallable, offline-aware

6 Links