Skip to content
RajatPetkarPublic

About

Developed a full-stack QR-based smart checkout platform enabling customers to scan products, manage carts, complete secure online payments, and generate digital invoices without waiting in billing queues.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SmartQR Logo

SmartQR β€” AI-Powered Self-Checkout System

Cashier-less shopping with QR codes, real-time monitoring, and intelligent product recommendations

React Native React Node.js Express Flask MongoDB scikit-learn Razorpay

Services Lines of Code Endpoints ML Signals


πŸ“‹ Table of Contents


🎯 Overview

SmartQR is a full-stack, microservices-based self-checkout platform that eliminates traditional billing queues in retail stores. The system enables a seamless, cashier-less shopping experience:

  1. πŸ“± Customers use a mobile app to scan a store's entry QR β†’ scan product QR codes to add items β†’ pay digitally via Razorpay β†’ exit using a verified QR code
  2. πŸ–₯️ Shopkeepers manage their store through a web dashboard with real-time customer monitoring, product management, analytics, and exit QR validation
  3. πŸ€– AI Engine provides personalized product recommendations using a hybrid ML model combining 4 scoring signals

Why SmartQR?
Traditional retail billing creates 10-15 minute queues during peak hours. SmartQR reduces checkout time to under 30 seconds with complete digital payment tracking and real-time inventory management.


πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        CLIENT LAYER                                β”‚
β”‚                                                                     β”‚
β”‚   πŸ“± React Native App (Expo)          🌐 React Dashboard (Vite)    β”‚
β”‚   β”œβ”€β”€ Store Entry QR Scan             β”œβ”€β”€ Login / Register          β”‚
β”‚   β”œβ”€β”€ Product QR Scan                 β”œβ”€β”€ Product Management        β”‚
β”‚   β”œβ”€β”€ Cart Management                 β”œβ”€β”€ Real-time Monitoring      β”‚
β”‚   β”œβ”€β”€ Razorpay Payment                β”œβ”€β”€ Analytics & Charts        β”‚
β”‚   β”œβ”€β”€ Exit QR Display                 β”œβ”€β”€ Exit QR Validation        β”‚
β”‚   └── AI Recommendations              └── Order History             β”‚
β”‚                                                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚          HTTPS                  β”‚
               β–Ό                                 β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      API LAYER (Node.js + Express)                  β”‚
β”‚                                                                     β”‚
β”‚   πŸ” Auth          πŸͺ Stores         πŸ“¦ Products     πŸ›’ Orders     β”‚
β”‚   JWT + bcrypt     CRUD + GeoJSON    CRUD + QR Gen   Cart + Exit    β”‚
β”‚                                                                     β”‚
β”‚   πŸ’³ Payments      πŸ“§ Email          πŸ”„ ML Proxy                   β”‚
β”‚   Razorpay +       PDF Invoice +     Forwards to                   β”‚
β”‚   HMAC Verify      Nodemailer        Python Service                 β”‚
β”‚                                                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚                                   β”‚
               β–Ό                                   β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   πŸƒ MongoDB Atlas       β”‚       β”‚   πŸ€– ML Service (Python + Flask) β”‚
β”‚                          β”‚       β”‚                                  β”‚
β”‚   Collections:           │◄──────│   TF-IDF Content Filtering       β”‚
β”‚   β”œβ”€β”€ customers          β”‚       β”‚   Collaborative Filtering        β”‚
β”‚   β”œβ”€β”€ stores             β”‚       β”‚   Popularity Scoring             β”‚
β”‚   β”œβ”€β”€ products           β”‚       β”‚   Price Proximity                β”‚
β”‚   └── orders             β”‚       β”‚   Hybrid Weighted Scoring        β”‚
β”‚                          β”‚       β”‚                                  β”‚
β”‚   Indexes:               β”‚       β”‚   Weights:                       β”‚
β”‚   β”œβ”€β”€ 2dsphere (geo)     β”‚       β”‚   Content=35% | Collab=30%      β”‚
β”‚   β”œβ”€β”€ Compound indexes   β”‚       β”‚   Popular=20% | Price=15%       β”‚
β”‚   └── Text indexes       β”‚       β”‚                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Service Communication Flow

sequenceDiagram
    participant App as πŸ“± Customer App
    participant BE as πŸ–₯️ Backend API
    participant ML as πŸ€– ML Service
    participant DB as πŸƒ MongoDB
    participant RZP as πŸ’³ Razorpay

    App->>BE: POST /api/orders/entry (Scan Store QR)
    BE->>DB: Create Order document
    BE-->>App: { orderId, storeId }

    App->>BE: POST /api/orders/scan-product (Scan Product QR)
    BE->>DB: Update cart in Order
    BE-->>App: { cart, totalAmount, product }

    App->>BE: GET /api/recommendations/:storeId/:productId
    BE->>ML: Forward with JWT header
    ML->>DB: Fetch products + order history
    ML->>ML: TF-IDF + Collaborative + Popularity + Price
    ML-->>BE: { recommendations[], model }
    BE-->>App: { recommendations[] }

    App->>BE: POST /api/payment/create-payment-intent
    BE->>RZP: Create Razorpay Order
    RZP-->>BE: { orderId, key_id }
    BE-->>App: { razorpayOrderId, amount, key_id }

    App->>RZP: Razorpay Checkout (WebView)
    RZP-->>App: { payment_id, order_id, signature }

    App->>BE: POST /api/payment/confirm
    BE->>BE: Verify HMAC-SHA256 signature
    BE->>DB: Update paymentStatus = 'paid'
    BE->>DB: Generate exitQR
    BE-->>App: { exitQR, transactionId }
Loading

✨ Features

πŸ“± Customer Mobile App (React Native + Expo)

Feature Description
Store Entry QR Scan store's unique QR code to begin a shopping session
Product Scanner Scan product QR codes to instantly add items to cart
AI Recommendations Receive ML-powered product suggestions after scanning an item
Cart Management Increase/decrease quantities, remove items, view running total
Razorpay Payment Secure in-app payment via WebView with server-side signature verification
Exit QR Code Auto-generated post-payment QR for validated store exit
Nearby Stores Discover stores using GPS with GeoJSON 2dsphere queries
Profile Management View/edit customer profile and order history

πŸ–₯️ Shopkeeper Dashboard (React + Vite)

Feature Description
Store Registration JWT-authenticated store owner onboarding
Product Management Full CRUD with Cloudinary image upload and auto QR generation
Live Monitoring Real-time view of active shoppers, their carts, and time spent
Analytics Revenue charts (daily/weekly/monthly), sales funnels, top products
Exit Validation Scan customer's exit QR to verify purchase and authorize exit
Order History Filter orders by payment status, date range, with customer details
Low Stock Alerts Automatic alerts when product stock falls below threshold

πŸ€– AI Recommendation Engine (Python + Flask)

Feature Description
Content-Based Filtering TF-IDF vectorization on product text + cosine similarity
Collaborative Filtering Co-purchase pattern analysis from historical order data
Popularity Scoring Product purchase frequency normalization
Price Proximity Inverse normalized price distance for budget-relevant suggestions
Hybrid Scoring Weighted combination (35/30/20/15) of all 4 signals
Smart Exclusion Auto-excludes scanned item + items already in customer's cart
Explainable AI Human-readable tags: "Same Category", "Frequently Bought Together", etc.

πŸ› οΈ Tech Stack

Frontend & Mobile

Technology Purpose Version
React Shopkeeper Dashboard UI 18.2
Vite Build tool & dev server 4.4
React Router Client-side routing 6.15
React Native Cross-platform mobile app Expo SDK
Expo Development & build toolchain Latest
expo-camera QR code scanning Latest
expo-location Geolocation services Latest
Tailwind CSS Utility-first styling 3.3
Axios HTTP client 1.7
Cloudinary Product image CDN API v2

Backend

Technology Purpose Version
Node.js Runtime environment 18+
Express.js REST API framework 4.18
Mongoose MongoDB ODM 7.5
JWT (jsonwebtoken) Stateless authentication 9.0
bcryptjs Password hashing 2.4
Razorpay SDK Payment processing 2.9
PDFKit Invoice PDF generation 0.18
Nodemailer Email delivery 6.10
QRCode QR code generation 1.5

ML Service

Technology Purpose Version
Python ML service runtime 3.11
Flask Lightweight web framework 3.1
scikit-learn TF-IDF, cosine similarity 1.6
NumPy Numerical computation 2.2
Pandas Data manipulation 2.2
PyMongo Direct MongoDB driver 4.12
Gunicorn Production WSGI server 23.0

Infrastructure

Technology Purpose
MongoDB Atlas Cloud-hosted NoSQL database (free tier)
Render Backend + ML service hosting (free tier)
Vercel Frontend static site hosting (free tier)
Expo EAS Mobile APK cloud builds
GitHub Version control (monorepo)

πŸ€– ML Recommendation Engine

The recommendation engine uses a hybrid scoring model that combines 4 independent signals:

Final Score = (Content Γ— 0.35) + (Collaborative Γ— 0.30) + (Popularity Γ— 0.20) + (Price Γ— 0.15)

Signal Breakdown

1. Content-Based Filtering (Weight: 35%)

# TF-IDF Vectorization on product text features
vectorizer = TfidfVectorizer(stop_words='english', max_features=500, ngram_range=(1, 2))
tfidf_matrix = vectorizer.fit_transform(corpus)
similarities = cosine_similarity(tfidf_matrix[0:1], tfidf_matrix[1:])
  • Builds text corpus from product name + category (3Γ— weighted) + description
  • Uses TF-IDF with bigrams (ngram_range 1-2) for semantic matching
  • Computes cosine similarity between scanned product and all candidates

2. Collaborative Filtering (Weight: 30%)

# Co-purchase pattern mining from order history
past_orders = db.orders.find({
    'storeId': store_id, 'paymentStatus': 'paid',
    'cart.productId': scanned_product_id
})
# Count co-occurrence frequency, normalize by max
  • Analyzes up to 200 past orders containing the scanned product
  • Counts how often each candidate appears alongside the scanned product
  • Normalizes by maximum co-purchase count

3. Popularity Scoring (Weight: 20%)

  • Aggregates purchase counts across 300 recent paid orders in the store
  • Considers quantity per purchase (not just order count)
  • Normalizes to [0, 1] range

4. Price Proximity (Weight: 15%)

# Inverse normalized price distance
score = 1.0 - (|candidate_price - scanned_price| / max_price_diff)
  • Products with similar prices score higher
  • Uses inverse normalization so closer prices get higher scores

Output Example

{
  "recommendations": [
    {
      "name": "Whole Wheat Bread",
      "price": 45,
      "category": "Bakery",
      "score": 78.4,
      "reasons": ["Same Category", "Frequently Bought Together"]
    }
  ],
  "model": "hybrid-tfidf-collaborative-v1"
}

πŸ“ Project Structure

Smart-QR/
β”œβ”€β”€ backend/                          # Node.js REST API
β”‚   β”œβ”€β”€ server.js                     # Express app entry point
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ .env                          # Environment variables (git-ignored)
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ Customer.js               # Customer schema
β”‚   β”‚   β”œβ”€β”€ Store.js                  # Store schema (GeoJSON location)
β”‚   β”‚   β”œβ”€β”€ Product.js                # Product schema
β”‚   β”‚   └── Order.js                  # Order schema (cart, transactions, activity logs)
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ customerRoutes.js         # Register, login, profile (customer)
β”‚   β”‚   β”œβ”€β”€ storeRoutes.js            # Register, login, CRUD, geolocation (store)
β”‚   β”‚   β”œβ”€β”€ productRoutes.js          # CRUD, QR generation (products)
β”‚   β”‚   β”œβ”€β”€ orderRoutes.js            # Entry, scan-product, cart, exit-verify
β”‚   β”‚   β”œβ”€β”€ paymentRoutes.js          # Razorpay create + confirm + signature verify
β”‚   β”‚   β”œβ”€β”€ shopkeeperRoutes.js       # Analytics, monitoring, order filtering
β”‚   β”‚   └── recommendationRoutes.js   # ML service proxy
β”‚   └── utils/
β”‚       └── emailService.js           # PDF invoice generation + email delivery
β”‚
β”œβ”€β”€ shopkeeper-frontend/              # React Shopkeeper Dashboard
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ vite.config.js
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ .env                          # VITE_API_BASE_URL (git-ignored)
β”‚   └── src/
β”‚       β”œβ”€β”€ App.jsx                   # Route definitions
β”‚       β”œβ”€β”€ main.jsx                  # Entry point
β”‚       β”œβ”€β”€ index.css                 # Global styles + design system
β”‚       └── components/
β”‚           β”œβ”€β”€ Login.jsx             # Shopkeeper login
β”‚           β”œβ”€β”€ Register.jsx          # Store registration
β”‚           β”œβ”€β”€ Dashboard.jsx         # Stats, charts, overview
β”‚           β”œβ”€β”€ AddProduct.jsx        # Add product with image upload
β”‚           β”œβ”€β”€ Monitor.jsx           # Real-time customer tracking
β”‚           β”œβ”€β”€ ValidateQR.jsx        # Exit QR scanner & validator
β”‚           β”œβ”€β”€ Analytics.jsx         # Revenue charts, sales data
β”‚           └── Layout.jsx            # Sidebar + topbar wrapper
β”‚
β”œβ”€β”€ MyFirstApp/                       # React Native Customer App
β”‚   β”œβ”€β”€ App.js                        # Navigation setup
β”‚   β”œβ”€β”€ app.json                      # Expo configuration
β”‚   β”œβ”€β”€ eas.json                      # EAS Build profiles
β”‚   β”œβ”€β”€ config.js                     # API_BASE_URL configuration
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ screens/
β”‚   β”‚   β”œβ”€β”€ HomeScreen.js             # Store QR scan + nearby stores
β”‚   β”‚   β”œβ”€β”€ LoginScreen.js            # Customer login
β”‚   β”‚   β”œβ”€β”€ RegisterScreen.js         # Customer registration
β”‚   β”‚   β”œβ”€β”€ ProductScanScreen.js      # Product QR scanner + cart overlay
β”‚   β”‚   β”œβ”€β”€ CartScreen.js             # Cart management
β”‚   β”‚   β”œβ”€β”€ PaymentScreen.js          # Razorpay WebView checkout
β”‚   β”‚   β”œβ”€β”€ ExitQRScreen.js           # Display exit QR code
β”‚   β”‚   β”œβ”€β”€ ProfileScreen.js          # Customer profile
β”‚   β”‚   └── RecommendationModal.js    # AI recommendations bottom sheet
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   └── beep.js                   # Scan feedback sound
β”‚   └── assets/
β”‚       β”œβ”€β”€ icon.png                  # App icon
β”‚       β”œβ”€β”€ splash-icon.png           # Splash screen
β”‚       └── beep.mp3                  # Scan audio feedback
β”‚
β”œβ”€β”€ ml-recommendation-service/        # Python ML Microservice
β”‚   β”œβ”€β”€ app.py                        # Flask app + RecommendationEngine class
β”‚   β”œβ”€β”€ requirements.txt              # Python dependencies
β”‚   β”œβ”€β”€ .env                          # MONGO_URI, JWT_SECRET (git-ignored)
β”‚   └── venv/                         # Python virtual environment (git-ignored)
β”‚
└── README.md                         # This file

πŸš€ Getting Started

Prerequisites

  • Node.js v18+ and npm
  • Python 3.11+
  • MongoDB Atlas account (free tier)
  • Expo CLI (npm install -g expo-cli)
  • EAS CLI (npm install -g eas-cli) β€” for APK builds
  • Git

1. Clone the Repository

git clone https://github.com/Smart-Checkout-org/SMART-QR.git
cd SMART-QR

2. Setup Backend

cd backend
npm install

# Create .env file
cp .env.example .env    # or create manually (see Environment Variables section)

# Start the server
npm run dev    # Uses nodemon for hot reload
# OR
npm start      # Production mode

3. Setup ML Service

cd ml-recommendation-service

# Create virtual environment
python -m venv venv
source venv/bin/activate    # Linux/Mac
# venv\Scripts\activate     # Windows

# Install dependencies
pip install -r requirements.txt

# Create .env file (see Environment Variables section)

# Start the service
python app.py

4. Setup Shopkeeper Frontend

cd shopkeeper-frontend
npm install

# Create .env file (see Environment Variables section)

# Start dev server
npm run dev

5. Setup Mobile App

cd MyFirstApp
npm install

# Update config.js with your backend URL

# Start Expo dev server
npx expo start

# Scan QR code with Expo Go app on your phone

πŸ” Environment Variables

Backend (backend/.env)

MONGO_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/smartqr?retryWrites=true&w=majority
JWT_SECRET=your_secure_jwt_secret_here
RAZORPAY_KEY_ID=rzp_test_xxxxxxxxxxxxxxx
RAZORPAY_SECRET_KEY=your_razorpay_secret
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_app_password
PORT=5000
SERVER_HOST=0.0.0.0
ML_SERVICE_URL=http://127.0.0.1:5001

ML Service (ml-recommendation-service/.env)

MONGO_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/smartqr?retryWrites=true&w=majority
JWT_SECRET=your_secure_jwt_secret_here    # Must match backend
ML_PORT=5001
ML_HOST=0.0.0.0
FLASK_DEBUG=true

Shopkeeper Frontend (shopkeeper-frontend/.env)

VITE_API_BASE_URL=http://localhost:5000
VITE_CLOUDINARY_CLOUD_NAME=your_cloud_name
VITE_CLOUDINARY_UPLOAD_PRESET=your_upload_preset

Mobile App (MyFirstApp/config.js)

const API_BASE_URL = 'http://<YOUR_LOCAL_IP>:5000';  // For development
// const API_BASE_URL = 'https://your-backend.onrender.com';  // For production
export default API_BASE_URL;

⚠️ Important: Never commit .env files to Git. They are included in .gitignore.


🌐 Deployment

Architecture in Production

Service Platform Type
Backend API Render Node.js Web Service
ML Service Render Python Web Service
Shopkeeper Dashboard Vercel Static Site (Vite)
Customer App Expo EAS Android APK
Database MongoDB Atlas Free M0 Cluster

Deploy Backend (Render)

  1. Connect GitHub repo on render.com
  2. Root Directory: backend
  3. Build Command: npm install
  4. Start Command: node server.js
  5. Add all env vars (set PORT=10000, ML_SERVICE_URL=https://your-ml-service.onrender.com)

Deploy ML Service (Render)

  1. Create another Web Service on Render
  2. Root Directory: ml-recommendation-service
  3. Build Command: pip install -r requirements.txt
  4. Start Command: gunicorn app:app --bind 0.0.0.0:$PORT --timeout 120
  5. Add env vars (MONGO_URI, JWT_SECRET, PYTHON_VERSION=3.11.0)

Deploy Frontend (Vercel)

  1. Import project on vercel.com
  2. Root Directory: shopkeeper-frontend
  3. Framework: Vite
  4. Add env vars (VITE_API_BASE_URL=https://your-backend.onrender.com)

Build Mobile APK (Expo EAS)

cd MyFirstApp

# Update config.js with production backend URL
# const API_BASE_URL = 'https://your-backend.onrender.com';

eas login
eas build --platform android --profile preview
# Download APK from expo.dev dashboard

πŸ“‘ API Reference

Authentication

Method Endpoint Description
POST /api/customers/register Register new customer
POST /api/customers/login Customer login (returns JWT)
GET /api/customers/profile Get customer profile
POST /api/stores/register Register new store
POST /api/stores/login Store owner login (returns JWT)

Store Management

Method Endpoint Description
GET /api/stores/:id Get store details
PUT /api/stores/:id Update store info
POST /api/stores/nearby Find nearby stores (GeoJSON)
GET /api/stores/all/list List all stores

Products

Method Endpoint Description
POST /api/products/add Add new product (with image)
GET /api/products/store/:storeId Get all products for a store
PUT /api/products/:id Update product
DELETE /api/products/:id Delete product

Orders & Cart

Method Endpoint Description
POST /api/orders/entry Create order (store entry scan)
POST /api/orders/scan-product Add product to cart
GET /api/orders/current-order/:storeId Get active order
POST /api/orders/update-cart Update cart quantities
POST /api/orders/verify-exit Validate exit QR code

Payments

Method Endpoint Description
POST /api/payment/create-payment-intent Create Razorpay order
POST /api/payment/confirm Verify payment signature & confirm

ML Recommendations

Method Endpoint Description
GET /api/recommendations/:storeId/:productId Get AI recommendations

Analytics (Shopkeeper)

Method Endpoint Description
GET /api/shopkeeper/stats/:storeId Store statistics
GET /api/shopkeeper/monitor/:storeId Active customers
GET /api/shopkeeper/orders/:storeId Filtered order history

Health Checks

Method Endpoint Service
GET /health Backend API
GET /health ML Service

πŸ”„ User Flow

Customer Journey

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Open App   │────▢│  Login /     │────▢│  Scan Store  β”‚
β”‚              β”‚     β”‚  Register    β”‚     β”‚  Entry QR    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                                  β”‚
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”
                     β”‚  View AI     │◀────│  Scan Product β”‚
                     β”‚  Recommend.  β”‚     β”‚  QR Code      β”‚
                     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚                     β”‚
                            β–Ό                     β–Ό
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚  Add to Cart │────▢│  View Cart   β”‚
                     β”‚  (from AI)   β”‚     β”‚  & Checkout  β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                                  β”‚
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”
                     β”‚  Show Exit   │◀────│  Pay via      β”‚
                     β”‚  QR Code     β”‚     β”‚  Razorpay     β”‚
                     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
                            β–Ό
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚  Shopkeeper  β”‚
                     β”‚  Validates   β”‚
                     β”‚  Exit QR     β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Shopkeeper Journey

Register Store β†’ Add Products (with images) β†’ Share Store Entry QR
     ↓
Monitor Active Customers (real-time) β†’ View Analytics
     ↓
Validate Exit QR β†’ Stock Auto-Deducted β†’ Invoice Emailed to Customer

πŸ“Š Project Metrics

Metric Value
Total Codebase ~12,000 lines across 45 source files
Backend Endpoints 20+ RESTful API endpoints
Route Modules 7 (customer, store, product, order, payment, shopkeeper, recommendation)
Database Models 4 schemas with 5 compound indexes
ML Scoring Signals 4-signal hybrid model
Mobile Screens 9 screens + 1 modal
Dashboard Pages 8 components (including analytics)
Services 4 independently deployable microservices
Payment Security HMAC-SHA256 server-side signature verification

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is for educational and demonstration purposes.


Built with ❀️ by the SmartQR Team

About

Developed a full-stack QR-based smart checkout platform enabling customers to scan products, manage carts, complete secure online payments, and generate digital invoices without waiting in billing queues.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages