Round-Robin Coupon Distribution System

Documentation

Key Features

  • Sequential coupon distribution with no repetition
  • Guest user access without login requirements
  • IP and cookie-based abuse prevention
  • Secure admin panel for coupon management
  • Comprehensive tracking of claimed coupons
  • Dynamic enabling/disabling of coupons

System Architecture

Frontend Client

User coupon claiming

Backend Server

Distribution logic & API

Database

Coupon & user tracking

Setup Instructions

Prerequisites

  • Node.js (v14.0.0 or higher)
  • Next.js (v15)
  • MongoDB (v4.4 or higher)
  • npm or yarn package manager

Installation Steps

  1. Clone the repository

    https://github.com/SwastikIIIT/Round-Robin-Coupon-Distribution-System.git
  2. Install dependencies

    cd Round-Robin-Coupon-Distribution-System
    npm install
  3. Configure environment variables

    MONGODB_URI=mongodb+srv://whirphool123:Vasuthegreat@cluster0.yitht.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0
    AUTH_SECRET=secrethello
  4. Start the application

    npm run start

Security Features

FeatureDescription
IP-Based TrackingPrevents multiple claims from the same IP address within the configured cooldown period (default: 90 seconds).
Cookie-Based TrackingUses browser cookies to identify repeat visitors, even if they change IP addresses.