# Mobile App Registration — Kumbh Mela 2027

**Channel:** Native / cross-platform mobile application  
**Audience:** Mobile and backend developers building iOS / Android registration  
**Shared backend:** Same visitor APIs, validation, pass generation, and SMS/WhatsApp as website and AI voice agent  
**Channel identifier:** `channel = "mobile_app"`

---

## 1. Objective

Provide a mobile app flow where a visitor can:

1. Install / open the official Kumbh Mela 2027 app.
2. Verify identity with Aadhaar + mobile OTP.
3. Complete visit details on native screens.
4. Confirm and submit.
5. Store the Kumbh Pass (number + QR) on-device and receive SMS/WhatsApp confirmation.

The app must feel like an official government service: trusted, simple, offline-friendly for viewing the issued pass.

---

## 2. Scope (Mobile App Only)

| In scope | Out of scope (other channels) |
| --- | --- |
| iOS and Android registration UX | Public website wizard |
| On-device pass wallet / My Pass screen | Voice / phone registration |
| Push notification for pass ready (optional) | Browser-only download page as primary UX |
| App store distribution & device permissions | Call-center scripts |

---

## 3. Recommended Stack (Mobile Channel)

| Layer | Choice |
| --- | --- |
| Mobile client | React Native |
| Backend | Same as web: (NestJS / Express) |
| Database | MySQL (shared) |
| Auth | OTP via mobile number |
| Identity | UIDAI Aadhaar eKYC (where legally authorized) |
| Messaging | Gov-approved SMS + WhatsApp Business API |
| Optional notify | FCM / APNs after registration success |
| QR | Server-generated image or payload rendered in app |
| Security | TLS, certificate pinning (recommended), secure storage (Keychain / Keystore), Aadhaar tokenization |

Website may use Next.js; the **app does not embed the website form** as the primary path — it uses native screens calling the same APIs.

---

## 4. User Journey (Mobile App)

```
App launch → Register / Get Kumbh Pass
        │
Consent & purpose notice
        │
Enter Aadhaar number
        │
Send OTP → Enter OTP
        │
Fetch / confirm Aadhaar profile (if eKYC)
        │
Confirm or enter mobile number
        │
Enter remaining details (screen stack)
        │
Review summary
        │
Submit registration
        │
My Pass screen (Pass + QR saved locally)
        │
SMS / WhatsApp sent in background
        │
Optional push: “Your Kumbh Pass is ready”
```

Expected time: about 3–5 minutes.

---

## 5. Screen-by-Screen Specification

### 5.1 Home / Entry

- Official branding: Kumbh Mela 2027.
- Primary action: **Register for Visitor Pass**.
- Secondary: **View My Pass** (empty state until registered).
- Short copy: Aadhaar + OTP required; approximately 3–4 minutes.

### 5.2 Consent

- Clear purpose of registration and data use (Aadhaar).
- **Agree & Continue** / **Not now**.
- Decline → return home; no Aadhaar captured.

### 5.3 Aadhaar Entry

| UI | Rules |
| --- | --- |
| Numeric keypad, 12 digits | Allow grouped display `XXXX XXXX XXXX` |
| Client + server validation | Verhoeff checksum |
| Error | “The Aadhaar number appears to be incorrect. Please re-enter.” |
| Uniqueness | Server rejects duplicate registration |
| Security | Do not write full Aadhaar to analytics or crash logs |

Optional: paste detection from clipboard with user confirmation.

### 5.4 OTP Verification

1. App calls `POST /otp/send` after valid Aadhaar.
2. Screen: 6-digit OTP field, autofill from SMS where OS allows (iOS SMS autofill / Android SMS Retriever — with permission policy compliance).
3. Actions: **Verify**, **Resend OTP**.
4. Max attempts: **3**.
5. Failure copy: “The OTP does not match. Would you like a new OTP?”
6. After lockout: show helpline / try again later.

### 5.5 Aadhaar Profile Confirm (Optional eKYC)

Display fetched:

- Name  
- Gender  
- Date of Birth / Age  

- **Confirm** → continue  
- **This is not me** → in-app support / helpline screen (no silent override if policy forbids)

Without eKYC: collect Name, Age/DOB, Gender on a dedicated profile screen.

### 5.6 Mobile Number

- Masked Aadhaar-linked mobile with **Yes, use this** / **Use a different number**.
- Alternate number: 10-digit Indian mobile validation.
- Bind verified mobile to registration session.

### 5.7 Visit Details (Native Form Stack)

Prefer one primary field group per screen for thumb-friendly UX:

| Screen | Field | Control | Validation |
| --- | --- | --- | --- |
| Emergency | Emergency contact | Phone keypad | 10 digits; ≠ primary mobile |
| Origin | State / Country | Searchable picker | Required |
| Arrival | Arrival date | Native date picker | Future only |
| Travel | Transport mode | Segmented / list | Train, Flight, Bus, Personal Vehicle |
| Stay | Stay type | List | Hotel, Tent City, Akhada, Day Visit |

Show a compact progress bar (e.g. step 3 of 5). Disable **Next** until the current field is valid.

### 5.8 Review & Confirm

Card-style summary (not a dense web table):

- Name  
- Mobile (masked)  
- Arrival  
- Transport  
- Stay  
- State / country  

**Edit** opens the specific screen. **Confirm & Register** calls create API.

### 5.9 My Pass (Success)

Persist on device (encrypted preferences / secure storage):

- Pass number `KM2027-000001`  
- QR image or scannable payload  
- Arrival date  
- Status: Approved  

UI:

- Large pass number  
- Full-screen QR for gate scanning  
- Share / save image  
- Reminder: carry physical Aadhaar + this pass  
- Link openable in browser: `https://kumbh.gov.in/pass/KM2027-000001`

App should work offline for **viewing** an already issued pass.

---

## 6. Database Fields (Shared)

| Field | Source |
| --- | --- |
| Pass Number | Auto generated |
| Aadhaar Number | User |
| Name | Aadhaar / User |
| Age | Aadhaar / User |
| Gender | Aadhaar / User |
| Mobile | OTP verification |
| Emergency Contact | User |
| State | User |
| Arrival Date | User |
| Transport Mode | User |
| Stay Type | User |
| Registration Time | System |
| Status | Approved |
| QR Code | System |
| Channel | `mobile_app` |

Optional metadata (audit only): `app_version`, `os` (`ios` / `android`), `device_id` (hashed).

---

## 7. Validation Rules (Must Match All Channels)

- Aadhaar must be unique.
- Aadhaar must pass Verhoeff checksum.
- Mobile must be OTP verified before registration.
- Arrival date cannot be in the past.
- Emergency contact should not equal primary mobile.
- All mandatory fields completed before INSERT.

---

## 8. API Contracts (Mobile Client)

Use the **same** registration API as the website. Authenticate with OTP session token in `Authorization` header.

| Method | Endpoint | Purpose |
| --- | --- | --- |
| `POST` | `/aadhaar/validate` | Format, checksum, uniqueness |
| `POST` | `/otp/send` | Send OTP |
| `POST` | `/otp/verify` | Verify OTP → session token |
| `GET` | `/aadhaar/profile` | Optional eKYC |
| `POST` | `/visitors` | Create registration |
| `GET` | `/pass/{pass_no}` | Refresh pass / QR |

### Create registration body

```json
{
  "aadhaar_number": "XXXXXXXXXXXX",
  "name": "Rajesh Kumar",
  "age": 34,
  "gender": "Male",
  "mobile": "98XXXXXXXX",
  "emergency_contact": "97XXXXXXXX",
  "state": "Uttar Pradesh",
  "arrival_date": "2027-01-18",
  "transport_mode": "Train",
  "stay_type": "Tent City",
  "channel": "mobile_app",
  "client": {
    "platform": "android",
    "app_version": "1.0.0"
  }
}
```

### Success response

