Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‘» GhostCart

Python Flask MySQL Scikit-Learn License

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.


✨ Features

πŸ“¦ Inventory Management

  • Product CRUD operations
  • Stock management
  • Reserved stock tracking
  • Low stock alerts

πŸ›’ Order Management

  • Checkout system
  • Order history
  • Order items
  • Revenue calculation

πŸ“Š Analytics Dashboard

  • Total Products
  • Total Orders
  • Total Revenue
  • Sales Overview Chart
  • Recent Orders
  • Inventory Alerts

πŸ€– AI Demand Forecast

  • Random Forest Regression (Scikit-learn)
  • Demand prediction API
  • Dashboard integration
  • Predicts expected product demand

πŸ§ͺ Data Generation

  • 1,000 realistic users
  • 65 products
  • 50,000 orders
  • Automated database seeding

πŸ›  Tech Stack

Backend

  • Python
  • Flask
  • SQLAlchemy
  • MySQL

Frontend

  • HTML
  • CSS
  • Bootstrap 5
  • JavaScript
  • Chart.js

Machine Learning

  • Pandas
  • Scikit-learn
  • Joblib

Tools

  • Git
  • GitHub
  • VS Code

πŸ“ Project Structure

GhostCart
β”‚
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ analytics/
β”‚   β”œβ”€β”€ checkout/
β”‚   β”œβ”€β”€ common/
β”‚   β”œβ”€β”€ ml/
β”‚   β”œβ”€β”€ orders/
β”‚   β”œβ”€β”€ products/
β”‚   β”œβ”€β”€ users/
β”‚   β”œβ”€β”€ static/
β”‚   └── templates/
β”‚
β”œβ”€β”€ scripts/
β”œβ”€β”€ stress_test/
β”œβ”€β”€ migrations/
β”œβ”€β”€ docs/
β”‚
β”œβ”€β”€ run.py
β”œβ”€β”€ requirements.txt
└── README.md

πŸ“Έ Screenshots

Sidebar

Sidebar

πŸ“Έ Dashboard

Dashboard

πŸ“¦ Orders

Inventory

πŸ“ˆ Analytics

Analytics

πŸ€– AI Forecast

AI Forecast

πŸš€ Installation

Clone Repository

git clone https://github.com/YOUR_USERNAME/GhostCart.git
cd GhostCart

Create Virtual Environment

python -m venv venv

Activate

Windows

venv\Scripts\activate

Linux/Mac

source venv/bin/activate

Install Dependencies

pip install -r requirements.txt

Configure Environment

Create a .env file:

SECRET_KEY=your_secret_key

DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=ghostcart

Run Migrations

flask db upgrade

Seed Database

python scripts/seed_database.py

Train AI Model

python -m app.ml.train

Run Application

python run.py

πŸ“‘ API Endpoints

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

πŸ€– Machine Learning Pipeline

Orders
      β”‚
      β–Ό
MySQL
      β”‚
      β–Ό
SQLAlchemy
      β”‚
      β–Ό
Pandas
      β”‚
      β–Ό
Feature Engineering
      β”‚
      β–Ό
Random Forest Regressor
      β”‚
      β–Ό
model.pkl
      β”‚
      β–Ό
Prediction API
      β”‚
      β–Ό
Dashboard

πŸ—οΈ System Architecture

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]
Loading

πŸ“ˆ Future Improvements

  • Multi-item orders
  • JWT Authentication
  • Docker support
  • CI/CD pipeline
  • Email notifications
  • Product recommendation system
  • Time-series demand forecasting

πŸ‘©β€πŸ’» Author

Tanishka Kuwar

Computer Engineering Student

Python Backend Developer | AI/ML Enthusiast

GitHub: https://github.com/tanishka-kuwar


⭐ If you found this project useful

Give this repository a ⭐ on GitHub!

About

AI-Powered Inventory Management System built with Flask, MySQL, and Machine Learning.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages