Skip to content

YashvanthSankar/scan2save

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scan2Save

Retail, Reimagined for the AI Era.

Walk into any store, scan the QR, and unlock personalized offers designed just for you.

Scan2Save transforms physical retail with adaptive intelligence. Our ML-powered recommendation engine learns shopper preferences in real-time, surfacing offers that actually matter while they browse. Checkout happens in seconds, not minutes.

This is shopping, evolved.


Core Value Proposition

For Shoppers For Retailers
Hyper-personalized offers based on purchase history Increased conversion through targeted discounts
Scan & Go checkout experience Real-time inventory-aware promotions
No app download required (PWA) Zero hardware integration costs

Demo

Video Walkthrough

▶️ Watch the Full Demo on YouTube

A complete walkthrough of the Scan2Save experience — from scanning the store QR to checkout.


Demo Credentials

For testing the application:

User:

Field Value
Phone +91 9696969696
OTP 000000

Admin:

Field Value
Phone +91 1111111111
OTP 111111

App Screenshots

Click to view the complete user journey
Step Screenshot Description
1 Landing Page
2 Install Pop up
3 Install Button
4 User Dashboard
5 Store Page
6 Shopping Route
7 Checkout Page
8 Payment Simulation
9 Payment Success
10 Order History

Architecture Overview

┌─────────────────────────────────────────────────────────────┐
│                         FRONTEND                            │
│  Next.js 16 (App Router) + React 19 + TailwindCSS 4         │
│  /core                                                      │
└─────────────────────────────────┬───────────────────────────┘
                                  │
                                  ▼
┌─────────────────────────────────────────────────────────────┐
│                         API LAYER                           │
│  Next.js API Routes (Edge-ready)                            │
│  /core/app/api/*                                            │
└─────────────────────────────────┬───────────────────────────┘
                                  │
          ┌───────────────────────┼───────────────────────────┐
          ▼                       ▼                           ▼
┌─────────────────┐   ┌─────────────────────┐   ┌─────────────────────┐
│   Firebase      │   │   Supabase          │   │   AI Engine         │
│   (Auth)        │   │   (PostgreSQL)      │   │   (Groq/Gemini)     │
│                 │   │   via Prisma ORM    │   │                     │
└─────────────────┘   └─────────────────────┘   └─────────────────────┘

Project Structure

scan2save/
├── core/                    # Main Next.js Application
│   ├── app/                 # App Router pages & API routes
│   │   ├── api/             # Backend API endpoints
│   │   ├── admin/           # Admin dashboard (protected)
│   │   ├── dashboard/       # User dashboard
│   │   ├── store/[storeId]/ # Dynamic store pages
│   │   ├── scan/            # QR scanning page
│   │   ├── cart/            # Shopping cart
│   │   ├── checkout/        # Checkout flow
│   │   └── ...
│   ├── components/          # Reusable React components
│   ├── lib/                 # Utilities, contexts, clients
│   │   ├── prisma.ts        # Prisma client
│   │   ├── firebase.ts      # Firebase Admin SDK
│   │   └── CartContext.tsx  # Cart state management
│   ├── prisma/
│   │   ├── schema.prisma    # Database schema
│   │   └── seed.ts          # Seed data
│   └── services/            # AI Recommendation Engine
│       └── recommendation-engine/
└── README.md                # This file

Quick Start

Prerequisites

  • Node.js 18+
  • PostgreSQL database (Supabase recommended)
  • Firebase project (for OTP authentication)

Installation

# Clone the repository
git clone https://github.com/your-username/scan2save.git
cd scan2save/core

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Edit .env with your credentials

# Generate Prisma client
npx prisma generate

# Push schema to database
npx prisma db push

# Seed the database (optional)
npx prisma db seed

# Start development server
npm run dev

Environment Variables

Create a .env file in /core with:

# Database (Supabase PostgreSQL)
DATABASE_URL="postgresql://..."
DIRECT_URL="postgresql://..."

# Supabase Client
NEXT_PUBLIC_SUPABASE_URL="https://your-project.supabase.co"
NEXT_PUBLIC_SUPABASE_ANON_KEY="your-anon-key"

# Firebase (for OTP Auth)
NEXT_PUBLIC_FIREBASE_API_KEY="..."
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN="..."
NEXT_PUBLIC_FIREBASE_PROJECT_ID="..."
FIREBASE_PROJECT_ID="..."
FIREBASE_CLIENT_EMAIL="..."
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"

# AI Recommendation Engine (optional)
GROQ_API_KEY="..."

Key Features

1. QR-Based Store Entry

Shoppers scan a store's unique QR code to "enter" the digital store experience.

2. AI-Personalized Offers

Real-time recommendation engine analyzes:

  • Purchase history
  • Browsing behavior
  • Category affinities
  • Time-based patterns

3. Seamless Scan & Go

  • Add products to cart by scanning barcodes
  • Checkout via UPI/digital payments
  • Generate exit pass QR for store verification

4. Admin Dashboard

  • Store management
  • User analytics
  • Offer creation
  • Transaction verification

Tech Stack

Layer Technology
Frontend Next.js 16, React 19, TailwindCSS 4
Backend Next.js API Routes, Prisma ORM
Database PostgreSQL (Supabase)
Auth Firebase Phone Authentication
AI Groq LLM / Google Gemini
Styling TailwindCSS + Custom Design System
Icons Lucide React
Theming next-themes (Dark/Light mode)

User Flow

┌────────────┐     ┌─────────────┐     ┌──────────────┐
│  Landing   │────▶│    Login    │────▶│  Dashboard   │
│   Page     │     │  (OTP Auth) │     │              │
└────────────┘     └─────────────┘     └──────┬───────┘
                                              │
                                              ▼
┌────────────┐     ┌─────────────┐     ┌──────────────┐
│  Checkout  │◀────│    Cart     │◀────│  Store Page  │
│            │     │             │     │ (via QR Scan)│
└────────────┘     └─────────────┘     └──────────────┘
                          │
                          ▼
                   ┌─────────────┐
                   │   Orders    │
                   │   History   │
                   └─────────────┘

Deployment

Vercel (Recommended)

  1. Push to GitHub
  2. Import project in Vercel
  3. Add all environment variables in Vercel project settings
  4. Deploy!

Important: Ensure prisma generate runs during build (already configured in package.json).


License

⚠️ Proprietary License - All Rights Reserved

This project is NOT open source. You may view this code for educational purposes only.

You may NOT:

  • Copy, reproduce, or duplicate any portion of this code
  • Modify or create derivative works
  • Use this code in any other project
  • Distribute or share this code

See LICENSE for full terms.


Author

Built with ❤️ by Yashvanth S


About

Walk into any store, scan the QR, and unlock personalized offers designed just for you.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors