Something happened? Know what to do next.
WhatNow? is a practical, digital first-response platform designed to help people navigate unexpected real-life situations. When something goes wrong — a lost passport, a stolen credit card, a hacked account, or a car breakdown — WhatNow? turns scattered panic into prioritized, verified, step-by-step action plans.
Combining a deterministic, human-audited emergency scenario database with Google Gemini 3.1 Flash-Lite AI interpretation and country-specific localization, WhatNow? provides immediate clarity, statutory deadline protection, preparation templates, and empathetic conversational guidance without requiring user accounts or GPS tracking.
- Overview
- Why WhatNow?
- Product Philosophy
- Who Is WhatNow? For?
- Features
- Scenario Engine
- AI & Safety
- AI Resilience & Deterministic Fallbacks
- Global Conversational Assistant
- Trust & Sources
- Location & Localization
- Emergency Kit & Document Templates
- Deadline Protection & Google Calendar
- Privacy Architecture
- Security
- Architecture
- Data Flow
- Project Structure
- Tech Stack
- Application Routes
- Getting Started
- Production Build
- Testing & Quality Assurance
- Accessibility
- Reliability & Fallbacks
- Limitations & Safety Notice
- Contributing & Reporting Issues
- Development Journey
- About the Creator
- License
When an unexpected event occurs, people rarely suffer from a lack of information on the internet — they suffer from information overload, ambiguity, and high stress. Official helpline numbers, emergency filing steps, embassy procedures, and bank chargeback rules are often buried across dozens of disparate government portals, financial network FAQs, and carrier websites.
WhatNow? serves as a centralized, privacy-first emergency action manual. It eliminates guessing by analyzing what happened in plain English, pulling up structured, government-verified emergency action plans, tailoring guidance to the user's location, and helping them take control step-by-step.
In an emergency, people ask critical questions in rapid succession:
- What should I do first right now?
- What critical mistake must I avoid doing?
- Who do I call, and which official portal do I use?
- What documents will I need to replace or file a claim?
- Is there a statutory deadline (e.g. 3-day bank fraud zero-liability window)?
- How do I notify police, my bank, or my embassy?
WhatNow? addresses this scattered uncertainty by organizing information into structured, bite-sized components:
[Unexpected Incident] ➔ [AI & Deterministic Classification] ➔ [Verified Action Plan + Country Context + Deadlines]
The core user experience moves through four distinct emotional and operational phases:
- PANIC: Something unexpected has happened (lost identity, stolen device, financial breach).
- CLARITY: Understand what matters right now. Filter out noise and focus on immediate priorities.
- ACTION: Execute step 1 ("Do This Now") and avoid common mistakes ("Do Not Do This").
- CONTROL: Track document requirements, add statutory deadlines to Google Calendar, and monitor recovery follow-ups.
- Action Before Information Overload: Display the single most critical action first.
- Verified Sources Over Guesswork: Official helpline numbers and portals originate strictly from human-audited datasets, never LLM hallucinations.
- Privacy By Default: 100% accountless; zero GPS tracking; all user progress stays in local browser storage.
- AI Assists, Not Invents: AI interprets intent and personalizes advice, but operates within deterministic data guardrails.
WhatNow? provides tailored action guides across 5 primary incident categories:
- Travel & Identity: Lost passport abroad, stolen national ID, driver's licence loss, flight cancellations, stranded at airport, lost luggage.
- Money & Cards: Stolen debit/credit card, ATM card retained, card cloning, unauthorized UPI/bank transfers, investment scams, online shopping fraud.
- Digital & Accounts: Hacked social media account, compromised email, SIM swap attacks, data breaches, phishing link clicked, cloud storage leak.
- Home & Vehicle: Car accident, vehicle theft, flat tyre, dead car battery, home burglary, house keys lost, locked keys inside.
- Personal & Property: Stolen laptop/phone, lost device while traveling, identity theft, impersonation scams.
- Do This Now: Top-priority immediate action steps (e.g. block SIM card, freeze bank account).
- Do Not Do This: Critical warnings to prevent compounding damage (e.g. do not pay ransom to scammers, do not touch burglary crime scene).
- Interactive Checklists: Checkable progress steps persisted locally in browser
localStorage. - Decision Trees: Interactive diagnostic trees for complex choices (e.g., Tatkaal vs Normal passport reissue path).
- Natural Language Search: Type descriptions like "someone took my backpack with my phone and wallet inside".
- Incident Bundling: Combines multiple overlapping emergency guides into a single unified recovery plan (e.g.
phone-stolen+card-stolen+passport-lost). - Guided Diagnosis: Interactive step-by-step questionnaire for users who are unsure what type of incident occurred (
/emergencies/discover).
- A high-contrast, distraction-free emergency mode that strips away secondary navigation and presents only essential contact numbers and immediate step-1 instructions.
- Document & Info Checklist: Lists essential items to gather (police FIR, bank statements, transaction IDs).
- Interactive Template Generator: Generates formatted, printable statement templates (e.g. Police Lost Document FIR Statement, Bank Card Fraud Chargeback Notice) rendered strictly in local memory.
- Tracks statutory filing deadlines (e.g. 3-day zero-liability fraud reporting window).
- Direct Google Calendar Action: One-click
+ Add to Google Calendarpre-populates UTC calendar events without requiring OAuth login or account connections.
- Tailors helplines, official portals, and filing procedures to selected country context (India, Singapore, US, UK, Canada, Australia, Global).
- Travel Mode Toggle: Activates consular embassy guidance and foreign police FIR procedures when traveling abroad.
- Direct links to official government and financial authority portals (CEIR, Cyber Crime Portal 1930, Passport Seva, FTC, State Dept).
- Every external link displays an audited
Verified Sourcebadge with transparent verification timestamps.
The scenario engine is powered by structured JSON data models located in src/data/emergencies/.
User Description ("my wallet and phone were taken")
│
▼
[NLP Classifier / Gemini 3.1]
│
▼
Matched Scenario Slugs: ["phone-stolen", "card-stolen"]
│
▼
[Structured Scenario Engine]
├── Immediate Action Checklist
├── Critical Warnings (Do Not Do)
├── Required Documents & Deadlines
├── Verified Authority Links (CEIR, Bank Helpline)
└── Location-Specific Rules (India / Travel Context)
By decoupling interpretation from authoritative procedure data, WhatNow? guarantees that official phone numbers and government links are 100% deterministic and hallucin-free.
Google Gemini 3.1 Flash-Lite (@google/genai) is integrated as an intent interpretation, conversational personalization, and explanation layer.
- Interprets ambiguous, emotional, or conversational user descriptions.
- Maps natural language prompts to verified scenario IDs.
- Personalizes follow-up responses and empathetic chat conversation.
- Explains complex legal or administrative terms in simple language.
- AI does NOT generate official helpline numbers.
- AI does NOT invent government links or domain names.
- AI does NOT dictate bank dispute deadlines or statutory rules.
- AI does NOT hallucinate emergency procedures.
WhatNow? does not break if the AI API is offline or unconfigured:
- Offline Keyword & Fuzzy Matcher (
src/lib/ai/nlp-matcher.ts): If theGEMINI_API_KEYis missing or API limits are reached, the application seamlessly falls back to a deterministic keyword ranking algorithm that scores scenario titles, tags, and synonyms locally. - Core scenario pages (
/emergencies/[slug]), checklists, emergency kits, and source registries remain 100% usable without active AI connections.
The global floating assistant (GlobalChatbot.tsx) provides continuous conversational support across the platform.
- Floating Interface: Accessible from any page via the bottom-right action trigger.
- Local Persistence: Chat history is saved locally in browser
localStorage(whatnow_chat). - Grounded Responses: Powered by
/api/ai/chatusing Gemini 3.1 Flash-Lite, grounded in WhatNow scenario datasets. - Empathetic & Concise: Tailored prompt engineering ensures calm, concise, bulleted responses under 3-4 sentences.
- Casual Conversation Handling: Generic greetings (e.g. "hi", "hello") trigger friendly conversational openings rather than incorrectly forcing an emergency classification.
- One-Click Reset: Permanent local chat deletion via the header trash icon (
🗑).
WhatNow? operates an audited Trust Registry (src/data/sources/index.ts).
- Official Authority Criteria: External links point strictly to top-level government domains (
.gov,.gov.in,.gov.sg), official telecom registries (CEIR), or bank fraud divisions. - Community Reporting: Users can report outdated links, changed helpline numbers, or regional inaccuracies via the
/reportpage orReportOutdatedModal. - Admin Audit Dashboard: Internal audit dashboard (
/admin) allows inspection of active scenarios, stale sources (>180 days since verification), community issue reports, and contact submissions.
WhatNow? uses a privacy-first localization model (LocationContext.tsx & localization.ts):
- No GPS Tracking: WhatNow? never requests browser geolocation permissions or IP tracking.
- User-Selected Context: Users choose their current country and home issuing country via the Location Selector.
- Supported Regions: India (
IN), Singapore (SG), United States (US), United Kingdom (UK), Canada (CA), Australia (AU), and Global / International (GLOBAL). - Travel Context: Toggling "Currently Travelling Abroad" prioritizes embassy consular desks, passport lost abroad protocols, and foreign police lost reports.
The Emergency Kit section (src/components/emergency/EmergencyKitSection.tsx) helps users organize necessary documentation and generate formal statements:
- Police Lost Document FIR Statement: Pre-formatted text template for reporting lost passports, IDs, or stolen phones to police.
- Bank Fraud Chargeback Notice: Formal written notice to bank branch managers detailing unauthorized transaction timestamps and helpline acknowledgment numbers.
- Local Memory Processing: Text typed into statement templates remains strictly in temporary component state and is never transmitted to external servers.
To prevent missed statutory deadlines:
[Statutory Deadline: Report Bank Fraud within 3 Days]
│
▼
[Click: + Add to Google Calendar]
│
▼
Generates Direct URL: https://calendar.google.com/calendar/render?action=TEMPLATE&text=...
│
▼
Opens Google Calendar in new tab (Zero OAuth / Zero Login Required)
WhatNow? is designed to be privacy-safe by default.
| Data Type | Behavior | Storage Location |
|---|---|---|
| User Account | None required (100% accountless) | N/A |
| Chat History | Persisted locally on client device | Browser localStorage (whatnow_chat) |
| Location Selection | Country code only (e.g., IN, US) |
Browser localStorage (whatnow_user_location) |
| Checklist State | Progress checkmarks | Browser localStorage (whatnow_checklist_<slug>) |
| GPS / Coordinates | Zero collection / Zero tracking | N/A |
| Gemini Prompts | Natural language text sent to API for classification | Server-side API processing (/api/ai/*) |
| Cloud Database | None (No cloud conversation database) | N/A |
| Gemini API Key | Stored in server environment variables | Server environment only (process.env.GEMINI_API_KEY) |
- Server-Side API Key Protection:
GEMINI_API_KEYis consumed exclusively inside Next.js API routes (src/app/api/ai/*). No client-sideNEXT_PUBLIC_key exposure. - Input Sanitization: User situation prompts are validated and sanitized before forwarding to AI services.
- Structured Output Validation: Gemini responses are validated against JSON Schemas (
schemas.ts) to prevent unexpected response formats.
┌────────────────────────────────────────────────────────────────────────┐
│ WhatNow? UI │
├───────────────┬────────────────┬───────────────┬───────────────────────┤
│ Hero Search │ Emergency View │ Panic Mode │ Global Chatbot Widget │
│ Category Grid │ Checklist/Tree │ Emergency Kit │ Location Selector │
└───────┬───────┴───────┬────────┴───────┬───────┴───────────┬───────────┘
│ │ │ │
▼ ▼ ▼ ▼
┌────────────────────────────────────────────────────────────────────────┐
│ Next.js Application Layer │
├───────────────────────┬────────────────────────┬───────────────────────┤
│ Scenario Engine │ Location Context │ LocalStorage Handler │
│ Verified Sources Data │ Recovery Timeline │ Calendar URL Gen │
└───────┬───────────────┴────────┬───────────────┴───────────┬───────────┘
│ │ │
▼ ▼ ▼
┌───────────────────┐ ┌───────────────────┐ ┌─────────────────────┐
│ AI Classifier │ │ Offline Matcher │ │ Server API Routes │
│ Gemini 3.1 Flash │ │ (NLP Fallback) │ │ /api/ai/classify │
└───────────────────┘ └───────────────────┘ │ /api/ai/chat │
└─────────────────────┘
User Prompt ("stolen wallet") ➔ /api/ai/classify ➔ Gemini / NLP Fallback ➔ Scenario Slug ("card-stolen") ➔ Scenario Engine ➔ EmergencyView Page
User Message ➔ GlobalChatbot UI ➔ /api/ai/chat ➔ Gemini 3.1 Flash-Lite (Grounded Prompt) ➔ Streamed Response ➔ Local Storage (whatnow_chat)
WhatNow/
├── public/ # Static assets (logo.png, favicon.png)
├── src/
│ ├── app/ # Next.js App Router pages & API routes
│ │ ├── about/ # About WhatNow & Creator pages
│ │ ├── accessibility/ # Accessibility Statement
│ │ ├── admin/ # Admin Data & Audit Dashboard
│ │ ├── ai-safety/ # AI Safety Policy page
│ │ ├── api/ # Server API endpoints (AI, Reports, Contact)
│ │ │ ├── ai/ # Gemini classification, chat & health routes
│ │ │ ├── contact/ # Contact form submission API
│ │ │ └── reports/ # Community report submission API
│ │ ├── contact/ # Contact Us page
│ │ ├── disclaimer/ # Legal Disclaimer page
│ │ ├── emergencies/ # Scenario directory, dynamic [slug], & bundle pages
│ │ ├── faq/ # Interactive Accordion FAQ page
│ │ ├── how-it-works/ # Process architecture page
│ │ ├── privacy/ # Privacy Policy page
│ │ ├── report/ # Report an Issue page
│ │ ├── terms/ # Terms of Use page
│ │ ├── trust/ # Trust Center & Source Registry page
│ │ ├── globals.css # Tailwind global styles
│ │ ├── layout.tsx # Root Layout (Header, Footer, GlobalChatbot)
│ │ └── page.tsx # Home Landing page
│ ├── components/ # React UI Components
│ │ ├── chat/ # GlobalChatbot widget
│ │ ├── common/ # IconRenderer, SeverityBadge
│ │ ├── discovery/ # GuidedUncertaintyFlow
│ │ ├── emergency/ # EmergencyView, Checklist, PanicMode, EmergencyKit
│ │ ├── home/ # HeroSearch, CategoryGrid
│ │ ├── layout/ # Header, Footer
│ │ └── location/ # LocationBadge, LocationSelectorModal
│ ├── context/ # LocationContext provider
│ ├── data/ # Structured emergency & source databases
│ │ ├── emergencies/ # 52 individual scenario definition files
│ │ ├── kits/ # Emergency kit definitions
│ │ ├── recovery/ # Statutory document & deadline datasets
│ │ ├── sources/ # Verified authority source registry
│ │ └── categories.ts # Category metadata
│ ├── lib/ # Core utilities & engines
│ │ ├── ai/ # Gemini client, classifier, schemas & NLP fallback
│ │ ├── analytics.ts # Usage event tracking
│ │ ├── bundler.ts # Incident scenario bundling engine
│ │ ├── chat-storage.ts # Chat history localStorage utilities
│ │ ├── google-calendar.ts # Google Calendar URL generator
│ │ ├── storage.ts # Checklist localStorage handler
│ │ └── utils.ts # Tailwind classnames merger
│ └── types/ # TypeScript interface definitions
├── .env.example # Environment variable template
├── .gitignore # Git untracked path rules
├── next.config.js # Next.js configuration
├── package.json # Project dependencies & scripts
├── postcss.config.js # PostCSS Tailwind config
├── tailwind.config.js # Tailwind design theme config
└── tsconfig.json # TypeScript compiler config
- Framework: Next.js 14.2.35 (App Router, Server Components, API Routes)
- Language: TypeScript 5.0
- Styling: Tailwind CSS 3.4
- AI Integration: @google/genai (Google Gemini 3.1 Flash-Lite)
- Icons: Lucide React
- Storage: Client-Side
localStorage(Accountless persistence)
| Category | Route | Purpose |
|---|---|---|
| Core Product | / |
Home Landing Page with Hero Search & Categories |
/emergencies |
Scenario Directory with Search & Category Filters | |
/emergencies/[slug] |
Dynamic Emergency Action Plan & Emergency Kit | |
/emergencies/discover |
Guided Diagnostic Questionnaire | |
/emergencies/bundle |
Multi-Incident Bundled Action Plan | |
| Trust & Audit | /trust |
Trust Center & Verified Authority Source Registry |
/admin |
Admin Data Audit Dashboard (Scenarios, Sources, Reports) | |
| Informational | /about |
Product Mission & 7-Step Process |
/about/creator |
Independent Creator Story & Vision | |
/how-it-works |
Platform System Architecture Explanation | |
| Legal & Privacy | /ai-safety |
AI Safety & Guardrails Policy |
/privacy |
Privacy Policy (LocalStorage documentation) | |
/terms |
Terms of Use & Local Storage Rights | |
/disclaimer |
Legal Non-Dispatch Notice & Emergency Numbers | |
/accessibility |
WCAG 2.1 AA Accessibility Statement | |
| Support | /faq |
Interactive FAQ Accordion |
/contact |
Contact Us Submission Form | |
/report |
Community Issue & Outdated Info Reporting | |
| API Endpoints | /api/ai/classify |
AI Situation Classifier API |
/api/ai/explain |
AI Action Step Explanation API | |
/api/ai/chat |
Global Chatbot Conversational API | |
/api/ai/health |
AI Engine Health Status API | |
/api/reports/submit |
Community Report Submission & Admin API | |
/api/contact/submit |
Contact Submission & Admin API |
- Node.js:
v18.17.0or higher - Package Manager:
npm(v9+) - Google Gemini API Key: Obtain a key from Google AI Studio
-
Clone the repository:
git clone https://github.com/sc-likes-to-code/WhatNow.git cd WhatNow -
Install dependencies:
npm install
-
Configure Environment Variables: Copy
.env.exampleto create a local.envfile:cp .env.example .env
Open
.envand insert your Gemini API key:GEMINI_API_KEY=your_actual_gemini_api_key_here GEMINI_MODEL=gemini-3.1-flash-lite
-
Run the Development Server:
npm run dev
Open http://localhost:3000 in your browser.
To test or build the optimized production output:
# Clean previous build artifacts (optional)
npm run build
# Start production server locally
npm run startStatic and dynamic routes will be prerendered cleanly:
✓ Compiled successfully
✓ Prerendered static pages (80/80)
The codebase undergoes comprehensive manual QA across key functional matrices:
- AI Intent Classification: Tested across ambiguous, multi-incident, and casual input prompts.
- Offline Fallback: Verified that core scenario browsing and search work when
GEMINI_API_KEYis omitted. - Localization Routing: Tested country switches (India, US, UK, SG, CA, AU) and travel mode toggles.
- Calendar Action: Verified
+ Add to Google Calendardirect URL links generate correct UTC parameters. - Report & Contact Submissions: Verified submission handling and real-time deletion on the
/admindashboard. - Mobile Responsiveness: Tested across responsive breakpoints (320px to 1440px+).
WhatNow? adheres to WCAG 2.1 AA guidelines:
- High Contrast Typography: Tested text contrast against warm background palettes.
- Keyboard Navigation: Interactive controls, buttons, modals, and accordions are fully keyboard accessible (
Tab,Enter,Space,Esc). - Screen Reader Support: ARIA attributes (
aria-label,aria-expanded,aria-hidden) on modals, buttons, and badges. - Reduced Motion: Respects
prefers-reduced-motionsettings.
- No Single Point of Failure: If Gemini API requests timeout or fail, the offline NLP keyword matcher takes over automatically.
- Zero Lock-In: Users can export or print action plans and Emergency Kit templates as physical documents.
- Local Control: Chat history and location choices can be cleared instantly by the user at any time.
Important
WhatNow? is an informational first-response guide platform. It is NOT an emergency dispatch service, government agency, law enforcement body, bank, insurer, or medical provider.
- Life-Threatening Emergencies: For immediate physical danger, medical trauma, active fires, or violent crimes, users must immediately call national emergency dispatch: 112 (India / EU), 911 (US / Canada), or 999 (UK).
- Official Verification: Users should verify high-stakes procedures (e.g. passport replacement appointments or police FIR filings) directly on the linked official government portals.
If you find an outdated helpline number, changed government URL, or incorrect regional step, submit a report via /report or click Report an Issue on any emergency guide page.
- Fork the repository.
- Create a feature branch (
git checkout -b feature/new-scenario). - Commit your changes adhering to conventional commit messages.
- Verify build success (
npm run build). - Open a Pull Request.
WhatNow? was developed through a structured, modular engineering trajectory:
- Phase 1 — Core Emergency Engine: 52 scenario definitions, action steps, checklists, Panic Mode.
- Phase 2 — Discovery & AI Intelligence: Hero search, guided diagnosis, scenario bundling, Gemini 3.1 classification engine.
- Phase 3 — Trust, Sources & Localization: Privacy-first country selection, travel mode, verified source registry, Trust Center, Admin audit dashboard.
- Phase 4 — Emergency Kit: Preparation checklists, police FIR & bank fraud statement template generator.
- Phase 5 — Documents & Deadline Protection: Document requirement cards, statutory deadline timelines, Google Calendar URL integration.
- Phase 6 — Intentionally Skipped: Incident management accounts were intentionally omitted to maintain a 100% accountless, zero-login privacy architecture.
- Phase 7 — Global Conversational Assistant: Grounded Gemini 3.1 assistant, local storage chat persistence, floating widget.
- Phase 8 — Professional Footer, Trust & Support Architecture: Footer redesign, About, Creator, How It Works, Trust, AI Safety, Privacy, Terms, Disclaimer, Accessibility, FAQ, Contact & Report pages.
WhatNow? was built as an independent software project to prove that emergency response tools can be calm, practical, authoritative, and privacy-respecting without sacrificing modern user experience or leveraging invasive tracking.
Learn more on the About Creator page.
This project is licensed under the MIT License. See the LICENSE file for details.
WhatNow? — Something happened? Know what to do next.