DemoKART 2.0 is a modern, full-stack E-Commerce platform that implements a production-grade machine learning recommendation engine. Instead of relying on basic keyword searches, DemoKART uses Semantic Search & Neural Embeddings to truly understand what a user is looking for, offering a "smart" shopping experience.
- π§ 4-Layer AI Recommendation Engine:
- Layer 1 (Content-Based): Uses
all-MiniLM-L6-v2to convert products into 384-dimensional mathematical vectors to find semantically similar items using Cosine Similarity. - Layer 2 (Collaborative Profiling): Averages the user's purchase history vectors into a "Personal Taste Vector".
- Layer 3 (Trending): Tracks global purchase velocity across all users.
- Layer 4 (Association Rules): Implements Market Basket Analysis to surface complementary goods (e.g. "Frequently Bought Together").
- Layer 1 (Content-Based): Uses
- β‘ Real-time ML Inference: The PyTorch model is loaded natively into the FastAPI memory pool, updating product embeddings in milliseconds without needing batch processing.
- π‘οΈ Secure Admin Portal: Password-protected dashboard with cryptographic SHA-256 hashing to manage inventory and user accounts safely.
- π Cloud-Native Persistence: Fully stateless architecture persisting data to Neon Postgres.
(Replace these placeholders with your actual screenshots by dragging and dropping your images directly into the GitHub editor!)
This repository uses a Monorepo structure:
PROJECT_ROOT/
βββ src/ # React Frontend (Vercel)
β βββ components/
β βββ engine/ # Similarity Matrix & Rec Engine Math
β βββ pages/
βββ api/ # Python Backend (Render)
β βββ main.py # FastAPI Application
β βββ requirements.txt # ML Dependencies
βββ package.json
- Frontend: React 19, Vite, React Router DOM, Vanilla CSS.
- Backend: Python 3, FastAPI, Uvicorn, psycopg2.
- AI / ML: PyTorch,
sentence-transformers(all-MiniLM-L6-v2). - Database: PostgreSQL (Hosted on Neon).
- Node.js installed
- Python 3 installed
- A Neon PostgreSQL Database URL
Navigate to the api folder and install the Python dependencies:
cd api
pip install -r requirements.txtCreate a .env file inside the api/ folder:
DATABASE_URL=postgresql://user:password@neon.tech/neondbReturn to the root directory and install Node dependencies:
npm installStart both the React frontend and the FastAPI backend simultaneously:
npm run dev- Frontend: http://localhost:5173
- Backend Swagger API Docs: http://localhost:8000/docs
(Note: On the very first boot, the FastAPI application will automatically seed your Postgres database with demo products!)
This application is designed to be hosted globally using Edge & Web Services.
Deploy the backend as a Web Service on Render.
- Root Directory:
api - Build Command:
pip install -r requirements.txt - Start Command:
uvicorn main:app --host 0.0.0.0 --port $PORT - Don't forget to add your
DATABASE_URLas an Environment Variable!
Deploy the frontend natively on Vercel.
- Import the root folder of this repository.
- Environment Variables: Add
VITE_API_URLand set it to your deployed Render URL (e.g.https://demokart-api-xyz.onrender.com).
Built with β€οΈ by Manish | Artificial Intelligence Project
