How devesh9461/ai-powered-smart-inventory works
This is a full-stack smart-inventory application: staff authenticate, manage catalog items and stock movements, then review stock health, alerts, and analytics. The React router exposes these workflows through page components and a JWT-aware API client; Flask routes enforce authentication and operate on SQLAlchemy domain records. Separate AI services provide forecasting, anomaly detection, and predictive insights. The README documents PostgreSQL/SQLite storage and the product capabilities. Some backend route-to-model links are supported by the source index rather than excerpts; analytics-page wiring is not asserted where source evidence is unavailable.
Main entry points: App.jsx App routing · client.js API client · product.py Product records · transaction.py Stock movements
Components 27
Web application
- App routing
frontend/src/App.jsx - Login page
frontend/src/pages/Login.jsx - Dashboard page
frontend/src/pages/Dashboard.jsx - Products page
frontend/src/pages/Products.jsx - Transactions page
frontend/src/pages/Transactions.jsx - Analytics page
frontend/src/pages/Analytics.jsx - Alerts page
frontend/src/pages/Alerts.jsx - Settings page
frontend/src/pages/Settings.jsx - Auth context
frontend/src/context/AuthContext.jsx - API client
frontend/src/api/client.js
API and identity
- Authentication API
backend/app/routes/auth.py - Product API
backend/app/routes/products.py - Transaction API
backend/app/routes/transactions.py - Dashboard API
backend/app/routes/dashboard.py - Alert API
backend/app/routes/alerts.py - AI API
backend/app/routes/ai.py - JWT helpers
backend/app/utils/auth_helpers.py
Inventory domain
- Product records
backend/app/models/product.py - Stock movements
backend/app/models/transaction.py - Alert records
backend/app/models/alert.py - Categories
backend/app/models/category.py - User records
backend/app/models/user.py
AI intelligence
- Demand forecasting
backend/app/services/forecasting.py - Anomaly detection
backend/app/services/anomaly.py - Predictive insights
backend/app/services/insights.py
Other components
- Inventory staff
- SQL database
Connections 41
- Inventory staff → App routing: uses
frontend/src/App.jsx - App routing → Login page: routes to
frontend/src/App.jsx - App routing → Dashboard page: routes to
frontend/src/App.jsx - App routing → Products page: routes to
frontend/src/App.jsx - App routing → Transactions page: routes to
frontend/src/App.jsx - App routing → Analytics page: routes to
frontend/src/App.jsx - App routing → Alerts page: routes to
frontend/src/App.jsx - App routing → Settings page: routes to
frontend/src/App.jsx - Login page → Auth context: authenticates through
frontend/src/pages/Login.jsx - Auth context → API client: requests through
frontend/src/context/AuthContext.jsx - Products page → API client: requests through
frontend/src/pages/Products.jsx - Transactions page → API client: requests through
frontend/src/pages/Transactions.jsx - Dashboard page → API client: requests through
frontend/src/pages/Dashboard.jsx - Alerts page → API client: requests through
frontend/src/pages/Alerts.jsx - Settings page → API client: requests through
frontend/src/pages/Settings.jsx - API client → Authentication API: calls API
- Authentication API → JWT helpers: uses
backend/app/routes/auth.py - JWT helpers → User records: loads user
backend/app/utils/auth_helpers.py - Authentication API → User records: reads and updates
backend/app/routes/auth.py - Product API → Product records: manages
backend/app/routes/products.py - Product API → Categories: reads
backend/app/routes/products.py - Transaction API → Stock movements: records
backend/app/routes/transactions.py - Transaction API → Product records: updates stock
backend/app/routes/transactions.py - Transaction API → Alert records: creates alerts
backend/app/routes/transactions.py - Dashboard API → Product records: aggregates
backend/app/routes/dashboard.py - Dashboard API → Stock movements: aggregates
backend/app/routes/dashboard.py - Dashboard API → Categories: aggregates
backend/app/routes/dashboard.py - Dashboard API → Alert records: aggregates
backend/app/routes/dashboard.py - Alert API → Alert records: lists and updates
backend/app/routes/alerts.py - AI API → Demand forecasting: dispatches
backend/app/routes/ai.py - AI API → Anomaly detection: dispatches
backend/app/routes/ai.py - AI API → Predictive insights: dispatches
backend/app/routes/ai.py - Demand forecasting → Stock movements: reads history
backend/app/services/forecasting.py - Predictive insights → Demand forecasting: uses forecasts
backend/app/services/insights.py - Predictive insights → Product records: reads stock
backend/app/services/insights.py - Predictive insights → Stock movements: reads history
backend/app/services/insights.py - Product records → SQL database: persists in
backend/app/models/product.py - Stock movements → SQL database: persists in
backend/app/models/transaction.py - Alert records → SQL database: persists in
backend/app/models/alert.py - Categories → SQL database: persists in
backend/app/models/category.py - User records → SQL database: persists in
backend/app/models/user.py