How mohammadwaseem6/expiry-traker works
Expiry Tracker is a full-stack inventory app: store staff sign in, add or import products, monitor expiry and stock, and review inventory analytics. The React client routes authenticated users to stock, dashboard, reports, charts, and settings views; its API client calls the Express service, which authenticates requests, dispatches inventory and account operations, and persists records in MongoDB. Separate upload and AI endpoints extract item data from files or delivery-note images. README capabilities are included where the tree supports them; page-to-API call details and unshown route wiring are not inferred.
Main entry points: App.jsx App routing · index.js Express entry · apiClient.js API client · Login.jsx Login and register
Components 27
Inventory client
- App routing
CLIENT/src/App.jsx - Login and register
CLIENT/src/pages/Login.jsx - Dashboard
CLIENT/src/pages/Dashboard.jsx - Stock management
CLIENT/src/pages/Stock.jsx - Reports and charts
CLIENT/src/pages/Reports.jsx - Chart views
CLIENT/src/pages/Charts.jsx - Expired items
CLIENT/src/pages/ExpiredView.jsx - Settings
CLIENT/src/pages/SettingsView.jsx - AI assistant
CLIENT/src/pages/AIChatbot.jsx - API client
CLIENT/src/Api/apiClient.js
API service
- Express entry
SERVER/index.js - Item routes
SERVER/routes/itemRoutes.js - Item operations
SERVER/controllers/itemController.js - Inventory records
SERVER/models/Item.js - MongoDB connection
SERVER/config/db.js - Order records
SERVER/models/Order.js
Item extraction
- File extraction
SERVER/routes/uploadRoutes.js - Image extraction
SERVER/routes/aiRoutes.js
Identity and access
- Auth context
CLIENT/src/context/AuthContext.jsx - Auth routes
SERVER/routes/authRoutes.js - Auth controller
SERVER/controllers/authController.js - JWT middleware
SERVER/middleware/auth.js - User routes
SERVER/routes/userRoutes.js - User administration
SERVER/controllers/userController.js - User records
SERVER/models/User.js
Other components
- Store staff
- Gemini AI
Connections 35
- Store staff → App routing: opens app
- App routing → Login and register: routes to
- App routing → Dashboard: routes to
- App routing → Stock management: routes to
- App routing → Reports and charts: routes to
- App routing → Chart views: routes to
- App routing → Expired items: routes to
- App routing → Settings: routes to
- Store staff → Login and register: submits credentials
- Login and register → Auth context: sets session
- Login and register → API client: requests auth
- Dashboard → API client: loads inventory
- Stock management → API client: manages items
- Reports and charts → API client: requests data
- Chart views → API client: requests data
- Expired items → API client: requests items
- API client → Express entry: sends API requests
- Express entry → Auth routes: mounts routes
- Express entry → Item routes: mounts routes
- Express entry → User routes: mounts routes
- Express entry → File extraction: mounts routes
- Express entry → Image extraction: mounts routes
- Express entry → MongoDB connection: connects
- Auth routes → Auth controller: dispatches
- Auth controller → User records: reads and writes
- Item routes → JWT middleware: protects routes
- Item routes → Item operations: dispatches
- Item operations → Inventory records: reads and writes
- User routes → JWT middleware: protects routes
- User routes → User administration: dispatches
- User administration → User records: reads and writes
- File extraction → JWT middleware: authenticates
- Image extraction → JWT middleware: authenticates
- Image extraction → Gemini AI: sends image prompt
- AI assistant → API client: uses assistant