How biasmanan2010/zeppay works
Purpose and Targets
Zep Pay is an offline-first UPI payment product centered on QR payment initiation, biometric confirmation, and Android USSD/123PAY dialing; users enter their UPI PIN outside the app. The primary client is Flutter, with Android-native telephony integration. Separate React PWA/iPhone web delivery supports upi:// handoff rather than offline dialing.
• lib/main.dart
• zeppay-pwa/src/main.jsx
• .github/workflows/android-apk.yml
Application Bootstrap, State, and Navigation
Flutter starts in main.dart, composes app-wide Riverpod providers, theme, locale, routing, and persisted state. Presentation screens consume services and repositories rather than directly owning platform/network operations. The home shell is the central post-auth navigation boundary.
• lib/main.dart
• lib/presentation/providers/app_providers.dart
• lib/core/routing/app_router.dart
Identity and Onboarding
The auth flow collects onboarding permissions, phone identity, and OTP verification before payment use. OTP behavior is split between Flutter client services and a server-side proxy; a development fallback code is documented. Biometric checks provide local confirmation before payment rail handoff.
• lib/presentation/screens/auth/onboarding_permissions.dart
• lib/presentation/screens/auth/otp_screen.dart
• lib/data/services/otp_service.dart
Payment Orchestration
Payment flow moves from QR parsing/scanning to recipient and amount capture, confirmation/biometric approval, then a payment session/rail decision. Status tracking and verification are separate from UI, allowing call/USSD completion to drive the outcome stage.
• lib/presentation/screens/pay/scan_screen.dart
• lib/data/services/payment_session.dart
• lib/data/services/rail_engine.dart
Android Platform Boundary
Flutter reaches Android features through platform-specific service implementations. Kotlin bridges detect telephony/carrier conditions, initiate calls, and handle USSD interaction/accessibility overlays; these capabilities are Android-only. The manifest and accessibility service configuration define the privileged OS boundary.
• android/app/src/main/kotlin/in/zeppay/zeppay/MainActivity.kt
• android/app/src/main/kotlin/in/zeppay/zeppay/TelephonyBridge.kt
• android/app/src/main/kotlin/in/zeppay/zeppay/UssdAccessibilityService.kt
Data, Offline Domain Features, and Sync
Local JSON-backed storage is the primary persistence layer and supports offline-first payment-adjacent state. Domain services cover cards/NFC, contacts, autopay, splits, referrals, inventory/semiconductor workflows, notifications, and sync. Repositories isolate persisted models from screens and permit a future backend-store replacement.
• lib/data/local/app_store.dart
• lib/data/services/user_card_repository.dart
• lib/data/services/sync_service.dart
Backend and External Infrastructure
A Node service, intended for Render, keeps Twilio credentials and Supabase service-role access off-device. It provides OTP/proxy operations and health checks. Supabase SQL schemas define hosted user, OTP, app configuration, referral, card, and semiconductor data; Flutter’s Supabase service is the client integration seam.
• backend/server.js
• backend/db.js
• supabase/schema.sql
Web and Deployment Variants
The Flutter web target supports Android-browser usage and iOS redirect behavior. The independent React PWA is the iPhone-oriented site, using UPI deep-link handoff. GitHub Actions produces APK and web artifacts, while GitHub Pages hosts published static variants.
• lib/core/ios_web_redirect.dart
• zeppay-pwa/src/App.jsx
• gh-pages-root/zeppay/profile/index.html
Main entry points: main.dart App bootstrap · app_router.dart App router · payment_session.dart Payment session · app_store.dart Local app store
Components 21
Flutter app
Offline-first payment client.
- App bootstrap · Composes providers, theme, locale, routing, and persisted state.
lib/main.dart - App providers
lib/presentation/providers/app_providers.dart - App router · Routes onboarding and post-auth home flows.
lib/core/routing/app_router.dart - Onboarding and OTP · Collects permissions, phone identity, and OTP.
lib/presentation/screens/auth/otp_screen.dart - OTP service · Uses server proxy behavior with a development fallback.
lib/data/services/otp_service.dart - QR scan and payment entry · Parses QR, captures recipient and amount, and requests confirmation.
lib/presentation/screens/pay/scan_screen.dart - Payment session · Tracks payment stages and outcome verification apart from UI.
lib/data/services/payment_session.dart - Rail engine · Selects the applicable payment rail after biometric approval.
lib/data/services/rail_engine.dart - Local app store · Primary offline-first persisted state.
lib/data/local/app_store.dart - Card repository · Isolates persisted card and NFC models from screens.
lib/data/services/user_card_repository.dart - Sync service · Synchronizes offline domain state when connectivity permits.
lib/data/services/sync_service.dart
Android platform
Native telephony and USSD boundary.
- Flutter Android bridge · Platform channel entry point for Android capabilities.
android/app/src/main/kotlin/in/zeppay/zeppay/MainActivity.kt - Telephony bridge · Detects carrier conditions and initiates calls.
android/app/src/main/kotlin/in/zeppay/zeppay/TelephonyBridge.kt - USSD accessibility · Handles USSD interaction and overlays; users enter PIN outside the app.
android/app/src/main/kotlin/in/zeppay/zeppay/UssdAccessibilityService.kt
Backend and data
Protected server integrations and hosted schema.
- OTP proxy backend · Keeps Twilio and Supabase service-role credentials off-device.
backend/server.js - Backend data access
backend/db.js - Supabase schema · Defines user, OTP, configuration, referral, card, and semiconductor data.
supabase/schema.sql
Web variants and delivery
Browser-specific payment handoff and publishing.
- iOS web redirect · Redirects iOS browser users to UPI handoff.
lib/core/ios_web_redirect.dart - iPhone React PWA · Uses upi:// deep-link handoff instead of offline dialing.
zeppay-pwa/src/App.jsx - APK and web build · Builds Android APK and web artifacts.
.github/workflows/android-apk.yml - Published static site
gh-pages-root/zeppay/profile/index.html
Connections 20
- App bootstrap → App providers: initializes
- App bootstrap → App router: configures
- App router → Onboarding and OTP: routes unauthenticated users
- Onboarding and OTP → OTP service: verifies phone
- OTP service → OTP proxy backend: proxies OTP
- App router → QR scan and payment entry: opens payment flow
- QR scan and payment entry → Payment session: creates session
- Payment session → Rail engine: requests rail decision
- Rail engine → Flutter Android bridge: invokes Android rail
- Flutter Android bridge → Telephony bridge: bridges calls
- Telephony bridge → USSD accessibility: drives USSD interaction
- Payment session → Local app store: persists status offline
- Card repository → Local app store: reads and writes
- Sync service → Local app store: syncs local state
- OTP proxy backend → Backend data access: uses
- Backend data access → Supabase schema: accesses
- App bootstrap → iOS web redirect: applies on Flutter web
- iPhone React PWA → Published static site: published as static site
- APK and web build → Published static site: publishes web artifacts
- APK and web build → App bootstrap: builds Flutter targets