Skip to content

SHIVIKA330/OffShift

Repository files navigation

OffShift β€” Smart Income Shield

"When the storm hits β€” the money hits first."

DEVTrails 2026 React Node.js Supabase Python WhatsApp scikit-learn

An AI-powered parametric insurance platform for India's 12 million gig delivery workers.
Zero claim forms. Zero paperwork. Automatic UPI payout in 120 seconds.

LIVE DEMO Β· Bot Simulator Β· View Demo phase 1 Video Β· View Demo phase 2 Video . App Demo (Try it on phone) . View Presentation


Table of Contents
  1. The Problem β€” 12 Million Workers, Zero Protection
  2. Who We Build For β€” Persona Stories
  3. The Solution β€” Smart Income Shield
  4. How It Works β€” End-to-End Workflow
  5. The Weekly Premium Model
  6. AI/ML Integration β€” Kavach Engine
  7. πŸ›‘οΈ Adversarial Defense & Anti-Spoofing Strategy
  8. Tech Stack
  9. Platform Choice Justification
  10. Database Schema
  11. Phase 2 β€” Registration Process
  12. Phase 2 β€” Insurance Policy Management
  13. Phase 2 β€” Dynamic Premium Calculation
  14. Phase 2 β€” Claims Management & Automated Triggers
  15. Phase 3 β€” Advanced Fraud Detection
  16. Phase 3 β€” Instant Payout System
  17. Phase 3 β€” Intelligent Dashboards
  18. Getting Started
  19. Development Roadmap
  20. Team & Contributors

The Problem β€” 12 Million Workers, Zero Protection

India has 12 million gig delivery workers. Every single one of them is exposed to income loss from events completely beyond their control β€” and not a single parametric income protection product exists for this segment today.

Reality The Number
Gig delivery workers in India 12,000,000
Monthly income lost during monsoon/heatwave 20–30%
Time to resolve a traditional insurance claim 3 weeks
Number of documents required for a standard claim 10 PDFs
Actual payout received for disruption under existing plans β‚Ή500 in 3 months
Parametric income protection products available for gig workers 0

The disruptions we cover:

  • Heavy Rain β€” IMD Red Alert (rainfall > 65mm/hr)
  • Extreme Heat β€” Temperature exceeding 45Β°C
  • Severe Air Pollution β€” AQI > 300 (hazardous to health)
  • App Outages β€” Zomato/Swiggy platform failures on peak nights
  • Curfews & Strikes β€” Government-issued movement restrictions

These aren't edge cases. For a delivery rider in Delhi, these are monthly occurrences.

(back to top)


Who We Build For β€” Persona Stories

Primary Persona: Ravi Kumar

Ravi is 31 years old. Full-time Zomato rider, Okhla Industrial Zone, New Delhi. He's been on the road for 4 years. He wakes up at 7am, logs on by 8, and rarely stops before 8pm. On a good day, he makes β‚Ή800. That money feeds his wife and six-year-old daughter.

When the Delhi monsoon hits β€” and it always hits β€” Ravi parks under a flyover and waits. He can't deliver. He can't earn. The platform doesn't compensate him. He's tried insurance before β€” once. The form asked for documents he didn't have. The claim was rejected after 3 weeks without explanation. He never tried again.

In a typical July, Ravi loses 7-9 working days to rain. That's β‚Ή5,600–₹7,200 gone. With zero safety net.

Detail Ravi's Reality
Employment Type Full-time, self-employed
Platform Zomato, Okhla Zone
Daily Earnings β‚Ή800/day
Daily Hours 10–12 hours
Device Entry-level Android, WhatsApp, PhonePe
Insurance Experience Never successfully claimed
Monthly Income Loss (Monsoon) 20–30% (~β‚Ή4,800–₹7,200)

OffShift for Ravi: He texts "HI" to our WhatsApp number once. 60 seconds later, he has β‚Ή99/week coverage. The next time it rains β€” really rains β€” he gets a WhatsApp notification and β‚Ή1,500 appears in his PhonePe. He didn't fill a single form.

(back to top)


The Solution β€” Smart Income Shield

OffShift is a parametric insurance engine β€” payouts are triggered by objective, external data conditions, never by self-reported claims. Five pillars underpin the entire system:

  1. WhatsApp-First Onboarding β€” 60-second signup. Phone number + UPI ID only. No app download. No documents.
  2. Weekly Micro-Premium Model β€” Sachet-sized pricing (β‚Ή49/β‚Ή99/β‚Ή349) built around gig workers' weekly cash flows.
  3. Kavach AI Engine β€” Our proprietary XGBoost model prices risk to the pincode level, dynamically per rider.
  4. Parametric Auto-Triggers β€” IMD API, AQICN API, Downdetector, GPS cluster inactivity β€” objective data only. No subjective judgment.
  5. 120-Second UPI Auto-Payout β€” Razorpay API sends money directly to the rider's UPI handle. Zero claim forms. Ever.

(back to top)


How It Works β€” End-to-End Workflow

STEP 1: ONBOARDING (60 seconds)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Rider texts "HI" to OffShift WhatsApp
  β†’ Dialogflow CX bot collects: name, pincode, UPI ID
  β†’ Kavach AI scores zone risk for that pincode
  β†’ Personalized weekly premium generated (β‚Ή39–₹79 range)
  β†’ Rider pays via PhonePe UPI deep link
  β†’ Coverage ACTIVE  β€” all within 60 seconds

STEP 2: MONITORING (Every 15 Minutes)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Node.js cron job runs every 15 minutes:
  β†’ Polls IMD Weather API for Red Alerts by pincode
  β†’ Polls AQICN API for pollution levels by zone
  β†’ Monitors Downdetector for Zomato/Swiggy outage spikes
  β†’ Cross-references rider GPS cluster inactivity from Supabase

STEP 3: PARAMETRIC TRIGGER
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Condition met if:
  β†’ Rainfall > 65mm/hr (IMD Red Alert)  OR
  β†’ Temperature > 45Β°C               OR
  β†’ AQI > 300                         OR
  β†’ Downdetector spike + 50 riders GPS-inactive in same 5km zone

  β†’ Trigger event logged to Supabase
  β†’ Kavach Trust Score calculated per rider
  β†’ Payout queue initiated

STEP 4: PAYOUT (Trust-Scored, Tiered)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Trust Score > 0.75  β†’  Razorpay UPI payout in 120 seconds 
Trust Score 0.40-0.75  β†’  1 WhatsApp message β†’ payout in 3 mins
Trust Score < 0.40  β†’  15-min admin hold β†’ auto-release if confirmed

(back to top)


The Weekly Premium Model

Traditional insurance charges β‚Ή2,000–₹5,000/year for plans that exclude gig workers entirely. OffShift charges for what the rider actually needs, when they need it.

Plan Price Duration Max Payout Coverage
Shift Pass β‚Ή49 24 hours β‚Ή500 Heavy Rain, Heatwave
Weekly Pass β‚Ή99 7 days β‚Ή1,500 Weather + App Outages
Monthly Pro β‚Ή349 30 days β‚Ή4,000 All disruptions + Curfews

Dynamic Pricing via Kavach AI

The weekly base premium is adjusted Β±β‚Ή10 based on 4 real-time signals:

  1. Historical rainfall frequency for rider's pincode (last 3 years of IMD data)
  2. Rider shift pattern β€” a morning rider in Okhla vs an evening rider in Gurugram face different risk profiles
  3. Weather forecast lead time β€” if a storm is coming in 6 hours, the premium adjusts upward
  4. Zone-level historical payout ratio β€” pincodes with high historical claims share higher collective risk

This means Ravi in monsoon-prone Okhla pays a contextually accurate premium β€” not a generic flat fee designed for someone in Rajasthan.

(back to top)


AI/ML Integration β€” The Kavach Engine

Kavach is our AI core. It is not a black box β€” it is three distinct, purpose-built models, each solving a specific problem.


Model 1 β€” Kavach Pricing Engine (XGBoost)

Purpose: Generate a personalized, risk-appropriate weekly premium per rider per pincode.

Attribute Detail
Algorithm XGBoost (Gradient Boosted Trees)
Library scikit-learn + xgboost (open source, free)
Input Features pincode, day of week, shift hour, IMD forecast score, historical payout ratio for zone, rider shift pattern baseline, hours until predicted event
Output Dynamic weekly premium in β‚Ή39–₹79 range
Training Data IMD historical rainfall records (public), OpenWeatherMap Historical API, synthetic rider activity data
# Kavach Pricing Engine β€” Simplified Feature Vector
features = {
    'pincode_risk_score': 0.73,       # 3-year historical IMD payout ratio
    'day_of_week': 3,                  # Wednesday
    'shift_hour': 18,                  # 6pm start
    'imd_forecast_score': 0.85,       # High confidence 24hr rain forecast
    'zone_historical_payout_rate': 0.41,  # 41% of events in this zone triggered payout
    'hours_to_event': 6,               # Storm predicted in 6 hours
    'rider_morning_vs_evening': 1,     # Evening rider = higher rain exposure
}
# Model output β†’ premium = β‚Ή67 (base β‚Ή49 + β‚Ή18 risk adjustment for Okhla, July)

Model 2 β€” Outage Validator (Isolation Forest)

Purpose: Distinguish a genuine platform outage from riders simply going offline on purpose.

Attribute Detail
Algorithm Isolation Forest (Anomaly Detection)
Library scikit-learn (free)
Input GPS ping frequency per rider cluster, Downdetector scrape data, time-of-day baseline activity patterns
Output Binary β€” REAL_OUTAGE or FALSE_OFFLINE
Threshold 50+ riders in the same 5km zone showing simultaneous inactivity required

A genuine app outage creates a sharp, correlated inactivity spike across a geographic cluster β€” a statistical anomaly the Isolation Forest excels at detecting. Riders individually going offline creates no such spatial correlation.


Model 3 β€” Fraud Detection & Trust Scoring

Purpose: Score every rider's claim with a Trust Weight from 0.0 to 1.0 using 6 independent behavioral signals.

Signal Data Source What It Catches
GPS vs Cell Tower Match OpenCelliD API (free) Spoofed GPS location
Accelerometer Micro-Pattern Browser DeviceMotion API (free) Spoofer sitting at home vs rider in storm
App Activity Fingerprint Last Zomato/Swiggy session timestamp Was rider actually on-shift before the event?
Historical Shift Pattern Deviation Supabase 4-week baseline Rider claiming in zone they've never worked
Subscription Timing vs Alert Gap Trigger event timestamp Subscribed after Red Alert went public?
Device Fingerprint Uniqueness Browser fingerprint hash Same device used for multiple accounts
# Trust Score Calculation β€” Weighted Average
trust_score = (
    0.25 * gps_cell_tower_match +      # Highest weight β€” hardest to fake
    0.20 * accelerometer_score +
    0.20 * app_activity_score +
    0.15 * shift_pattern_score +
    0.10 * subscription_timing_score +
    0.10 * device_fingerprint_score
)
# Output: 0.0 (certain fraud) to 1.0 (certain genuine)

Payout tiers based on Trust Score:

  • > 0.75 β†’ Instant UPI payout in 120 seconds
  • 0.40 – 0.75 β†’ Single WhatsApp soft-verify β†’ payout in 3 mins
  • < 0.40 β†’ 15-minute hold β†’ auto-release if confirmed independently

(back to top)


Adversarial Defense & Anti-Spoofing Strategy

The Market Crash Scenario: A coordinated syndicate of 500 riders uses GPS-spoofing apps to fake their location inside a Red Alert weather zone β€” while sitting safely at home β€” triggering mass false payouts and draining the liquidity pool.

Simple GPS verification is dead. Our defense goes 6 layers deeper.


The Attack Surface

Our parametric model's biggest vulnerability is location fraud at scale. A genuine stranded rider and a GPS-spoofed rider look identical on a map. They look completely different across 5 behavioral dimensions and 1 mathematical mechanism. Here is exactly how we catch them.


6-Layer Defense Architecture

Layer 1 β€” Cell Tower Triangulation

GPS coordinates can be fabricated in software. Physical cell tower connections cannot be faked without being physically present. Every rider's reported GPS location is cross-referenced against their actual connected cell tower ID, retrieved via the OpenCelliD API (free, global coverage). A rider claiming to be in Okhla but connected to a cell tower in Dwarka is flagged instantly. Cost: β‚Ή0.

Layer 2 β€” Accelerometer Micro-Pattern Analysis

A rider genuinely parked in heavy rain β€” even completely stationary β€” experiences ambient micro-vibrations: passing vehicles, raindrops on the bike, wind. A person sitting on a sofa at home registers a near-zero, flat accelerometer reading. We score physical plausibility using the browser DeviceMotion API (free, no permissions beyond HTTPS). Spoofers at home produce a telltale flat line. Flagged.

