How bijuliji19-code/smart-pantry-tracker works
Smart Pantry Tracker supports account access, pantry and expiry/stock tracking, barcode lookup, grocery lists, recipe suggestions, and waste tracking. The principal workflow is to sign in, manage pantry items, then use pantry state for alerts and recipe matching while tracking shopping and waste separately. The graph includes the frontend navigation and backend route/model layers. Frontend-to-API calls are not shown because the sampled frontend references do not establish them.
Main entry points: App.jsx Application router · server.js Express server · auth.js JWT authentication · recipeRoutes.js Recipe routes
Components 24
Frontend navigation
- Application router
frontend/src/App.jsx - Landing page
frontend/src/Landing.jsx - Sign-in UI
frontend/src/Auth.jsx
Pantry and insights
- Pantry management
frontend/src/Pantry.jsx - Barcode scanner
frontend/src/BarcodeScanner.jsx - Loading state
frontend/src/Loader.jsx - Waste tracking
frontend/src/Waste.jsx - Grocery list
frontend/src/GroceryList.jsx - Recipe suggestions
frontend/src/Recipes.jsx
Backend API
- Express server
backend/server.js - Authentication routes
backend/routes/authRoutes.js - Pantry item routes
backend/routes/itemRoutes.js - Grocery routes
backend/routes/groceryRoutes.js - Local product routes
backend/routes/localProductRoutes.js - Recipe routes
backend/routes/recipeRoutes.js - User routes
backend/routes/userRoutes.js - JWT authentication
backend/middleware/auth.js
MongoDB models
- Pantry item model
backend/models/PantryItem.js - Grocery item model
backend/models/GroceryItem.js - Local product model
backend/models/LocalProduct.js - Recipe model
backend/models/Recipe.js - User model
backend/models/User.js - Recipe seed data
backend/seedRecipes.js
Other components
- User
Connections 29
- User → Application router: uses
frontend/src/App.jsx - Application router → Landing page: routes to
frontend/src/App.jsx - Application router → Sign-in UI: routes to
frontend/src/App.jsx - Application router → Pantry management: routes to
frontend/src/App.jsx - Application router → Waste tracking: routes to
frontend/src/App.jsx - Application router → Grocery list: routes to
frontend/src/App.jsx - Application router → Recipe suggestions: routes to
frontend/src/App.jsx - Pantry management → Barcode scanner: uses
frontend/src/Pantry.jsx - Pantry management → Loading state: renders
frontend/src/Pantry.jsx - Express server → Pantry item routes: mounts
backend/server.js - Express server → Authentication routes: mounts
backend/server.js - Express server → Local product routes: mounts
backend/server.js - Express server → Grocery routes: mounts
backend/server.js - Express server → User routes: mounts
backend/server.js - Express server → Recipe routes: mounts
backend/server.js - Authentication routes → User model: reads and writes
backend/routes/authRoutes.js - Pantry item routes → Pantry item model: reads and writes
backend/routes/itemRoutes.js - Grocery routes → Grocery item model: reads and writes
backend/routes/groceryRoutes.js - Local product routes → Local product model: reads and writes
backend/routes/localProductRoutes.js - Recipe routes → Pantry item model: reads
backend/routes/recipeRoutes.js - Recipe routes → Recipe model: reads
backend/routes/recipeRoutes.js - User routes → User model: reads
backend/routes/userRoutes.js - Pantry item routes → JWT authentication: authenticates
backend/routes/itemRoutes.js - Grocery routes → JWT authentication: authenticates
backend/routes/groceryRoutes.js - Local product routes → JWT authentication: authenticates
backend/routes/localProductRoutes.js - Recipe routes → JWT authentication: authenticates
backend/routes/recipeRoutes.js - User routes → JWT authentication: authenticates
backend/routes/userRoutes.js - JWT authentication → User model: updates activity
backend/middleware/auth.js - Recipe seed data → Recipe model: populates
backend/seedRecipes.js