Overview · Plan
Resumable Plan
A phase-by-phase plan for both the documentation and the product build, with a live status board. Designed so any session can resume exactly where the last one stopped.
▶ Resume point (last updated 2026-06-30): Docs complete (A0–A15). Track B (build) — Phase 0 backend COMPLETE: repo scaffold ✅ (Go backend + Next.js PWA live at ridechain.in + Cloudflare/Terraform); core data model + migrations ✅ (15 tables, 17 enums, append-only ledger, validated on live Postgres); auth ✅; booking lifecycle + state machine ✅ (DOOR/POINT modes, legs, dual-OTP + POD, idempotent create, RBAC — verified over HTTP); escrow ledger ✅; payments gateway ✅ (Razorpay→Cashfree success-rate routing, signature-verified idempotent webhooks → escrow Hold, verified live with the real Razorpay TEST key); split settlement ✅ (pure always-balancing fare split; per-leg partner release on drop-OTP+POD, remainder — Points/hub/commission/PG-fee/tax-reserve — on the final leg; idempotent, canonical ₹120/₹220 splits conserve escrow to 0); nearest-partner matching ✅ (vehicle eligibility matrix + cost-aware scoring + dispatch cascade with single-offer lock and progressive radius; escrow_held→matching→assigned→AddLeg, no_partner_found→auto-refund; geo proximity behind a Locator port stubbed with in-memory Haversine until #13). geolocation ✅ (live partner-location index now backs matching's Locator; geofence custody check with accuracy gate + server timestamp; fuzzy-address resolver with Point-anchor fallback; anti-spoof mock/teleport/stale signals — in-memory stand-ins for Redis GEOSEARCH + PostGIS KNN); KYC ✅ (Cashfree Secure ID — Aadhaar OKYC masked-token-only, PAN, bank penny-drop, liveness+face; resumable idempotent pipeline; graduated trust tiers New→Platinum capping value/COD/distance; Aadhaar-token blacklist + one-account-per-Aadhaar; vehicle-class check matrix — cycle skips RC/DL); PUDO custody chain ✅ (#15) — RideChain Point onboarding (hub-role operator, KYC-gated activation, geofenced) + nearest-Points lookup; the India-Post-style custody chain with a tracking number and the four interlocking checks at every handover (assignment lock · unique tamper-evident QR · two-sided OTP · geofence+server-timestamp), threading origin-intake→carrier-pickup→hub-intake→destination-intake→receiver-collection over a multi-Point route; each carrier leg's escrow release is gated by its handover via the booking port, and every hop pushes a tracking notification through notify. The full Phase-0 vertical slice now runs end-to-end through real modules: book→quote→escrow-hold→match→drop-at-Point→carrier-handovers→per-leg-split-release→collect→settled. Backend is now LIVE in production — deployed as a Cloudflare Container (Go modular monolith behind a Worker entrypoint) at ridechain-api.pathakumashankar.workers.dev;
/healthz returns all 10 modules, auth-OTP/RBAC/CORS verified over HTTPS. Payment gateways (Razorpay TEST + Cashfree SANDBOX) and Cashfree Secure ID KYC now make real HTTP calls (live-ready: going live = key/URL swap); persistence runs on Supabase Postgres when RC_DATABASE_URL is set (the running instance is in-memory until the DB secret + migration 0002_app_pg are applied — see backend/DEPLOY.md). The web booking form (ridechain.in) calls the live API once NEXT_PUBLIC_API_BASE_URL is set. Next action: finish go-live config (apply the Supabase migration + add the gateway/webhook repo secrets), then Phase 1 — bundling + milk-run + VRP routing + COD reconciliation + surge + fraud v1; plus the Flutter apps (#16) + admin web (#17).
How to use this board
Each row is a unit of work with a status. On resume: scan for the first In progress or To do row, read its linked doc, and continue. Update the chip + the resume banner when you finish (the publish-doc skill requires it).
Done · In progress · To do · Blocked
Track A — Documentation
| # | Document | Scope | Status |
|---|---|---|---|
| A0 | Shared assets (CSS/JS/Mermaid/template) | Design system, runtime, doc template & conventions | Done |
| A1 | Documentation Hub | Index + navigation + KPIs | Done |
| A2 | Context & Vision | Problem, EU models, cost thesis, locked decisions | Done |
| A3 | System Architecture | Topology, apps, modules, data, integrations, security | Done |
| A4 | Skills & Commands | publish-doc skill + /review-features command reference | Done |
| A5 | Booking & Delivery Flow | Entry points, pickup/drop modes, state machine, OTP/POD, cancel/refund | Done |
| A6 | Onboarding & KYC | Partner/booker/PUDO onboarding, Cashfree Easy KYC, trust tiers | Done |
| A7 | Last-Mile Delivery | PUDO, milk-run, relay legs, custody chain, reverse logistics | Done |
| A8 | Payments & Integration | RZP→CF routing, escrow, integration sequences, webhooks | Done |
| A9 | Split-Money Settlement | Route/Easy Split, per-leg split, ledger, reconciliation | Done |
| A10 | Commission & Pricing | Fare formula, vehicle rates, tiers, surge, worked examples | Done |
| A11 | Geolocation | Tracking, geofence, addressing, offline geo, anti-spoof | Done |
| A12 | Nearest-Partner Matching | Eligibility, scoring, dispatch cascade, bundling, fairness | Done |
| A13 | Fastest-Route Finding | OSRM, VRP batching, rural weighting, ETA, re-route | Done |
| A14 | Scale & Low-Cost | Cost levers, capacity model, caching/sharding, cost-to-millions | Done |
| A15 | Edge-Case Catalog | Exhaustive failure-mode catalog + mitigations | Done |
Track B — Product build (gated, not started)
Not started. Per standing instruction, no code is written until the user explicitly says go. This track is the sequencing once unblocked.
gantt
title RideChain build roadmap (indicative)
dateFormat YYYY-MM-DD
axisFormat %b
section Phase 0 — MVP pilot
Repo scaffold (Go + Flutter + Next.js + CF) :p0a, 2026-07-01, 14d
Auth + OTP + data model + escrow ledger :p0b, after p0a, 21d
Vertical slice: book→match→OTP→POD→split payout :p0c, after p0b, 28d
KYC onboarding + PUDO custody/handover :p0d, after p0c, 21d
Single-block pilot launch :milestone, after p0d, 0d
section Phase 1 — Network economics
Bundling + milk-run + VRP routing :p1a, after p0d, 30d
COD + reconciliation + surge + trust tiers :p1b, after p1a, 25d
Fraud ML v1 + WhatsApp/IVR booking :p1c, after p1b, 25d
section Phase 2 — EU-grade + scale
Crowd couriers + reverse logistics + lockers :p2a, after p1c, 40d
Insurance + ONDC + graph-fraud + district scale :p2b, after p2a, 45d
| Phase | Deliverable | Status |
|---|---|---|
| 0 · MVP | Repo scaffold — Go modular monolith (8 modules) + Next.js PWA live + Cloudflare/Terraform (Flutter pending) | Done |
| 0 · MVP | Core data model + migrations (15 tables, 17 enums, PostGIS) | Done |
| 0 · MVP | Append-only escrow ledger (idempotent entries, balances as projections, canonical splits conserve money) | Done |
| 0 · MVP | Auth (phone-OTP, HMAC session tokens, RBAC middleware, /me) | Done |
| 0 · MVP | Booking lifecycle + state machine (DOOR/POINT modes, legs, dual-OTP + POD, cancel) | Done |
| 0 · MVP | Payments gateway (Razorpay→Cashfree success-rate routing) + escrow webhooks (signature-verified, idempotent) | Done |
| 0 · MVP | Split settlement — always-balancing fare split + per-leg escrow release on drop-OTP+POD (remainder on final leg), idempotent | Done |
| 0 · MVP | Nearest-partner matching — eligibility matrix + cost-aware scoring + dispatch cascade (escrow_held→matching→assigned→AddLeg, no_partner→refund); geo behind a Locator port | Done |
| 0 · MVP | Geolocation — live partner index (backs matching), geofence custody check, fuzzy-address resolver + Point anchor, anti-spoof signals | Done |
| 0 · MVP | Cashfree Easy KYC — Secure ID OKYC/PAN/penny-drop/liveness, resumable pipeline (masked-token-only), graduated trust tiers, Aadhaar-token blacklist | Done |
| 0 · MVP | RideChain Point (PUDO) onboarding (KYC-gated, geofenced) + nearest-Points lookup + four-check custody chain (assignment lock · unique QR · two-sided OTP · geofence+timestamp) with tracking number & per-hop notifications, gating per-leg escrow release | Done |
| 1 | Bundling + milk-run scheduling + VRP routing + COD reconciliation + surge + trust tiers + fraud v1 | To do |
| 2 | Crowd couriers, reverse logistics, lockers, insurance, ONDC, graph-fraud, district scale | To do |
Locked decisions & open questions
The authoritative copy lives in Context & Vision §7. Open: exact pilot block; first B2B feeder partner. Neither blocks starting the build.