Layer 3 β€” Shift History Behavioral Baseline

Kavach AI builds a 4-week activity baseline per rider stored in Supabase: which pincodes they work in, what hours, which days of the week. A rider who has never made a single delivery in Connaught Place suddenly claiming a payout there during a Red Alert is a statistical anomaly with near-zero false positive risk. Flagged instantly.

Layer 4 β€” Temporal Subscription Analysis

Genuine riders subscribe before disruptions happen. Opportunist fraudsters subscribe during active Red Alerts. Any subscription placed within 10 minutes of a publicly announced Red Alert is automatically moved to a Pending Verification queue β€” never instant payout. This alone eliminates reactive fraud with zero tech cost.

Layer 5 β€” Fraud Ring Detection (Isolation Forest)

Coordinated ring fraud leaves unmistakable statistical signatures that individual fraud cannot:

Ring Fraud Signal Normal Behavior Fraud Ring Signature
Subscription timing Spread over days/weeks 50+ subscriptions within 60 minutes of alert
Device fingerprints Unique devices, varied models Multiple accounts sharing same device_id hash
Cell tower overlap Riders spread across zone Unnatural cluster hitting the same 1–2 towers
UPI receiver patterns Diverse payout accounts Multiple accounts routing to same UPI handle
Accelerometer variance High (environmental vibration) Near-zero across entire group

When 3 or more of these signals fire simultaneously across a cluster of riders, our Isolation Forest model raises a ** Syndicate Alert** β€” freezing payouts for that cluster and routing them to the admin dashboard for a 15-minute human review.

Layer 6 β€” Weighted Quorum Trust Voting

This is the mathematical kill-shot for coordinated spoofing.

Our anti-fraud layer already requires 50+ riders in a 5km zone to confirm an outage. We upgrade this: each rider's confirmation carries a Trust Weight (0.0–1.0) based on their behavioral Trust Score. The payout only fires when the weighted quorum crosses a threshold β€” not a raw count.

Scenario A β€” 500 Spoofed Riders:
500 riders Γ— Trust Weight 0.1 = 50 weighted votes
Payout threshold: NOT MET 

Scenario B β€” 50 Genuine Riders:
50 riders Γ— Trust Weight 0.9 = 45 weighted votes  
Payout threshold: MET  β€” payout fires

500 GPS-spoofed accounts cannot collectively generate enough trusted signal to trigger a payout. This is mathematically unsolvable for fraudsters without physical presence.


UX Balance β€” Never Punish Honest Riders

The hardest design problem: a genuine rider in a storm may have weak GPS signal, low accelerometer readings (sheltering under a bridge), or a new account with no behavioral baseline. Here is our 3-Tier Response System β€” not a binary approve/reject:

Tier Trust Score Action Experience
Auto-Approve > 0.75 UPI payout in 120 seconds Zero friction β€” 85%+ of genuine riders
Soft Verify 0.40 – 0.75 1 WhatsApp message: "Reply YES to confirm you're on shift" Payout in 3 minutes after reply
Hold & Review < 0.40 15-minute admin review; auto-release if IMD + cell tower confirm disruption independently WhatsApp update sent; no penalty, no rejection

The Golden Rule: We NEVER deny a claim based on a single signal. Denial requires 3+ independent signals pointing to fraud. When in doubt β€” we pay.

A β‚Ή500 false positive costs us less than destroying the trust of 10 genuine riders forever.

(back to top)


Tech Stack

Every component is free or open-source. Total infrastructure cost: β‚Ή0.

Layer Technology Purpose Cost
Bot Interface WhatsApp Business API (sandbox) + Dialogflow CX Rider onboarding & soft-verify flow Free
Frontend React + Vite + Tailwind CSS Admin analytics dashboard Free
Backend Node.js (TypeScript) + Express.js API server, cron jobs, webhook handlers Free
Hosting Vercel (frontend) + AWS Lambda free tier (backend) Production hosting Free
Database Supabase (PostgreSQL) All persistent data + real-time subscriptions Free tier
Cache Upstash Redis (free tier) Active storm event state, rate limiting Free
ML Models Python + scikit-learn + XGBoost Kavach Pricing Engine, Isolation Forest Open source
Weather Oracle IMD API + OpenWeatherMap free tier Rainfall, temperature triggers Free
AQI Oracle AQICN API (free tier) Pollution level triggers Free
Outage Oracle Downdetector scraper + GPS cluster analysis App outage validation Free
Payments Razorpay test mode + PhonePe UPI sandbox Automated UPI payouts Free (sandbox)
Auth Supabase Auth Rider & admin authentication Free
Cell Tower OpenCelliD API Anti-spoofing triangulation Free
Motion Data Browser DeviceMotion API Accelerometer fraud signal Free (browser)
Fraud Detection scikit-learn Isolation Forest Ring fraud detection Open source

(back to top)


Platform Choice Justification

Why WhatsApp β€” Not a Native App

The single most important product decision we made.

Factor Native App WhatsApp (Our Choice)
Adoption barrier Download required, ~50MB Zero β€” already installed
Device compatibility Requires Android 8+ Works on β‚Ή5,000 phones from 2019
Notification reliability Depends on battery optimization WhatsApp messages always delivered
UPI payment flow Deep link integration needed Native UPI links work inside WhatsApp
Time to first interaction 5–10 minutes (download + signup) 60 seconds
Battery impact Constant background drain None

95% of delivery riders already use WhatsApp daily. Meeting them where they already are β€” not asking them to change their behavior β€” is the only way a β‚Ή49 product gets adopted at scale.

Why a React Web Dashboard for Admin

  • Real-time Supabase subscriptions work natively in browser β€” no iOS/Android deployment required
  • Lightweight, instant deployment to Vercel β€” no app store approval delays
  • Works on any device for the insurance operations team
  • Admin users are not the same constraints as field riders

(back to top)


Database Schema

All data is stored in Supabase (PostgreSQL) with Row-Level Security (RLS) enforced at the database level.

-- Riders (Insured Workers)
CREATE TABLE users (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  name TEXT NOT NULL,
  phone TEXT UNIQUE NOT NULL,
  pincode TEXT NOT NULL,
  upi_id TEXT NOT NULL,
  trust_score FLOAT DEFAULT 0.5,
  device_fingerprint TEXT,
  created_at TIMESTAMPTZ DEFAULT now()
);

