Skip to content

AyushButola/SRS--Secure-Ration-System

Repository files navigation

🛒 Secure Ration System (SRS)

A Transparent, Blockchain-Enabled, Offline-First Ration Distribution Platform

🚀 Live Deployments

Interface Status Link
🛍️ Shop Web Portal 🟢 Live srs-secure-ration-system-shop.vercel.app
👨‍💼 Admin Dashboard 🟢 Live srs-secure-ration-system-admin.vercel.app
📱 Mobile App 🟡 Beta Download APK (Expo)
⚙️ Backend API 🟢 Live srs-secure-ration-system.onrender.com

✨ What's New? (Recent Updates)

👨‍💼 Admin Dashboard

  • Live Ledger Chain: Visual representation of the blockchain-inspired transaction ledger.
  • Real-time Fraud Alerts: Instant notifications for potential conflicts (e.g., double spending, hash mismatches).
  • Beneficiary Management: Search, viewing, and manual OTP/QR trigger for beneficiaries.
  • System Stats: Real-time overview of total beneficiaries, active shops, and transaction volume.

🛍️ Shop Web Portal

  • Secure Authentication: Robust Shop ID & Password login mechanism.
  • Multi-Language Support: Full support for English and Hindi interfaces.
  • Offline-Ready: Designed to queue transactions locally when internet is unavailable.

🎨 UI/UX Enhancements

  • Modern, clean interface using Tailwind CSS.
  • Lucide React Icons for intuitive visual cues.
  • Responsive design for tablet and desktop usage.

📌 Project Overview

Smart Ration Ledger (SRS) is a secure and transparent ration distribution system designed to eliminate fraud, duplication, and data tampering in public distribution systems.

The system works even in low or no internet connectivity areas and synchronizes safely once the network is restored. It uses a hash-chained transaction ledger to ensure data integrity and auditability.


❓ Problem Statement

Traditional ration distribution systems face several challenges:

  • ❌ Duplicate or fake ration claims
  • ❌ Offline data manipulation
  • ❌ No tamper-proof transaction history
  • ❌ Poor audit and monitoring capabilities
  • ❌ Dependency on continuous internet connectivity

This leads to leakage, corruption, and lack of trust.


✅ Solution Summary

Smart Ration Ledger solves these problems by introducing:

  • 🔗 Cryptographic hash chaining (blockchain-inspired)
  • 📴 Offline-first transaction handling
  • 🚨 Automated fraud & duplicate detection
  • 📊 Centralized audit trail
  • �‍💼 Admin-controlled conflict resolution

🌟 Key Features

  • Hash-Chained Ledger: Every transaction links to the previous one, preventing tampering.
  • Offline Mode Support: Shops can distribute rations even without internet.
  • Automatic Sync & Conflict Detection: Offline transactions are synced safely when connectivity returns.
  • Fraud Prevention: Detects double spending, duplicates, and data tampering.
  • Audit Trail: Immutable logs for every transaction and sync event.
  • Admin Dashboard: Central monitoring and manual resolution when needed.

🧱 System Architecture

System Architecture - DFD

User Flow

User Flow

Shop Flow

Shop Flow

The architecture consists of:

  1. User Mobile: QR-based identification
  2. Shop Device: Online/Offline capable POS/App
  3. Central Server: Sync and validation
  4. Hash Ledger Database: Immutable record keeping
  5. Admin Console: Monitoring and management
  6. Backup & Offline Storage: Ensuring data availability

�️ Database Design

The system uses a relational database combined with an append-only transaction ledger.

Core Tables

  • beneficiaries
  • ration_shops
  • ration_items
  • entitlements
  • transactions
  • ledger_state
  • conflicts
  • sync_logs

ER Diagram


🔄 Transaction Flow

Online Transaction

  1. User scans QR at shop.
  2. Beneficiary details fetched from server.
  3. Quota validated.
  4. Transaction hash generated.
  5. Transaction committed to ledger.
  6. Receipt generated.

Offline Transaction

  1. Transaction stored locally.
  2. Hash generated using last known state.
  3. Transaction queued.
  4. Synced when network is restored.
  5. Conflicts handled centrally.

Transaction Flow Diagram


🔐 Security & Hash Chain Logic

Each transaction contains:

  • Previous hash
  • Current transaction hash

Any modification breaks the chain. Invalid hashes are quarantined automatically.

Hash Chain Diagram Placeholder


⚠️ Conflict Handling

The system detects:

  • Duplicate transactions
  • Double spending
  • Hash mismatches
  • Offline sync conflicts

Conflicts are:

  • Automatically flagged
  • Logged in audit trail
  • Resolved by admin when required

Conflict Resolution Diagram


👨‍💼 Admin Dashboard

Admin can:

  • Monitor system health
  • Review flagged transactions
  • Block users or shops
  • View audit logs
  • Generate reports

Admin Workflow Diagram


🛠️ Tech Stack

Layer Technology
Frontend React, Tailwind CSS, Lucide React
Shop Device Web / Android App
Backend Node.js / Express
Database PostgreSQL
Hashing SHA-256 (bcryptjs)
APIs REST
Deployment Vercel (Frontend), Render (Backend)

📈 Scalability & Reliability

  • Prioritize fast writes: Append-only ledger
  • Offline batching: Reduces server load
  • Stateless backend APIs: Easy scaling
  • Backup and recovery: Fully supported

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors