How jonscott2/barcode-scanner-cs465 works
This is a food-inventory web app: users scan product barcodes, resolve product details, and track scanned items and their age/expiry; the project also documents recipe suggestions based on available ingredients. The graph separates the browser workflow, inventory/auth services, and API integrations. Source excerpts show the scanner’s calls and local/Firestore persistence, while README describes the barcode and recipe capabilities. Recipe-page/API wiring and some frontend registration details are not shown, so those relationships are marked unverified rather than asserted.
Main entry points: index.js Barcode scanning · storage.js Browser storage · App.jsx Page router · fetchItemInfo.js Product lookup
Components 20
Web experience
- Page router
src/App.jsx - Home screen
src/HomePage.jsx - Ingredients page
src/pages/Ingredients.jsx - Recipes page
src/pages/Recipes.jsx
Scanning and inventory
- Barcode scanning
src/js/index.js - Camera capture
src/js/components/video-capture.js - Barcode reader
src/js/helpers/BarcodeReader.js - Product lookup
src/js/helpers/fetchItemInfo.js - Inventory history
src/js/components/bs-history.js - Item result
src/js/components/bs-result.js
Identity and persistence
- Browser storage
src/js/services/storage.js - Firebase auth
src/js/services/firebase-auth.js - Firebase setup
src/js/services/firebase-config.js - Scan persistence
src/js/services/firebase-scans.js
External and server APIs
- UPC lookup service
server/proxy.js - UPC function
netlify/functions/upc.js - UPC function proxy
functions/upc-proxy.js - Recipe API
server/RecipeDB.js - Meal API
Other components
- User
Connections 24
- User → Page router: opens pages
src/App.jsx - Page router → Home screen: routes to
src/App.jsx - Page router → Ingredients page: routes to
src/App.jsx - Page router → Recipes page: routes to
src/App.jsx - Home screen → Barcode scanning: hosts scanner
- Barcode scanning → Barcode reader: decodes barcode
src/js/index.js - Barcode scanning → Camera capture: uses capture
src/js/index.js - Barcode scanning → Product lookup: looks up item
src/js/index.js - Product lookup → UPC lookup service: requests product
- User → UPC lookup service: resolves UPC
- Barcode scanning → Scan persistence: saves scan
src/js/index.js - Barcode scanning → Browser storage: reads settings
src/js/index.js - Inventory history → Browser storage: reads and writes
src/js/components/bs-history.js - Inventory history → Scan persistence: loads scan history
src/js/components/bs-history.js - Item result → Browser storage: reads settings
src/js/components/bs-result.js - Scan persistence → Browser storage: backs up scans
src/js/services/firebase-scans.js - Scan persistence → Firebase setup: uses Firebase
src/js/services/firebase-scans.js - Firebase auth → Firebase setup: initializes auth
src/js/services/firebase-auth.js - Barcode scanning → Firebase auth: initializes auth
src/js/index.js - Browser storage → Recipe API: posts ingredients
src/js/services/storage.js - Recipe API → Meal API: searches meals
- Recipes page → Recipe API: requests suggestions
- Product lookup → UPC function: may use proxy
- Product lookup → UPC function proxy: may use proxy