-- Insurance Policies / Plans
CREATE TABLE policies (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  name TEXT NOT NULL,                    -- 'Shift Pass', 'Weekly Pass', 'Monthly Pro'
  duration_hours INTEGER NOT NULL,       -- 24, 168, 720
  base_premium_inr INTEGER NOT NULL,     -- 49, 99, 349
  max_payout_inr INTEGER NOT NULL,       -- 500, 1500, 4000
  coverage_types TEXT[] NOT NULL        -- ['rain', 'heat', 'aqi', 'outage', 'curfew']
);

-- Active Coverage Sessions
CREATE TABLE active_sessions (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  user_id UUID REFERENCES users(id),
  policy_id UUID REFERENCES policies(id),
  kavach_premium_inr INTEGER NOT NULL,   -- Dynamic AI-adjusted premium
  start_time TIMESTAMPTZ DEFAULT now(),
  end_time TIMESTAMPTZ NOT NULL,
  status TEXT DEFAULT 'active'           -- 'active', 'expired', 'claimed'
);

-- Trigger Events (Parametric Conditions)
CREATE TABLE trigger_events (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  event_type TEXT NOT NULL,             -- 'rain', 'heat', 'aqi', 'outage', 'curfew'
  pincode TEXT NOT NULL,
  severity_value FLOAT NOT NULL,        -- 74.2mm/hr, 47Β°C, AQI 340, etc.
  triggered_at TIMESTAMPTZ DEFAULT now(),
  source_api TEXT NOT NULL,             -- 'IMD', 'AQICN', 'Downdetector'
  resolved BOOLEAN DEFAULT false
);

-- Claims / Payouts
CREATE TABLE claims (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  user_id UUID REFERENCES users(id),
  session_id UUID REFERENCES active_sessions(id),
  trigger_event_id UUID REFERENCES trigger_events(id),
  amount_inr INTEGER NOT NULL,
  trust_score_at_claim FLOAT NOT NULL,
  tier INTEGER NOT NULL,                -- 1 (auto), 2 (soft verify), 3 (hold)
  status TEXT DEFAULT 'pending',        -- 'pending', 'paid', 'rejected', 'review'
  razorpay_payout_id TEXT,
  created_at TIMESTAMPTZ DEFAULT now(),
  paid_at TIMESTAMPTZ
);

(back to top)


πŸ“‹ Phase 2 β€” Registration Process

Onboarding is WhatsApp-native, zero-download, 60 seconds flat. No app stores. No email. No KYC documents.

Registration Flow

Rider texts "HI" β†’ WhatsApp Business API
  β†’ Dialogflow CX bot initiates conversational flow
  β†’ Collects: Full Name, Pincode, Delivery Platform (Zomato/Swiggy/Both)
  β†’ Collects: UPI ID (validated via Razorpay Contact API)
  β†’ Auto-generates: Device Fingerprint (browser hash)
  β†’ Kavach AI runs initial zone risk scoring
  β†’ Rider profile created in Supabase `users` table
  β†’ Welcome message + plan options sent instantly

Multi-Channel Registration Support

Channel Method Target Segment
WhatsApp Bot Text "HI" to OffShift number Primary β€” 95% of riders
Web PWA offshift.vercel.app/register Admin/insurer onboarding
Voice (Hindi) Whisper-powered voice command on PWA Low-literacy riders

Data Collected at Registration

Field Source Purpose
Name Rider input Identity
Phone WhatsApp number (auto) Auth + notifications
Pincode Rider input Zone risk scoring
UPI ID Rider input (validated) Instant payout destination
Platform Rider selects Outage trigger mapping
Device Fingerprint Auto-generated browser hash Fraud detection signal
Registration Timestamp System Temporal fraud analysis

(back to top)


πŸ›‘οΈ Phase 2 β€” Insurance Policy Management

Policies are sachet-sized, weekly, and rider-controlled. No annual lock-ins. No hidden clauses.

Policy Lifecycle

CREATION β†’ ACTIVE β†’ MONITORING β†’ TRIGGERED β†’ CLAIMED β†’ EXPIRED/RENEWED

Available Plans

Plan Duration Base Premium Max Payout Coverage Scope
🟒 Shift Pass 24 hours β‚Ή49 β‚Ή500 Heavy Rain + Heatwave
πŸ”΅ Weekly Pass 7 days β‚Ή99 β‚Ή1,500 Weather + App Outages
🟣 Monthly Pro 30 days β‚Ή349 β‚Ή4,000 All disruptions + Curfews + Strikes

Policy Management Features

  • Instant Activation: Policy goes live the moment UPI payment is confirmed via Razorpay webhook
  • Auto-Renewal via WhatsApp: Bot sends renewal reminder 6 hours before expiry with one-tap UPI link
  • Plan Upgrades: Rider can upgrade mid-week (e.g., Shift Pass β†’ Weekly Pass) β€” prorated billing
  • Coverage History: Full history of all policies, triggers, and payouts accessible via WhatsApp command "MY HISTORY"
  • Family/Pod Coverage: Riders can add dependents or form "Resilience Pods" of 5–10 riders for group discounts

Policy State Machine

[CREATED] ──payment confirmed──→ [ACTIVE]
[ACTIVE]  ──duration expires───→ [EXPIRED] ──renewal──→ [ACTIVE]
[ACTIVE]  ──trigger event──────→ [TRIGGERED] ──payout──→ [CLAIMED]
[ACTIVE]  ──rider cancels──────→ [CANCELLED]

(back to top)


πŸ’° Phase 2 β€” Dynamic Premium Calculation

Every rider gets a personalized premium β€” not a flat fee. Kavach AI adjusts Β±β‚Ή10–₹30 from the base price using hyper-local risk factors.

AI Integration: Dynamic Pricing Model

The core innovation: We use Machine Learning to adjust the Weekly premium based on hyper-local risk factors. This is NOT a lookup table β€” it's a trained gradient-boosted model that learns from historical weather patterns, rider behavior, and zone-specific claims data.

ML Model Architecture: Kavach Pricing Engine

Attribute Detail
Algorithm XGBoost (Gradient Boosted Decision Trees)
Library scikit-learn + xgboost (Python), inference also in JS via ONNX
Input Features 10 hyper-local risk signals (see below)
Output Personalized weekly premium in β‚Ή39–₹149 range
Training Data IMD historical rainfall (3 years, public), OpenWeatherMap API, AQICN historical, synthetic rider profiles
Retraining Schedule Weekly, using latest 4 weeks of claims + weather data
Inference Time <50ms per rider

Feature Engineering β€” 10 Hyper-Local Risk Signals

# Feature vector fed to XGBoost model for each rider
features = {
    'pincode_risk_score': 0.73,          # 3-year IMD historical payout ratio for pincode
    'day_of_week': 3,                     # Wednesday (mid-week = lower risk)
    'shift_hour': 18,                     # 6 PM start = evening monsoon window
    'imd_forecast_score': 0.85,          # High-confidence 24hr rain prediction
    'zone_payout_history': 0.41,         # 41% historical claim rate in this zone
    'hours_to_predicted_event': 6,       # Storm arriving in 6 hours
    'rider_shift_pattern': 1,            # Evening rider = higher rain exposure
    'aqi_7day_trend': 285,               # Rising AQI approaching hazardous
    'waterlogging_zone_flag': True,      # Pincode in known waterlogging area
    'rider_claim_frequency': 0.12,       # Rider's personal claim rate (low = discount)
}
# Output: premium = β‚Ή67 (base β‚Ή49 + β‚Ή18 Okhla monsoon risk adjustment)

Model Training Pipeline

[IMD Historical Data] ──┐
[OpenWeatherMap API]  ───
[AQICN Historical]    ──┼──→ [Feature Extraction] ──→ [XGBoost Training]
[Rider Activity Logs] ───                                    β”‚
[Claims History]      β”€β”€β”˜                                    β–Ό
                                                    [Trained Model .pkl]
                                                            β”‚
                                                    [ONNX Export for JS]
                                                            β”‚
                                                    [Real-Time Inference]
                                                    (POST /api/calculate-premium)

Dynamic Pricing Rules β€” How ML Adjusts Your Premium

Risk Factor Effect on Premium Data Source Example
Pincode in historically safe zone (no waterlogging) βˆ’β‚Ή2 to βˆ’β‚Ή5/week IMD flood maps Rider in Vasant Kunj (no flooding history) saves β‚Ή2/week
Storm predicted within 6 hours +β‚Ή8 to +β‚Ή15 OpenWeatherMap forecast Cyclone approaching = premium adjusts upward
Rider has zero claims in last 4 weeks βˆ’β‚Ή5 loyalty discount Supabase history Long-term riders rewarded for low claims
AQI trending above 300 for 3+ days +β‚Ή10 pollution surcharge AQICN API Delhi winter smog = higher AQI risk
Resilience Pod membership (5+ riders) βˆ’25% group discount Pod smart contract Social incentive for group coverage
Predictive weather modelling shows clear week Extended coverage hours at same price ML forecast Clear forecast = 168hrs coverage for price of 120hrs
Rider operates in known waterlogging zone +β‚Ή3 to +β‚Ή8/week IMD + municipal flood data Okhla Industrial Area = higher water risk
Weekend shift (Sat/Sun peak hours) +β‚Ή2 surge adjustment Historical delivery data Weekend rain during peak = maximum disruption

Real-World Pricing Examples

Example 1 β€” Ravi (Okhla, Evening Rider, Monsoon Season):
  Base Weekly Pass:         β‚Ή99
  + Okhla waterlogging:     +β‚Ή5 (known flood zone)
  + Evening shift risk:     +β‚Ή3 (6PM–10PM monsoon window)
  + IMD storm in 6 hours:   +β‚Ή12 (high forecast confidence)
  βˆ’ Zero claims (4 weeks):  βˆ’β‚Ή5 (loyalty discount)
  ─────────────────────────────
  FINAL PREMIUM:            β‚Ή114/week
  Coverage Hours:           168 hours (standard)

Example 2 β€” Priya (Vasant Kunj, Morning Rider, Clear Week):
  Base Weekly Pass:         β‚Ή99
  βˆ’ No waterlogging zone:   βˆ’β‚Ή2 (historically safe)
  βˆ’ Morning shift (low):    βˆ’β‚Ή0 (no adjustment)
  βˆ’ Clear week forecast:    βˆ’β‚Ή0 (but gets +24hr bonus coverage)
  βˆ’ Zero claims (8 weeks):  βˆ’β‚Ή5 (loyalty discount)
  ─────────────────────────────
  FINAL PREMIUM:            β‚Ή92/week
  Coverage Hours:           192 hours (+24hr bonus for clear forecast)

Example 3 β€” Amit (Gurugram, AQI Season):
  Base Monthly Pro:         β‚Ή349
  + AQI trending 320:       +β‚Ή10 (pollution surcharge)
  + 3-day sustained hazard: +β‚Ή5 (extended exposure)
  βˆ’ Pod member (8 riders):  βˆ’β‚Ή87 (25% group discount)
  ─────────────────────────────
  FINAL PREMIUM:            β‚Ή277/month

Premium Calculation API

POST /api/calculate-premium
Body: { "rider_id": "uuid", "plan_type": "weekly", "pincode": "110020" }
Response: {
  "base_premium": 99,
  "risk_adjustments": [
    { "factor": "waterlogging_zone", "adjustment": +5, "source": "IMD flood map" },
    { "factor": "evening_shift", "adjustment": +3, "source": "rider shift pattern" },
    { "factor": "storm_forecast_6hr", "adjustment": +12, "source": "OpenWeatherMap" },
    { "factor": "loyalty_4_weeks", "adjustment": -5, "source": "claims history" }
  ],
  "total_risk_adjustment": +15,
  "final_premium": 114,
  "coverage_hours": 168,
  "bonus_hours": 0,
  "model_confidence": 0.87,
  "risk_factors": ["waterlogging_zone", "evening_shift", "forecast_rain_6hr"]
}

(back to top)


⚑ Phase 2 β€” Claims Management & Automated Triggers

Zero-touch. Zero-form. 120 seconds from trigger to UPI deposit.

The entire claims process is fully automated β€” riders never fill a form, upload a document, or speak to an agent.

5 Automated Parametric Triggers (Public/Mock APIs)

We monitor 5 independent data sources via cron jobs running every 15 minutes. Each trigger uses a public API (or mock equivalent for demo) to objectively identify disruptions that cause income loss:

# Trigger Threshold Public API Endpoint Verification Method
1 🌧️ Heavy Rainfall >65mm/hr (IMD Red Alert) IMD Weather API + OpenWeatherMap api.openweathermap.org/data/2.5/weather?q={pincode} Cross-verified: IMD confirms OWM reading
2 πŸ”₯ Extreme Heat >45Β°C sustained 3+ hrs OpenWeatherMap API api.openweathermap.org/data/2.5/forecast?q={pincode} 3-hour rolling average check
3 πŸ’¨ Hazardous AQI AQI >300 (Hazardous) AQICN API (aqicn.org) api.waqi.info/feed/{city}/?token={key} 3-hour sustained reading required
4 πŸ“± App Outage Spike + 50 riders GPS-inactive Downdetector Scraper + GPS cluster Custom scraper on downdetector.in/status/zomato Isolation Forest anomaly detection
5 🚫 Curfew/Strike Govt notification + news NewsAPI newsapi.org/v2/everything?q=curfew+{city} Admin dashboard manual confirmation

Trigger API Integration Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    TRIGGER MONITOR (Node.js Cron)                   β”‚
β”‚                    Runs every 15 minutes                            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                 β”‚
β”‚  β”‚ IMD Weather  β”‚  β”‚ OpenWeather β”‚  β”‚  AQICN API  β”‚                 β”‚
β”‚  β”‚   API        β”‚  β”‚  Map API    β”‚  β”‚             β”‚                 β”‚
β”‚  β”‚ (Rainfall)   β”‚  β”‚ (Temp)      β”‚  β”‚ (AQI)       β”‚                 β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜                 β”‚
β”‚         β”‚                 β”‚                 β”‚                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”                β”‚
β”‚  β”‚           THRESHOLD COMPARATOR                    β”‚               β”‚
β”‚  β”‚  Rain >65mm? β”‚ Temp >45Β°C? β”‚ AQI >300?           β”‚               β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β”‚                         β”‚ YES                                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”‚
β”‚  β”‚           TRIGGER EVENT LOGGER                     β”‚              β”‚
β”‚  β”‚  β†’ Log event type, pincode, severity, timestamp    β”‚              β”‚
β”‚  β”‚  β†’ Query active riders in affected zone            β”‚              β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β”‚                         β”‚                                            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”‚
β”‚  β”‚           KAVACH TRUST SCORER                      β”‚              β”‚
β”‚  β”‚  β†’ 6-signal behavioral analysis per rider          β”‚              β”‚
β”‚  β”‚  β†’ Output: Trust Score 0.0 – 1.0                   β”‚              β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β”‚                         β”‚                                            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”‚
β”‚  β”‚           TIERED PAYOUT ENGINE                     β”‚              β”‚
β”‚  β”‚  Score >0.75  β†’ Razorpay UPI instant (120 sec)     β”‚              β”‚
β”‚  β”‚  Score 0.40–0.75 β†’ WhatsApp soft-verify (3 min)    β”‚              β”‚
β”‚  β”‚  Score <0.40  β†’ Admin hold + auto-release (15 min) β”‚              β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Mock API Response Formats

Each oracle returns standardized data for the trigger monitor to evaluate:

// Weather Oracle Response (IMD + OpenWeatherMap)
{
  "pincode": "110020",
  "rainfall_mm_hr": 74.2,
  "temperature_c": 32,
  "alert_level": "RED",
  "source": "IMD",
  "cross_verified": true,
  "timestamp": "2026-07-15T16:00:00+05:30"
}

// AQI Oracle Response (AQICN)
{
  "pincode": "110020",
  "aqi": 342,
  "dominant_pollutant": "PM2.5",
  "sustained_hours": 4,
  "alert_level": "HAZARDOUS",
  "source": "AQICN",
  "timestamp": "2026-11-10T08:00:00+05:30"
}

// Outage Oracle Response (Downdetector + GPS)
{
  "platform": "Zomato",
  "outage_score": 87,
  "reports_last_30min": 1240,
  "riders_inactive_5km_cluster": 63,
  "anomaly_detected": true,
  "source": "Downdetector",
  "timestamp": "2026-08-20T20:30:00+05:30"
}

Disruptions That Cause Income Loss β€” Trigger Mapping

Disruption How It Causes Income Loss How We Detect It Avg. Daily Loss
Monsoon Flooding Roads impassable, no deliveries for 6–12 hours IMD Red Alert >65mm/hr β‚Ή400–₹800
Extreme Heatwave Govt advisory to stay indoors, platforms reduce orders Temp >45Β°C for 3+ hrs β‚Ή300–₹600
Toxic Air Quality Health risk, reduced outdoor activity, fewer orders AQI >300 sustained β‚Ή200–₹500
App Platform Crash Cannot receive/complete orders despite good weather Downdetector spike + GPS cluster β‚Ή500–₹1,000
Curfew/Bandh/Strike Movement restrictions, complete shutdown News API + admin flag β‚Ή800 (full day)

Seamless Zero-Touch Claim UX β€” The Best Experience for Riders

Design Philosophy: The best claim process is one the rider doesn't even know happened. Money appears in their UPI before they realize they've lost income.

Why Zero-Touch Beats Traditional Claims

Step Traditional Insurance OffShift (Zero-Touch)
Claim initiation Rider fills 3-page form Automatic β€” system detects event
Evidence submission Upload 5+ documents, photos None β€” API data is the evidence
Human review Agent reviews in 3–7 business days AI Trust Score in <1 second
Approval Email after weeks of back-and-forth Instant for 85%+ of riders
Payout Bank transfer in 15–30 days UPI in 120 seconds
Notifications "Your claim is under review" emails WhatsApp: "β‚Ή500 deposited. Stay safe."

The Rider Journey During a Claim (Ravi's Story)

πŸ• 3:45 PM β€” Ravi is delivering orders in Okhla, Delhi
🌧️ 4:00 PM β€” Heavy rain starts, roads flooding rapidly
πŸ“‘ 4:00 PM β€” OffShift cron detects IMD Red Alert for pincode 110020
            (rainfall: 74.2mm/hr > 65mm threshold)
πŸ” 4:00 PM β€” System queries: "Which riders have active coverage in 110020?"
            β†’ Ravi has Weekly Pass (active until March 25)
🧠 4:00 PM β€” Kavach Trust Score calculated for Ravi:
            GPS-Cell Tower Match:  0.95 (genuine location)
            Accelerometer:        0.88 (outdoor vibration detected)
            Shift History:        0.92 (regular Okhla rider)
            Subscription Timing:  0.90 (subscribed 3 days ago)
            Device Fingerprint:   1.00 (unique device)
            App Activity:         0.85 (last Zomato delivery 12 min ago)
            ─────────────────────────────────
            TRUST SCORE:          0.91 β†’ TIER 1 (Auto-Approve)
πŸ’° 4:01 PM β€” Razorpay UPI payout initiated: β‚Ή1,500 β†’ rajesh@ybl
πŸ“± 4:02 PM β€” WhatsApp message delivered:
            "Hi Ravi πŸ‘‹
             πŸ›‘οΈ Your OffShift Weekly Shield just activated.

             β‚Ή1,500 deposited to rajesh@ybl
             Reason: IMD Red Alert β€” Heavy Rain in Okhla (74.2mm/hr)
             Ref: TXN_RZP_20260715_001

             Stay safe. Your income is protected. πŸ’ͺ"

⏱️ TOTAL TIME: 120 seconds
πŸ“ FORMS FILLED: 0
πŸ“ž CALLS MADE: 0
πŸ“§ EMAILS SENT: 0

(back to top)


πŸ” Phase 3 β€” Advanced Fraud Detection

Beyond the 6-layer defense documented above, Phase 3 deploys delivery-specific fraud catching mechanisms. We don't just track where they are; we track how they work.

Delivery-Specific Behavioral Analysis

We analyze the temporal relationship between delivery platform signals and claim triggers. A fraudster sitting at home lacks the "Order Lifecycle" telemetry that a genuine rider possesses.

Signal Genuine Rider Bad Actor (Spoofer)
GPS Jitter Natural drift (3-5m) due to weather/buildings Unnaturally static or "perfect" paths
Order Proximity Last delivery drop-off within 2km of claim zone Last delivery in a completely different city/zone
App Telemetry Active "Online" status on Zomato/Swiggy "Offline" status or no recent order pings
Motion Profile Accelerometer shows bike vibration/walking Near-zero movement (sitting on a couch)

Catching Fake Weather Claims via Historical Cross-Validation

Every claim is cross-referenced against three independent weather oracles. If two oracles (e.g., IMD and OpenWeatherMap) report "Dry" while the rider claims "Heavy Rain," the claim is flagged.

# Advanced Historical Cross-Validation Logic
def validate_weather_claim(rider_pincode, event_timestamp):
    # 1. Check Historical IMD Gridded Data (Primary Oracle)
    imd_rainfall = fetch_imd_pincode_data(rider_pincode, event_timestamp)
    
    # 2. Cross-Ref with OpenWeatherMap Historical API (Secondary Oracle)
    owm_rainfall = fetch_owm_historical(rider_pincode, event_timestamp)
    
    # 3. Analyze Cluster Behavior (The Social Oracle)
    # If 50 riders in the same 2km radius are NOT claiming, but 1 is...
    active_claims_in_vicinity = count_active_claims(rider_pincode, radius="2km")
    
    if (imd_rainfall < THRESHOLD) and (owm_rainfall < THRESHOLD):
        if active_claims_in_vicinity < QUORUM_MIN:
            return "FLAG_FOR_REVIEW" # High probability of fraud
            
    return "AUTO_APPROVE"

Fraud Ring Detection (Isolation Forest)

We use Isolation Forest (Anomaly Detection) to identify coordinated fraud rings. Coordinated groups leave a "Cluster Signature" that individual users do not.

Ring Signal Normal Population Fraud Ring Signature
Subscription Timing Spread over days/weeks 50+ subscriptions within 10 mins of an alert
Device Fingerprints 1 Device : 1 User 5+ Users sharing the same device_id hash
Cell Tower Overlap Riders spread across the zone 100% overlap on a single tower (impossible in storms)
UPI Routing Each rider has a unique UPI Multiple rider accounts routing to 1-2 UPI handles

(back to top)


πŸ’Έ Phase 3 β€” Instant Payout System (Simulated)

We demonstrate the "Moment of Truth" β€” when the payout hits the worker's account in real-time. For the demo, we integrate with Mock Payment Gateways to simulate the entire fund-flow.

Simulated Fund-Flow (Razorpay / Stripe / UPI)

Gateway Mode Purpose in Demo
Razorpay Payouts Test Mode Simulates bulk UPI payouts to 500+ riders simultaneously.
Stripe Sandbox Test API Demonstrates international scalability for gig workers globally.
UPI Simulator Mock API Visualizes the "Notification Pop-up" on a simulated worker's phone.

The "Moment of Truth" Workflow

  1. Trigger Confirmation: IMD API confirms Red Alert status.
  2. Fund Disbursement: Backend calls razorpay.payouts.create() using rzp_test keys.
  3. Instant Credit: Funds are moved from the OffShift Liquidity Pool to the Rider's UPI VPA.
  4. Verification: Webhook confirms success; Rider receives an automated WhatsApp receipt.
// Razorpay Instant Payout Simulation (Node.js)
const payout = await razorpay.payouts.create({
  account_number: "781022331100", // OffShift Escrow
  fund_account_id: rider.fund_id,
  amount: 150000, // β‚Ή1,500.00
  currency: "INR",
  mode: "UPI",
  purpose: "payout",
  reference_id: `CLAIM_${claim.id}`,
});

(back to top)


πŸ“Š Phase 3 β€” Intelligent Dashboards

We provide two distinct views: one for the frontline worker (Shield Status) and one for the insurer (Risk & Liquidity).

πŸ§‘β€πŸš€ For Workers: The "Shield" View

A mobile-first, haptic dashboard built for the road.

  • Earnings Protected: Total lifetime payouts received (The "Peace of Mind" metric).
  • Active Weekly Coverage: A real-time countdown of seconds remaining on the current "Rain Shield."
  • Claim History: One-tap access to every past disruption event and its payout status.
  • Trust Score: A gamified "Kavach Score" β€” workers with high scores get faster payouts and lower premiums.

🏒 For Insurers: The "Nebula" Admin Console

A dark-mode, high-performance dashboard for risk managers.

  • Loss Ratios: Real-time tracking of premiums collected vs. claims paid (The "Solvency" metric).
  • Syndicate Alerts: Instant flags when the Isolation Forest detects coordinated fraud clusters.
  • Predictive Analytics: "The Week Ahead" β€” predicting next week's likely weather/disruption claims based on LSTM models.
  • Zone Heatmaps: Visualizing rainfall patterns across Delhi/NCR in real-time, mapped against rider density.

Next-Week Disruptive Claim Prediction (ML)

# Predictive Analytics for Insurer Dashboard
def predict_next_week_claims(pincode):
    features = [historical_payouts, forecast_intensity, active_policies]
    # Predicts likely liquidity drain for the coming 7 days
    predicted_payout_volume = model.predict(features) 
    
    return {
        "pincode": pincode,
        "likely_disruption": "Heavy Rain (Tuesday)",
        "projected_payout": "β‚Ή4,50,000",
        "liquidity_risk": "MEDIUM"
    }

(back to top)


Getting Started

Prerequisites

  • Node.js v18+ and npm
  • Python 3.9+ (for ML models)
  • Supabase account (free)
  • WhatsApp Business API sandbox (Twilio or Meta sandbox)
npm install npm@latest -g

Installation

  1. Clone the repository

    git clone https://github.com/SHIVIKA330/OffShift.git
    cd OffShift
  2. Install Node.js dependencies

    npm install
  3. Install Python ML dependencies

    pip install scikit-learn xgboost pandas numpy
  4. Configure environment variables β€” create a .env file:

    # Supabase
    VITE_SUPABASE_URL='YOUR_SUPABASE_PROJECT_URL'
    VITE_SUPABASE_ANON_KEY='YOUR_SUPABASE_ANON_KEY'
    
    # Razorpay UPI Payouts
    RAZORPAY_KEY_ID='YOUR_RAZORPAY_KEY'
    RAZORPAY_KEY_SECRET='YOUR_RAZORPAY_SECRET'
    
    # WhatsApp / Twilio
    TWILIO_ACCOUNT_SID='YOUR_TWILIO_SID'
    TWILIO_AUTH_TOKEN='YOUR_TWILIO_TOKEN'
    TWILIO_WHATSAPP_FROM='whatsapp:+14155238886'
    
    # Weather & AQI Oracles
    OPENWEATHER_API_KEY='YOUR_OWM_KEY'
    AQICN_API_KEY='YOUR_AQICN_KEY'
    OPENCELLID_API_KEY='YOUR_OPENCELLID_KEY'
  5. Start the development server

    npm run dev

(back to top)


Development Roadmap

Phase 1 β€” Ideation & Foundation (March 4–20, COMPLETE)

  • README & architecture fully documented
  • Supabase DB schemas designed (users, policies, sessions, claims, trigger_events)
  • WhatsApp onboarding bot flow wireframed (index.html prototype)
  • Adversarial defense & anti-spoofing strategy documented in full
  • Tech stack selected β€” all free/open-source
  • Kavach AI architecture designed (XGBoost + Isolation Forest)

πŸ”§ Phase 2 β€” Automation & Protection (March 21 – April 4)

Theme: "Protect Your Worker"

  • Registration Process: WhatsApp sandbox bot live β€” Dialogflow CX + Twilio integration
  • Registration Process: Multi-channel onboarding (WhatsApp + Web PWA + Voice Hindi)
  • Insurance Policy Management: Policy lifecycle engine (create β†’ active β†’ triggered β†’ claimed β†’ expired)
  • Insurance Policy Management: Plan selection, instant activation via UPI, auto-renewal reminders
  • Dynamic Premium Calculation: Kavach XGBoost model trained on IMD historical data + synthetic riders
  • Dynamic Premium Calculation: Hyper-local risk pricing (pincode-level, Β±β‚Ή10–₹30 adjustment)
  • Dynamic Premium Calculation: Zone waterlogging discount (β‚Ή2 less/week for safe zones)
  • Dynamic Premium Calculation: Extended coverage hours via predictive weather modelling
  • Claims Management: Node.js cron job polling IMD + AQICN + Downdetector every 15 minutes
  • Claims Management: 5 automated parametric triggers (Rain, Heat, AQI, App Outage, Curfew)
  • Claims Management: Trust-scored tiered payout (auto/soft-verify/hold)
  • Claims Management: Razorpay UPI test mode β€” automated 120-second payout flow
  • Claims Management: Zero-touch WhatsApp claim notification + receipt
  • 2-Minute Demo Video: Screen recording of registration β†’ coverage β†’ trigger β†’ payout flow

πŸš€ Phase 3 β€” Scale & Optimize (April 5–17)

Theme: "Perfect for Your Worker"

  • Advanced Fraud Detection: GPS spoofing detection (cell tower + accelerometer + jitter analysis)
  • Advanced Fraud Detection: Fake weather claims caught via historical cross-validation
  • Advanced Fraud Detection: Isolation Forest fraud ring detection deployed
  • Advanced Fraud Detection: 6-signal Trust Score engine live
  • Advanced Fraud Detection: Weighted quorum anti-spoofing (500 spoofers can't trigger payout)
  • Instant Payout System: Razorpay test mode full integration with webhook confirmations
  • Instant Payout System: PhonePe sandbox for premium UPI collection
  • Instant Payout System: Simulated disruption β†’ automated AI claim approval β†’ instant payout demo
  • Worker Dashboard: Earnings protected, active weekly coverage, claim history, trust score
  • Admin Dashboard (Nebula): Loss ratios, predictive analytics, weather heatmap, fraud alerts
  • Admin Dashboard (Nebula): Next-week claim prediction engine with ML forecasting
  • Admin Dashboard (Nebula): Revenue analytics, payout queue, Syndicate Alert management
  • 5-Minute Demo Video: Full walkthrough with simulated rainstorm β†’ AI claim β†’ payout
  • Final Pitch Deck: PDF covering persona, AI/fraud architecture, Weekly pricing viability

(back to top)


Team & Contributors

Built with purpose and late nights by the OffShift team for Guidewire DEVTrails 2026.

Shivika
Shivika
@SHIVIKA330
Tejika
Tejika
@TejikaSingh02
Nomita
Nomita
@nomita1303
Yuvika
Yuvika
@yuvi194
Love
Love
@love123-code

OffShift Team β€” DEVTrails 2026 β€” shivikaj47@gmail.com

Project (live site): https://offshift-9iok.onrender.com/


Every other platform asks WHERE you are. OffShift asks WHO you are, HOW you move, WHEN you subscribed, and WHETHER your behavior matches 4 weeks of your own history.

GPS tells us your location. Kavach tells us your truth.

Built for the riders who keep cities moving β€” even when the sky falls.

(back to top)

About

OffShift: Parametric insurance for gig workers. Uses Downdetector & live rider pings to verify food delivery app outages and instantly pays via UPI. No claim forms required.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages