Skip to content

Development Setup

ToolMinimum versionNotes
Node.js20+Pinned in package.json engines; LTS recommended
BunLatestRecommended runtime/package manager (curl -fsSL https://bun.sh/install | bash)
Supabase CLILatestnpm i -g supabase
GitAny

Terminal window
git clone https://github.com/lohitkolluri/Oasis.git
cd Oasis
bun install

From the repo root, make setup runs install, interactive env configuration (make configurescripts/configure-env.ts), DB migrate, and storage setup. Use make dev for the app and make docs for the Starlight site (docs/, port 4321).


Copy the example file and fill in every value:

Terminal window
cp .env.local.example .env.local
Terminal window
# Supabase - create a project at supabase.com
NEXT_PUBLIC_SUPABASE_URL=https://<project-ref>.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=<anon-key>
SUPABASE_SERVICE_ROLE_KEY=<service-role-key>
# Admin access - comma-separated emails
ADMIN_EMAILS=you@example.com
# Cron job protection
CRON_SECRET=<random-secure-string>
Terminal window
# Tomorrow.io - heat + rain triggers
# Free tier: 500 calls/day - https://app.tomorrow.io/
TOMORROW_IO_API_KEY=
# WAQI - ground-station AQI (optional, Open-Meteo fallback used if empty)
# Free token: https://aqicn.org/api/
WAQI_API_KEY=
Terminal window
# TomTom - multi-point traffic flow sampling
# Free tier: 2500 calls/day - https://developer.tomtom.com/
TOMTOM_API_KEY=
Terminal window
# NewsData.io - news-based disruption detection
# Free tier: 200 calls/day - https://newsdata.io/
NEWSDATA_IO_API_KEY=
# OpenRouter - LLM verification of news triggers
# Free tier available - https://openrouter.ai/
OPENROUTER_API_KEY=

Weekly premiums use Razorpay Standard Checkout. For demos and local development, use Test mode keys only.

Terminal window
# Dashboard → API Keys (test mode) — https://dashboard.razorpay.com/
NEXT_PUBLIC_RAZORPAY_KEY_ID=rzp_test_...
RAZORPAY_KEY_SECRET=...
# Optional: webhook signing secret if you register https://your-host/api/payments/webhook
RAZORPAY_WEBHOOK_SECRET=...

The app requires NEXT_PUBLIC_RAZORPAY_KEY_ID to start with rzp_test_ (see lib/config/env.ts). Never commit real (rzp_live_) keys into example files or docs.

flowchart LR
  P["/dashboard/policy"] --> C["POST /api/payments/create-checkout"]
  C --> M["Razorpay modal"]
  M --> V["POST /api/payments/verify"]
  V --> OK["Policy active"]

Section titled “Option A - Supabase Dashboard (recommended for first-time setup)”
  1. Create a project at supabase.com/dashboard
  2. Go to SQL Editor → New query
  3. Run all SQL files in supabase/migrations/ in timestamp order (top to bottom in the folder view).

If you prefer more guidance, open the folder and apply them in this rough sequence:

  • Core tables (profiles, weekly policies, claims, disruption events, plans)
  • Improvements & fixes (fraud flags, zone coordinates, audit logs)
  • Payments & cron jobs (Razorpay, Supabase cron, rate limits)
  • Quality-of-life updates (notifications, pricing tweaks, extra columns)

Migrations are applied with supabase db push, which requires the project to be linked. You can link via the Supabase plugin (in Cursor: connect your project in the Supabase panel) or via the CLI:

Terminal window
# 1. Log in (one-time; or set SUPABASE_ACCESS_TOKEN)
npx supabase login
# 2. Link to your project (ref = from NEXT_PUBLIC_SUPABASE_URL, e.g. https://<ref>.supabase.co)
npx supabase link --project-ref <project-ref>
# 3. Apply all migrations
bun run db:migrate
# or: make db-migrate

If you use the Supabase plugin in Cursor, ensure the project is connected; then you can run migrations from the plugin UI or run bun run db:migrate (or make db-migrate) in the terminal after linking once via CLI.

An idempotent seed script is available at scripts/seed-demo-data.sql. It quickly fills your database with a ready-to-demo Oasis environment:

  • 5 demo riders across cities and platforms
  • 3 weekly plans (Basic, Standard, Premium)
  • A mix of realistic disruption events, claims, payouts, and notifications

You don’t need to read the SQL; just run it once in the Supabase SQL Editor:

  1. Open Supabase Dashboard → SQL Editor → New query
  2. Paste the contents of scripts/seed-demo-data.sql
  3. Click Run

The script is safe to re-run — it cleans up the previous demo data before inserting fresh records.

Demo rider credentials (for logging in quickly):

EmailPasswordCityPlatform
demo.rider1@oasis.testDemoRider1!BangaloreZepto
demo.rider2@oasis.testDemoRider2!MumbaiBlinkit
demo.rider3@oasis.testDemoRider3!DelhiZepto
demo.rider4@oasis.testDemoRider4!ChennaiBlinkit
demo.rider5@oasis.testDemoRider5!HyderabadZepto

Run bun run setup-storage to create all required buckets:

BucketPurpose
rider-reportsDelivery reports and claim proof photos
government-idsKYC government ID uploads (Aadhaar, PAN, etc.)
face-photosFace liveness verification photos for onboarding
Terminal window
bun run setup-storage

Or create them manually via Supabase Dashboard → Storage → New bucket (all private, 5MB limit, images only).


Terminal window
bun dev

The app starts on http://localhost:3000 with Turbopack.

  1. Navigate to /register and create an account.
  2. To access /admin, your email must be in ADMIN_EMAILS.
  3. Complete the onboarding flow at /onboarding (Step 1: platform, name, phone, zone; Step 2: government ID + face verification).

ScriptCommandDescription
Dev serverbun dev or make devNext.js + Turbopack
Production buildbun run buildFull Next.js build with type check
Lintbun run lintESLint with Next.js ruleset
Unit testsbun run testVitest (make test)
E2E testsbun run test:e2ePlaywright (make test-e2e)
DB migratebun run db:migrateSupabase CLI push (make db-migrate)
Storage setupbun run setup-storageCreate rider-reports, government-ids, face-photos buckets
Env wizardmake configureInteractive .env.local via scripts/configure-env.ts

The adjudicator runs automatically on Vercel’s cron schedule. To trigger it manually during development, call the API with your CRON_SECRET:

Terminal window
curl -H "Authorization: Bearer <CRON_SECRET>" \
http://localhost:3000/api/cron/adjudicator

Or use the Admin Dashboard → Run Adjudicator button (requires admin login).


app/ → pages and API routes (Next.js App Router)
components/ → React UI components
lib/ → business logic (no React)
supabase/ → SQL migrations + Deno edge function
docs/ → this Starlight docs site (+ openapi.yaml)

See Folder Structure for a complete breakdown.