A full-stack Django-based Smart Retail Inventory Management System integrated with Machine Learning for anomaly detection. The system helps retailers manage products, inventory, sales, reports, authentication, and AI-powered analytics.
- User Login
- User Registration
- Forgot Password
- Password Reset via Email
- Logout
- Role-Based Access Control (Admin, Manager, Staff)
- Add Products
- Update Products
- Delete Products
- Product Listing
- Product Search
- Stock In
- Stock Out
- Inventory Records
- Low Stock Detection
- Record Sales
- Sales History
- Revenue Calculation
- Sales Analytics
- Sales Report (PDF)
- Inventory Report (Excel)
- AI Anomaly Report (PDF)
Three anomaly detection techniques are implemented.
Statistical anomaly detection based on standard deviation.
Machine Learning model trained using historical retail sales data.
Density-based anomaly detection algorithm.
- Full Access
- Products
- Inventory
- Sales
- Reports
- AI Analytics
- Products
- Inventory
- Sales
Staff users cannot access:
- Reports
- AI Analytics
Training Dataset
β
βΌ
Data Preprocessing
β
βΌ
StandardScaler
β
βΌ
Isolation Forest
β
βΌ
Local Outlier Factor
β
βΌ
Save Trained Models (.pkl)
ββββββββββββββββββββββββββββββββββ
β
βΌ
Django Application
β
βΌ
Load Trained Models
β
βΌ
Predict Anomalies
SmartRetailInventory/
β
βββ accounts/
βββ analytics_dashboard/
βββ api/
βββ inventory/
βββ products/
βββ reports/
βββ sales/
β
βββ ai_engine/
β βββ data/
β βββ models/
β βββ train_model.py
β βββ predict.py
β βββ predict_lof.py
β βββ database_detector.py
β βββ database_isolation.py
β βββ database_lof.py
β βββ anomaly_detector.py
β
βββ static/
βββ templates/
βββ manage.py
βββ requirements.txt
- Python
- Django
- Django REST Framework
- HTML5
- CSS3
- Bootstrap 5
- JavaScript
- Chart.js
- SQLite3
- Scikit-learn
- Isolation Forest
- Local Outlier Factor
- Z-Score
- StandardScaler
- Joblib
- Pandas
- NumPy
- ReportLab
- OpenPyXL
git clone https://github.com/YOUR_USERNAME/SmartRetailInventory.git
cd SmartRetailInventorypython -m venv myenv
myenv\Scripts\activatepython3 -m venv myenv
source myenv/bin/activatepip install -r requirements.txtpython manage.py makemigrations
python manage.py migratepython manage.py createsuperuserpython ai_engine/train_model.pyThis creates:
ai_engine/models/
isolation_forest.pkl
lof.pkl
scaler.pkl
python manage.py runserverOpen
http://127.0.0.1:8000/
Example APIs
GET /api/products/
GET /api/inventory/
GET /api/sales/
| Algorithm | Purpose |
|---|---|
| Z-Score | Statistical anomaly detection |
| Isolation Forest | Machine Learning anomaly detection |
| Local Outlier Factor | Density-based anomaly detection |
- Email Notifications
- Barcode Scanner
- QR Code Support
- Demand Forecasting
- Sales Prediction
- Deep Learning Models
- Cloud Deployment
- PostgreSQL Support
- Anamika Kumari
- Shekhar Kumar Ray
- Ashwini Kumar Sinku
Computer Science and Engineering Student
AI | Machine Learning | Full Stack Django Developer
Please consider giving it a β on GitHub.






