A read-only web interface showing which snacks are taken from the office pantry. A Python build step turns raw scanner events into static JSON; a React app renders it.
project.md: the original briefPRD.md: requirements and the static JSON contract- GitHub issues: specs and tickets, labelled by feature
| Path | What it is |
|---|---|
backend/ |
Python + Polars build CLI (snacker build), managed with uv |
frontend/ |
Vite + React + TypeScript app |
data/ |
Raw scanner events and OpenFoodFacts, copied locally (git-ignored) |
public-data/ |
Generated JSON, written by the build (git-ignored) |
Requires uv and Node 22 (see frontend/.nvmrc).
-
Build the data:
cd backend uv run snacker extract-products --raw ../data/raw/data/scanner \ --food ../data/openfoodfacts__product-database/food.parquet --products ../data/products.parquet uv run snacker build --raw ../data/raw/data/scanner --products ../data/products.parquet --out ../public-dataextract-productslooks up scanned codes in the 8 GB OpenFoodFacts file and saves a small products table; it does nothing when every scanned code was already looked up (--forceredoes it).buildwritespublic-data/data/…. Rerun both whenever the raw data changes; codes scanned since the last extraction show as unknown products. -
Run the frontend:
cd frontend npm install npm run devVite serves
public-data/as its public directory, so the app loads the built JSON from/data/….npm run buildproduces a static site infrontend/dist/, with the data copied in.
cd backend && uv run pytest && uv run mypy # backend tests and typecheck
cd frontend && npx tsc -b && npm run lint # frontend typecheck and lint