No claim forms. No human adjusters. No waiting. GIC monitors weather, peer activity, and fraud signals in real-time — and pays out to UPI in under 4 minutes when a disruption is confirmed.
- What is GIC?
- Screenshots
- Architecture Overview
- The GIC AI Engine
- The Traffic System
- External APIs
- API Reference
- Admin Dashboard
- Database Models
- Getting Started
- Environment Variables
- What Sets GIC Apart
- Pitch
- Collaborators
GIC (Gig Income Coverage) is a parametric income insurance platform built specifically for food delivery workers in Chennai. Instead of the traditional insurance model — file a claim, wait for an adjuster, maybe get paid weeks later — GIC works on a trigger-based, fully automated pipeline:
- Rain crosses your zone's threshold (≥15 mm/hr by default)
- Your order activity drops >1.5σ below your personal baseline
- 80+ zone peers on the same platform confirm the disruption
- AI-3 runs a fraud check in milliseconds
- ₹100–500 is transferred to your UPI in ~4 minutes
Coverage costs between ₹29 and ₹89/week, computed fresh each week by a neural network that weighs zone flood risk, your streak, seasonal patterns, and a 7-day rainfall forecast.
Add screenshot here: the full admin overview panel showing active policies, weekly GPW, BCR by zone, fraud flags, and payout stats
Add screenshot here: the AI model info card showing all 5 neural net models, their feature counts, training approach, and live status
docs/screenshots/admin-model-info.png

Add screenshot here: the in-app Grok-3-mini chat showing a worker asking about their premium and receiving a contextual breakdown
┌─────────────────────────────────────────────────┐
│ index.html │
│ Worker App + Admin Dashboard │
└──────────────┬──────────────────────────────────┘
│ REST API
┌──────────────▼──────────────────────────────────┐
│ server.js (Express v4) │
│ │
│ ┌──────────┐ ┌──────────┐ ┌────────────────┐ │
│ │ Auth │ │ Worker │ │ Claims │ │
│ │ Routes │ │ Routes │ │ + Trigger │ │
│ └──────────┘ └──────────┘ └────────────────┘ │
│ ┌──────────┐ ┌──────────┐ ┌────────────────┐ │
│ │ Admin │ │ Zone / │ │ AI Chat │ │
│ │ Routes │ │ Forecast │ │ (Grok-3-mini) │ │
│ └──────────┘ └──────────┘ └────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────┐ │
│ │ ml.js — 4 Neural Nets │ │
│ │ AI-1 Premium · AI-3 Fraud · Churn · Fcst │ │
│ └─────────────────────────────────────────────┘ │
│ │
│ ┌─────────────┐ ┌───────────┐ ┌──────────┐ │
│ │ Open-Meteo │ │ WAQI │ │ X.AI │ │
│ │ Weather │ │ AQI │ │ Grok │ │
│ └─────────────┘ └───────────┘ └──────────┘ │
└──────────────┬──────────────────────────────────┘
│ mongoose
┌──────────────▼──────────────────────────────────┐
│ MongoDB Atlas │
│ Workers · Policies · Claims · FraudFlags │
│ TriggerHistory │
└─────────────────────────────────────────────────┘
GIC runs five purpose-trained neural networks via brain.js, plus a parametric payout formula and an LLM chat layer.
What it does: Calculates each worker's weekly premium from scratch, personalised to their risk profile.
Inputs (6 features):
| Feature | Description |
|---|---|
zone_risk |
Flood risk score for the worker's zone (0.15 low → 0.90 critical) |
streak |
Claim-free streak, normalised (0–1 over 12 weeks) |
active_days |
Days active in the last 30, normalised |
bcr |
Baseline Claim Ratio — historical payout frequency for the zone pool |
forecast_risk |
Binary: does the 7-day forecast show high trigger probability? |
seasonal |
Month-adjusted seasonal weight (monsoon season = 0.85) |
Output: A raw score (0–1) mapped to ₹29 floor → ₹89 ceiling.
Premium breakdown shown to workers:
- Base: ₹29
- Zone adjustment: ±₹28 (Velachery critical adds the most)
- Streak discount: up to −₹18 for a 12-week clean run
- Forecast surcharge: +₹10 if heavy rain is forecast, −₹5 if skies are clear
- Seasonal adjustment: +₹7 in October–November (northeast monsoon peak)
Training: ~500 synthetic samples generated from domain-rule combinations across all zone/streak/seasonal/BCR combinations, with controlled noise.
What it does: Computes the exact rupee payout the moment a claim is confirmed. No neural net — this is a transparent parametric formula so every payout is fully auditable.
Formula:
intensity = clamp((rainfall_mm_hr − 15) / 20, 0, 1)
drop_ratio = clamp(activity_drop_sigma / 3.0, 0, 1)
multiplier = 0.55 + intensity × 0.25 + drop_ratio × 0.20
payout = round(shift_baseline_earnings × multiplier)
payout = clamp(payout, ₹100, ₹500)
A worker with a ₹310 dinner baseline in a 21mm/hr storm with a 2.5σ activity drop gets approximately ₹310 × 0.85 = ₹264, floored at ₹100 and capped at ₹500. Workers can verify this themselves.
This is GIC's most sophisticated component. It combines peer cohort comparison with a neural anomaly scorer to distinguish genuine zone-wide disruptions from individual bad actors.
Step 1 — Peer Activity Stats
Before any fraud scoring, the system pulls the real-time activity of all same-platform, same-zone workers from MongoDB. If fewer than 5 real peers exist, it synthesises a deterministic cohort (seeded by zone, platform, and hour) for demo stability.
Peer metrics computed:
peerDrop— average normalised activity drop across the cohortpeerMedianDrop— median (robust to outliers)peerDropStdDev— standard deviationpeerLowActivityPct— % of peers with a severe drop (≥0.55 normalised)peerClaimRate— claims per peer in the last 7 dayspeerAvgPayout— average payout across confirmed peer claims
Step 2 — Five Fraud Signals (inputs to neural net):
| Signal | Description | Weight in training |
|---|---|---|
peerDivScore |
How much worse is this worker vs zone peers? | 35% |
newAcctScore |
Account age at claim time (< 7 days = high risk) | 20% |
freqScore |
Claims filed in the past 7 days | 20% |
rainGapScore |
Severe activity drop at marginal rainfall | 15% |
temporalScore |
Temporal clustering of claims | 10% |
Output: Anomaly score 0–1, mapped to:
clean(< 0.40) → payout proceeds immediatelysoft(0.40–0.65) → flagged for 2-hour review, payout heldhard(> 0.65) → blocked, escalated to admin queue
All flags are persisted to MongoDB with full signal breakdown for audit. The admin can clear or reject each flag from the dashboard.
What it does: Predicts the probability that a worker will stop renewing their policy.
Inputs (6 features): streak, total claims filed, premium-to-earnings ratio, days since last payout, zone risk, weeks enrolled.
Used for: Admin retention dashboards and proactive outreach to at-risk workers.
Endpoint: GET /api/ai/churn-prediction/:workerId
What it does: Predicts the probability of a triggering rainfall event for each day in the coming 7-day window, per zone.
Inputs (5 features): month (0–1), day of week (0–1), forecast rainfall average, zone flood propensity, seasonal weight.
Output: trigger_probability (0–1) mapped to low / medium / high risk, with expected rainfall and estimated payout if triggered.
Used for: The 7-day forecast panel in the admin dashboard, and the safe-choice proactive alert sent to workers the evening before a predicted disruption.
GIC's automated trigger monitor runs as a background daemon inside the Express process and is the heart of the "zero manual claims" promise.
Runs on startup → then every 5 minutes
For each active worker in MongoDB:
- Fetch live weather for the worker's zone from Open-Meteo (10-minute cache per zone)
- Check rain threshold — if rainfall < zone threshold, skip worker this cycle
- Deduplicate by window —
firedWindowsSet keyed byworkerId:YYYY-MM-DDTHHprevents double-payout in the same hour - Compute peer-informed activity drop:
- Pulls peer cohort activity (real DB data or deterministic synthetic)
activityDrop = 1.2 + min(1.2, rainExcess/6) + peerJitter + stableNoisestableNoiseuses FNV-1a hash ofworkerId + windowKey— same worker always gets the same noise for the same hour, preventing drift between monitor runs
- Adaptive activity threshold:
-
40% of peers low-activity → threshold drops to 1.3σ (zone-wide event confirmed)
- 20–40% peers → 1.5σ threshold
- <20% peers → 1.8σ threshold (requires stronger individual signal)
-
- Run AI-3 fraud check — hard flags block auto-payout
- Create claim in MongoDB with full peer context, rainfall, severity, and 4-minute auto-completion
- Log trigger history to
TriggerHistorycollection
┌─────────┐
│ CLEAR │ ← rainfall < threshold
└────┬────┘
│ rainfall ≥ threshold
┌────▼──────────┐
│ APPROACHING │ ← 10–14.9 mm/hr
└────┬──────────┘
│ rainfall ≥ threshold AND activity drop confirmed
┌────▼──────────┐
│ TRIGGERED │ ← AI-3 evaluates
└────┬──────────┘
┌──┴──┐
clean/soft hard
│ │
PAID REVIEW
| Source | Cache TTL | Fallback |
|---|---|---|
| Open-Meteo (rainfall, temperature) | 10 minutes per zone | Rotating 6-state simulation cycle (30s intervals) |
| WAQI (AQI Chennai) | 30 minutes | Random 80–120 simulation |
The simulation fallback cycles through realistic weather states (4.2mm/hr normal → 21mm/hr triggered) to ensure the UI and trigger logic remain demonstrable without live API connectivity.
| Service | Purpose | Env Variable | Fallback |
|---|---|---|---|
| Open-Meteo | Live hourly rainfall (mm/hr) and temperature per zone | None (free, no key) | 6-state rotating simulation |
| WAQI | Chennai AQI for air quality trigger | WAQI_TOKEN |
Random AQI 80–120 |
| X.AI / Grok-3-mini | In-app worker AI chat assistant | XAI_API_KEY |
8-intent rule-based fallback |
| MongoDB Atlas | Primary database for all collections | MONGODB_URI |
None — app requires DB for prod |
GET https://api.open-meteo.com/v1/forecast
?latitude={zone_lat}&longitude={zone_lon}
&hourly=precipitation
¤t_weather=true
&timezone=Asia/Kolkata
&forecast_days=1
The server extracts the current hour's precipitation bucket from the hourly array by matching the ISO timestamp to current_weather.time. No API key required.
GET https://api.waqi.info/feed/chennai/?token={WAQI_TOKEN}
Returns data.aqi (integer). Used as a secondary trigger condition (AQI ≥ 300 is an air-quality disruption event). Currently displayed but not yet used as an independent payout trigger — planned for Phase 4.
POST https://api.x.ai/v1/chat/completions
{
"model": "grok-3-mini",
"max_tokens": 500,
"temperature": 0.4,
"messages": [{ "role": "system", ... }, ...conversation]
}
12-second timeout with AbortController. Falls back to a rule-based intent matcher covering 8 categories: premium, rain/triggers, fraud/flags, payouts, claims, zones, streaks, and general.
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/auth/send-otp |
Initiate OTP login via phone number |
POST |
/api/auth/verify-otp |
Verify OTP, return worker profile + JWT token |
POST |
/api/auth/register |
Register new worker, creates Worker + Policy in DB |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/worker/:id |
Fetch worker profile |
GET |
/api/worker/:id/policy |
Fetch active weekly policy |
GET |
/api/worker/:id/claims |
Fetch full claim history with totals |
GET |
/api/worker/:id/safe-choice |
Next-day proactive disruption alert |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/worker/:id/covered-check |
Live "am I covered right now?" — runs full AI-3 peer check |
POST |
/api/claims/trigger-check |
Manually trigger a claim evaluation (for testing or worker app) |
GET |
/api/claims/:claimId |
Fetch individual claim details |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/zone/:zoneKey/conditions |
Live weather conditions for a zone with trigger state |
GET |
/api/zone/:zoneKey/forecast |
7-day neural net trigger probability forecast |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/ai/calculate-premium |
Run AI-1 premium calculation for given inputs |
POST |
/api/ai/chat |
AI chat assistant (Grok-3-mini or rule-based fallback) |
GET |
/api/ai/model-info |
Full model registry: versions, features, training approach |
GET |
/api/ai/churn-prediction/:workerId |
Churn probability for a worker |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/admin/stats |
Platform-wide KPIs: policies, GPW, BCR, payouts, fraud flags |
GET |
/api/admin/zones |
All 6 zones with live weather, BCR, worker count, threshold |
GET |
/api/admin/fraud-flags |
Full fraud flag queue sorted by recency |
POST |
/api/admin/fraud-flags/:id/resolve |
Resolve a flag: { "action": "clear" | "reject" } |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/health |
Full system health: DB, weather, ML engine status |
GET |
/api/config |
Client config (Razorpay key ID for payment integration) |
The admin dashboard is embedded in index.html and provides full operational visibility over the GIC platform.
Shows live platform KPIs pulled from /api/admin/stats:
- Active Policies — total workers currently covered
- Weekly GPW — gross premium written (active policies × avg premium)
- Average Premium — ₹63 current blended average
- Current BCR — 62% baseline claim ratio across the pool
- Total Payouts This Week — count and rupee total
- Avg Payout Time — currently 3.8 minutes
- Active Fraud Flags — flags in
reviewingorflaggedstatus
Pulls from /api/admin/zones and displays all 6 Chennai zones:
| Zone | Risk Level | Active Workers |
|---|---|---|
| Velachery | 🔴 Critical | 421 |
| Adyar | 🟠 High | 847 |
| Guindy | 🟡 Medium | 556 |
| T. Nagar | 🟢 Low | 1,203 |
| Mylapore | 🟢 Low | 634 |
| Egmore | 🟢 Low | 892 |
Each zone card shows: live rainfall, BCR, adaptive threshold, weather source (Open-Meteo vs simulation).
Pulled from /api/admin/fraud-flags. Each flag shows:
- Worker ID and zone
- Anomaly score (0–1)
- Flag type:
soft(yellow) /hard(red) /cleared(green) - Full AI-3 signal breakdown: peerDiv, newAcct, frequency, rainGap, temporal
- Peer context: sample size, active count, low-activity %, claim rate
- Clear / Reject action buttons →
POST /api/admin/fraud-flags/:id/resolve
Displays the full model registry from /api/ai/model-info:
- All 5 neural networks with feature counts and training approach
- Grok-3-mini chat status (live key vs fallback)
- Premium floor/ceiling
- Adaptive zone thresholds
id, name, phone, platform (swiggy/zomato/etc), workerId, zone, zoneId,
upi, activeDays, joinDate, coverageStatus (building_baseline | active),
baselineEarnings { lunch, dinner, avg_orders_per_hr },
streak, riskTier, policyStart
id, workerId, weekStart, weekEnd, premium, premiumBreakdown {
base, zoneAdj, streakDiscount, forecastSurcharge, activityAdj
}, ml_info { model, confidence, claim_probability },
status, windows [ { type, start, end } ]
id, workerId, date, shift, trigger, amount, status (processing | paid),
source (automated_monitor | manual_check), payoutTime, upi,
rainfall_mm_hr, activity_drop_sigma, severity_multiplier, weather_source,
fraud_check, ai1_approved, ai2_payout, ai2_severity,
ai3_approved, ai3_flag, ai3_anomaly_score,
peer_context { peer_drop, peer_low_activity_pct, peer_claim_rate,
peer_sample_size, peer_active_count, source },
initiated_at, completed_at
id, workerId, zone, shift, type (soft | hard | clear),
reason, anomalyScore, signals {
peerDivScore, peerDrop, peerMedianDrop, peerDropStdDev,
peerLowActivityPct, peerClaimRate, peerAvgPayout,
peerSampleSize, peerActiveCount, newAcctScore, freqScore,
rainGapScore, temporalScore
},
anomaly_count, status (reviewing | flagged | cleared | rejected),
generated_at, resolved_at, source, model_version
zone, rainfall, threshold, confirmed, timestamp
- Node.js ≥ 18.0.0
- MongoDB Atlas cluster (free tier works)
- Optional: WAQI token, X.AI API key
git clone https://github.com/your-org/gic-backend
cd gic-backend
npm installcp .env.example .env
# Fill in MONGODB_URI, WAQI_TOKEN, XAI_API_KEY# Development (with auto-reload)
npm run dev
# Production
npm startOn startup the server will:
- Connect to MongoDB Atlas and seed default worker/policy/claim/fraud data if the DB is empty
- Train all 4
brain.jsneural networks (takes ~5–10 seconds) - Start the trigger monitor daemon (runs every 5 minutes)
- Listen on
http://localhost:3001
| Variable | Required | Description |
|---|---|---|
MONGODB_URI |
✅ Yes | MongoDB Atlas connection string |
WAQI_TOKEN |
Optional | WAQI air quality API token — get free at waqi.info |
XAI_API_KEY |
Optional | X.AI API key for Grok-3-mini chat — get at x.ai |
RAZORPAY_KEY_ID |
Optional | Razorpay key for payment integration (Phase 4) |
PORT |
Optional | Server port (default: 3001) |
1. Fully Parametric — No Claim Forms Most gig worker insurance products still require manual filing and human adjudication. GIC is end-to-end automatic. A worker never touches the claims process.
2. Peer-Validated Triggers GIC doesn't just look at one worker's activity. It benchmarks against a same-platform, same-zone cohort in real time. If 60% of Swiggy workers in Adyar show a drop, that's a zone event — not fraud. This is what makes the fraud detection genuinely smart rather than just a rule engine.
3. Five Purpose-Built Neural Networks
AI-1, AI-3, Churn, and Forecast are separate brain.js networks trained on domain-specific synthetic data. Each model's feature weights reflect real insurance actuarial logic, not generic ML scaffolding.
4. Adaptive Zone Thresholds Velachery (chronic flooding) and Adyar (coastal) have different rain thresholds from T. Nagar. The trigger system knows this and adjusts automatically.
5. Transparent Payout Math AI-2 is a published formula, not a black box. Workers can independently verify their payout by checking the rainfall value and their activity drop — every figure is surfaced in the claim response.
6. Honest Fallbacks
Every external dependency — weather, AQI, LLM chat — has a graceful, clearly labelled fallback. The source field in every API response tells you exactly whether the data is live or simulated.
7. Sub-5-Minute Payouts The auto-claim pipeline targets ~4 minutes from trigger detection to UPI transfer. Manual insurance typically takes 2–4 weeks.
8. Full Audit Trail Every claim stores its full AI-3 signal vector, peer context, rainfall reading, weather source, and timestamp. Every fraud flag stores its full signal breakdown. Nothing is a black box to the admin.
Link for Pitch Deck - https://docs.google.com/presentation/d/1gg-y3pf1Vrq_z-IqS6rlKz-l2R6qjkZR/edit?usp=sharing&ouid=115617659625771048360&rtpof=true&sd=true
![]() Samarth230 |
![]() rohanrpais |
![]() devu2406 |
![]() Chandroja3011 |
![]() AryanSingh2025 |
CARDS · Guidewire DEVTrails 2026 · Unicorn Chase GIC — Built for the 12 million gig workers in India who lose income every monsoon season with no recourse.





