ShopMLOps is a high-performance e-commerce platform integrated with Machine Learning Operations (MLOps). It features real-time product recommendations, advanced search, and a modern microservices-ready architecture.
- Data Generation: A synthetic engine generates thousands of realistic products, categories, and user events (views, cart adds, transactions).
- Infrastructure: Docker launches a suite of services:
- PostgreSQL: Handles core transactions (Users, Orders).
- MongoDB: Stores event logs for ML training.
- Elasticsearch: Provides lightning-fast full-text search.
- Redis: Caches recommendations and sessions.
- ML Engine: A Python service computes TF-IDF Vectorization and Cosine Similarity to suggest products based on item attributes and user behavior.
- Frontend: A Next.js 14 application provides a seamless, responsive UI with real-time updates.
Ensure you have the following installed on your system:
- Docker & Docker Compose (Required for database services)
- Node.js (v18 or higher)
- Python (3.10 or higher)
- Git
git clone https://github.com/Tanuj-a-bit/mlops.git
cd mlopsThis is universal for Windows (WSL2/Desktop), macOS, and Linux.
cd Backend
docker-compose up -dWait for all containers (Postgres, Mongo, Redis, Elasticsearch) to show "Started".
python -m venv venv
.\venv\Scripts\activate
pip install -r requirements.txtpython3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtPopulate the system with products and events:
# Run from the root directory
python generate_data.py
# Seed the database
cd Backend
npx prisma generate
DATABASE_URL="your_postgresql_url" npx tsx prisma/seed.tscd ../Frontend
npm install
npx prisma generate
npx prisma db push
npm run dev| Feature | Windows (PowerShell) | macOS / Linux (Terminal) |
|---|---|---|
| Python Command | python |
python3 |
| Virtual Env | .\venv\Scripts\activate |
source venv/bin/activate |
| Env Variables | $env:DATABASE_URL="url" |
export DATABASE_URL="url" |
| File Paths | Uses backslashes \ |
Uses forward slashes / |
You can manually trigger the recommendation engine from the CLI:
# Content-based (Item-to-Item)
python ml/recommend.py item 1001
# Collaborative (User-to-Item)
python ml/recommend.py user 5├── Backend/ # FastAPI, Prisma, Docker, Database Schemas
├── Frontend/ # Next.js 14, Tailwind CSS, UI Components
├── Dataset/ # Generated CSV data
├── ml/ # Recommendation system logic
└── generate_data.py # Synthetic data engineMIT License. Created by Tanuj.