Skip to content
snacker-trackerPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Snacker Tracker Interface

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 brief
  • PRD.md: requirements and the static JSON contract
  • GitHub issues: specs and tickets, labelled by feature

Layout

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)

Running locally

Requires uv and Node 22 (see frontend/.nvmrc).

  1. 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-data

    extract-products looks 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 (--force redoes it). build writes public-data/data/…. Rerun both whenever the raw data changes; codes scanned since the last extraction show as unknown products.

  2. Run the frontend:

    cd frontend
    npm install
    npm run dev

    Vite serves public-data/ as its public directory, so the app loads the built JSON from /data/…. npm run build produces a static site in frontend/dist/, with the data copied in.

Checks

cd backend && uv run pytest && uv run mypy      # backend tests and typecheck
cd frontend && npx tsc -b && npm run lint       # frontend typecheck and lint

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages