How liamstainton21/pantry-loop works
Pantry Loop is an offline-first grocery tracker: a person scans or manually enters a product, identifies it locally or through optional online lookup, records a purchase or depletion, and reviews inventory and a persistent shopping list. The app stores its authoritative data in browser IndexedDB and also supports catalogue editing, backups, restore, and spreadsheet snapshots. The graph follows the sampled runtime modules and documented capabilities; some integration details are documented in the README rather than shown in the sampled source.
Main entry points: main.js App router · lookup.js Product lookup · db.js IndexedDB data · identification.js Product identification
Components 19
Capture & identification
- Camera scanner
src/scanner.js - Barcode rules
src/barcode.js - Product identification
src/identification.js - Product lookup
src/lookup.js - Scan confirmation
src/confirmation.js
Inventory & shopping
- Stock replay
src/inventory.js - List generation
src/list.js
Local data & export
- IndexedDB data
src/db.js - Backup & export
src/export.js
App interface
- App router
src/main.js - Scan screen
src/views/scan.js - Catalogue screen
src/views/catalogue.js - List screen
src/views/list.js - Settings screen
src/views/settings.js - UI helpers
src/ui.js
Other components
- Shopper
- Tesco proxy
- Open Food Facts
- Vision proxy
Connections 31
- Shopper → Scan screen: uses
README.md - Shopper → Catalogue screen: manages products
README.md - Shopper → List screen: shops from
README.md - Shopper → Settings screen: configures
README.md - Scan screen → Camera scanner: starts camera
src/views/scan.js - Scan screen → Barcode rules: normalizes codes
src/views/scan.js - Camera scanner → Barcode rules: maps formats
src/scanner.js - App router → Scan screen: routes to
src/main.js - App router → List screen: routes to
src/main.js - App router → Catalogue screen: routes to
src/main.js - App router → Settings screen: routes to
src/main.js - App router → Product lookup: identifies codes
src/main.js - App router → Product identification: requests fallback
src/main.js - App router → Scan confirmation: confirms scans
src/main.js - App router → IndexedDB data: records events
src/main.js - App router → Product lookup: processes queue
src/main.js - Product identification → Product lookup: checks barcode
src/identification.js - Product identification → Camera scanner: scans barcode
src/identification.js - Product lookup → Barcode rules: checks eligibility
src/lookup.js - Product lookup → IndexedDB data: reads and updates
src/lookup.js - Product lookup → Tesco proxy: queries proxy
README.md - Product lookup → Open Food Facts: queries fallback
README.md - Product identification → Vision proxy: sends chosen photo
README.md - Catalogue screen → IndexedDB data: reads and edits
src/views/catalogue.js - List screen → List generation: generates suggestions
src/views/list.js - List screen → IndexedDB data: loads and saves draft
src/views/list.js - List generation → Stock replay: uses stock history
src/list.js - IndexedDB data → Stock replay: replays stock
src/db.js - Settings screen → IndexedDB data: saves settings
src/views/settings.js - Settings screen → Backup & export: offers backups
src/views/settings.js - Backup & export → IndexedDB data: reads and restores
src/export.js