Projects

Personal Operating System

Back to Projects
Production

Interactive 3D WebGL E-Commerce & Inventory Platform

MiniShop 3D

MiniShop 3D bridges immersive 3D spatial graphics with enterprise e-commerce state management. It features a Three.js interactive product viewer, strategy-pattern checkout calculations (dynamic tax, volume discounts, shipping thresholds), state-pattern order status lifecycle (Pending -> Processing -> Shipped -> Delivered), and real-time stock alert observers.

Status

Production

Stack

Python, FastAPI, React 19, Three.js, Vite, SQLite, Tailwind CSS

Throughput / Users

2,500+ Transactions

Performance

99.5% Uptime

System Architecture & Problem Statement

Core Problem Solved: Traditional 2D e-commerce stores fail to give buyers spatial confidence when purchasing complex products, while backend inventory tools often lack atomic state transitions, leading to stock overselling and manual order errors.

Architecture Layers:

1FastAPI Asynchronous Backend: Modular API routing layer split across auth, products, cart, checkout, and inventory log endpoints.
2Three.js WebGL Interactive Viewer: 3D orbital mesh viewport allowing 360° product inspection and dynamic material lighting.
3GoF Design Patterns Core: Observer pattern for stock alerts, Strategy pattern for discount & tax calculations, State pattern for order lifecycle, and Singleton pattern for inventory database managers.
4SQLite Persistence: Lightweight async database engine storing user sessions, token hashes, product catalogs, cart items, order history, and audit logs.

Key Product Features

Interactive 3D WebGL Hardware-Accelerated Product Viewer (Three.js)
Role-Based Authentication System (User & Admin JWT workflows)
Strategy Pattern Flexible Checkout (Custom tax, shipping & coupon logic)
State Pattern Order Lifecycle Manager (Pending, Paid, Dispatched, Complete)
Observer Pattern Stock Decrement Logs & Low-Stock Admin Alerts
Admin Control Panel for Real-Time Product CRUD & Image Uploads
Responsive Glassmorphic E-Commerce Frontend (React + Vite + Tailwind)

Database Entity Schema & Relationships

Users

Collection/Table
idattr
usernameattr
emailattr
hashedPasswordattr
roleattr

Creates many Carts and Orders

Products

Collection/Table
idattr
nameattr
priceattr
stockattr
categoryattr
model3dUrlattr

Belongs to Carts and Orders

Orders

Collection/Table
idattr
userIdattr
totalAmountattr
statusattr
shippingAddressattr

Has many OrderItems

API Specifications & Endpoints

POST/api/auth/login

Authenticates User/Admin credentials and returns JWT bearer token.

GET/api/products

Fetches product catalog with 3D asset metadata and category filters.

POST/api/checkout

Processes cart items using strategy pattern tax/discount calculations and initiates order state.

GET/api/admin/inventory/logs

Admin-only audit route returning observer log events and low-stock warnings.

Interactive Visual Screenshots & Previews

3D WebGL Interactive Product Viewer
LIVE SIMULATION
Diurnal Solar Angle: 48° NW
112.4 FPS WebGL
Panel Capacity: 14.8 kWpAnnual ROI: ₹1,85,000 / yr

Spatial 360-degree product viewport powered by Three.js and WebGL canvas controls.

Admin Control Dashboard & Inventory Logs
LIVE SIMULATION
Operational Metrics OverviewLive Telemetry

Total Throughput

1,240 / day

Avg Latency

18ms

Health Index

99.8%

Management panel for stock updates, order state transitions, and real-time observer alerts.

🚀 Quick Start & Process to Run

STEP-BY-STEP REPRODUCIBLE SETUP

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • npm

Required Environment Variables (.env)

SECRET_KEY=minishop_super_secret_jwt_key

DATABASE_URL=sqlite:///./backend/minishop.db

Execution Steps:

1

1. Clone Repository

Download MiniShop 3D source repository.

$ git clone https://github.com/Dev-Nurul08/Mini_Shop.git && cd Mini_Shop
2

2. Install Dependencies

Install FastAPI backend dependencies and React frontend packages.

$ pip install -r requirements.txt && cd frontend && npm install && cd ..
3

3. Start Backend FastAPI Server

Launch FastAPI server on http://localhost:8000.

$ python backend/main.py
4

4. Launch Frontend Vite Dev Server

Start Vite development server on http://localhost:5173.

$ npm --prefix frontend run dev

Engineering Challenges & Solutions

Challenge #1: Maintaining state consistency across complex checkout pipelines (discounts, tax, inventory lock) while keeping responses fast.
Challenge #2: Rendering 3D WebGL product models in React without affecting page load performance.

Key Lessons & Principles

Takeaway #1: Applying formal GoF Design Patterns (State, Strategy, Observer) keeps backend e-commerce architecture clean and predictable.
Takeaway #2: Hardware-accelerated 3D product previews boost user engagement and purchase confidence.