Skip to content

M0neySSH/mBed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

image

πŸ›’ DemoKART 2.0

AI-Powered E-Commerce with Neural Embedding Recommendations

React FastAPI PostgreSQL PyTorch


πŸš€ Overview

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.

✨ Key Features

  • 🧠 4-Layer AI Recommendation Engine:
    • Layer 1 (Content-Based): Uses all-MiniLM-L6-v2 to 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").
  • ⚑ 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.

πŸ“Έ Screenshots

(Replace these placeholders with your actual screenshots by dragging and dropping your images directly into the GitHub editor!)

Home Page & Recommendations

image

AI-Powered Product Detail

image

Admin Dashboard

image

πŸ— Architecture & Tech Stack

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).

πŸš€ Quick Start (Local Development)

Prerequisites

  • Node.js installed
  • Python 3 installed
  • A Neon PostgreSQL Database URL

1. Setup the Backend

Navigate to the api folder and install the Python dependencies:

cd api
pip install -r requirements.txt

Create a .env file inside the api/ folder:

DATABASE_URL=postgresql://user:password@neon.tech/neondb

2. Setup the Frontend

Return to the root directory and install Node dependencies:

npm install

3. Start the Application

Start both the React frontend and the FastAPI backend simultaneously:

npm run dev

(Note: On the very first boot, the FastAPI application will automatically seed your Postgres database with demo products!)


🌐 Deployment

This application is designed to be hosted globally using Edge & Web Services.

1. Backend (Render.com)

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_URL as an Environment Variable!

2. Frontend (Vercel)

Deploy the frontend natively on Vercel.

  • Import the root folder of this repository.
  • Environment Variables: Add VITE_API_URL and set it to your deployed Render URL (e.g. https://demokart-api-xyz.onrender.com).

Built with ❀️ by Manish | Artificial Intelligence Project

About

A simple embedding based shopping recommendation neural system built w/ Python + React.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors