AI-Powered Inventory Management System built with Flask, MySQL, and Machine Learning
GhostCart is a full-stack inventory management system designed to simulate a real-world e-commerce backend. It combines inventory management, analytics, REST APIs, and machine learning to help businesses monitor stock levels and predict future product demand.
- Product CRUD operations
- Stock management
- Reserved stock tracking
- Low stock alerts
- Checkout system
- Order history
- Order items
- Revenue calculation
- Total Products
- Total Orders
- Total Revenue
- Sales Overview Chart
- Recent Orders
- Inventory Alerts
- Random Forest Regression (Scikit-learn)
- Demand prediction API
- Dashboard integration
- Predicts expected product demand
- 1,000 realistic users
- 65 products
- 50,000 orders
- Automated database seeding
- Python
- Flask
- SQLAlchemy
- MySQL
- HTML
- CSS
- Bootstrap 5
- JavaScript
- Chart.js
- Pandas
- Scikit-learn
- Joblib
- Git
- GitHub
- VS Code
GhostCart
β
βββ app/
β βββ analytics/
β βββ checkout/
β βββ common/
β βββ ml/
β βββ orders/
β βββ products/
β βββ users/
β βββ static/
β βββ templates/
β
βββ scripts/
βββ stress_test/
βββ migrations/
βββ docs/
β
βββ run.py
βββ requirements.txt
βββ README.md
git clone https://github.com/YOUR_USERNAME/GhostCart.gitcd GhostCartpython -m venv venvWindows
venv\Scripts\activateLinux/Mac
source venv/bin/activatepip install -r requirements.txtCreate a .env file:
SECRET_KEY=your_secret_key
DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=ghostcartflask db upgradepython scripts/seed_database.pypython -m app.ml.trainpython run.py| Method | Endpoint | Description |
|---|---|---|
| GET | /products |
Get all products |
| POST | /products |
Create product |
| PUT | /products/<id> |
Update product |
| DELETE | /products/<id> |
Delete product |
| POST | /checkout |
Checkout |
| GET | /dashboard |
Dashboard JSON |
| GET | /admin |
Admin Dashboard |
| GET | /analytics/orders-chart |
Sales Chart |
| GET | /analytics/low-stock |
Low Stock Alerts |
| GET | /analytics/predict |
AI Demand Prediction |
Orders
β
βΌ
MySQL
β
βΌ
SQLAlchemy
β
βΌ
Pandas
β
βΌ
Feature Engineering
β
βΌ
Random Forest Regressor
β
βΌ
model.pkl
β
βΌ
Prediction API
β
βΌ
Dashboard
flowchart TD
A[Browser] --> B[Flask Routes]
B --> C[Service Layer]
C --> D[Repository Layer]
D --> E[SQLAlchemy ORM]
E --> F[(MySQL Database)]
F --> G[Machine Learning]
G --> H[Pandas]
H --> I[Random Forest Model]
I --> J[Prediction API]
J --> K[Dashboard]
- Multi-item orders
- JWT Authentication
- Docker support
- CI/CD pipeline
- Email notifications
- Product recommendation system
- Time-series demand forecasting
Tanishka Kuwar
Computer Engineering Student
Python Backend Developer | AI/ML Enthusiast
GitHub: https://github.com/tanishka-kuwar
Give this repository a β on GitHub!