```json
{
  "pass_no": "KM2027-000001",
  "status": "Approved",
  "qr_url": "https://kumbh.gov.in/api/v1/pass/KM2027-000001/qr",
  "pass_url": "https://kumbh.gov.in/pass/KM2027-000001"
}
```

Mobile client must set `channel` to `mobile_app` so reporting can separate app vs website vs voice.

---

## 9. Pass, QR & Messaging

### Pass number

```
KM2027-000001
KM2027-000002
```

Same MySQL sequence as website / voice — no separate number range per channel.

### QR

Prefer encoding only `pass_no` and resolving details server-side on scan:

```json
{
  "pass_no": "KM2027-000001"
}
```

Render QR large enough for outdoor scanning (high contrast, quiet zone, minimum on-screen size ~200dp).

### SMS / WhatsApp

Identical template to website; sent by **backend** after INSERT:

```
Government of India
Dear Rajesh Kumar,
Your Kumbh Mela 2027 registration has been approved.
Pass Number:
KM2027-000001
Arrival Date:
18-Jan-2027
Please carry your Aadhaar Card and this pass during your visit.
Download your pass:
https://kumbh.gov.in/pass/KM2027-000001
```

Optional: after success, send FCM/APNs push: “Your Kumbh Pass KM2027-000001 is ready.”

---

## 10. Mobile-Specific UX Requirements

- Thumb-zone friendly controls; large tap targets (min ~44pt / 48dp).
- Native date / phone keyboards.
- OTP SMS autofill where platform policy allows.
- Progress indicator across registration screens.
- Handle poor network: retry with clear offline errors; do not double-submit registration (idempotency key recommended).
- After success, pin **My Pass** on home for quick access at the mela.
- Support Hindi + English.
- Dark/light: follow OS; keep QR always high-contrast for scanners.
- Do not require account password beyond OTP for registration v1.

---

## 11. Security Notes (Mobile)

- All API calls over HTTPS; consider certificate pinning for production.
- Store session token and pass data in Keychain (iOS) / EncryptedSharedPreferences or Keystore-backed storage (Android).
- Never persist full Aadhaar in plaintext on disk after registration completes; keep masked reference only if needed.
- Screenshot protection on Aadhaar / OTP screens (recommended).
- Audit log: channel=`mobile_app`, app version, platform, outcome.
- Comply with Play / App Store policies, Indian DPDP, and UIDAI rules.

---

## 12. Edge Cases (App)

| Case | Behaviour |
| --- | --- |
| App killed mid-flow | Resume from last safe step only if OTP session still valid; else restart from Aadhaar |
| Duplicate tap on Submit | Idempotent create; show existing pass if already issued for session |
| Already registered Aadhaar | Error + offer **View pass via OTP** recovery if product supports it |
| eKYC mismatch | Support / helpline screen |
| No network on My Pass | Show last cached pass QR |

---

## 13. Acceptance Checklist (Mobile App)

- [ ] Consent before Aadhaar capture  
- [ ] Aadhaar checksum + uniqueness with native error states  
- [ ] OTP send / verify / resend, max 3 attempts; SMS autofill where allowed  
- [ ] eKYC confirm or manual profile screens  
- [ ] Visit fields with native pickers and future-date rule  
- [ ] Review + per-field edit  
- [ ] `channel: "mobile_app"` (+ platform metadata) persisted  
- [ ] My Pass shows number + scannable QR offline  
- [ ] Backend SMS/WhatsApp confirmed  
- [ ] No double registration on retry  
- [ ] Secure storage for token and pass  
- [ ] Hindi / English smoke test on iOS and Android  

---

## 14. Relationship to Other Channels

| Concern | Mobile app | Website | Voice agent |
| --- | --- | --- | --- |
| UX | Native screen stack | Multi-step web form | Conversation |
| Same MySQL visitor table | Yes | Yes | Yes |
| Same OTP / pass / QR / SMS | Yes | Yes | Yes |
| `channel` value | `mobile_app` | `website` | `voice_agent` |

Business rules, validation, pass format, and messaging templates stay identical. Only the client experience differs.
