How lag500ms/rhs-fe-mobile works
Purpose and Entry Points
This is an Expo/React Native Android mobile client for a housing-service workflow: discover housing projects, save projects, submit/manage housing applications, complete eKYC, make payments, receive notifications, report issues, and manage an account. JavaScript starts at index.ts, mounts App.tsx, and is packaged into an Android native shell through android/app/src/main/java/com/anonymous/femobile/MainActivity.kt.
Application Composition and Navigation
App.tsx is the root composition boundary. Feature navigators isolate major flows: authentication in src/features/auth/AuthNavigator.tsx, post-login tabs in src/features/main/MainTabNavigator.tsx, and nested application routing in src/features/application/navigation/ApplicationNavigator.tsx. Other feature-owned navigators, such as src/features/home/navigation/HomeNavigator.tsx and src/features/payment/navigation/PaymentNavigator.tsx, keep screen transitions local to their domains.
Identity, Session, and Onboarding
Authentication screens cover registration, login, password recovery/reset, and OTP verification through src/features/auth/screens/LoginScreen.tsx and related screens. API calls are encapsulated by src/features/auth/api/authApi.ts; shared authenticated-request behavior belongs at src/lib/apiClient.ts, while persisted credentials are bounded by src/lib/tokenStorage.ts. eKYC is a separate identity-verification stage, with its own API and navigator at src/features/ekyc/api/eKycApi.ts and src/features/ekyc/EKycNavigator.tsx. Biometric capabilities are abstracted in src/lib/biometricService.ts.
Housing Discovery and Saved Projects
The home domain fetches housing inventory via src/features/home/api/housingApi.ts, presents listings/details in src/features/home/screens/HomeScreen.tsx and src/features/home/screens/HousingProjectDetailScreen.tsx, and supports full-screen mapping in src/features/home/screens/MapFullScreen.tsx. Address-to-location work is isolated behind src/features/home/services/geocodeService.ts, representing an external geocoding boundary. Saved/wishlist state is server-backed through src/features/saved/api/wishlistApi.ts and rendered by src/features/saved/screens/SavedScreen.tsx.
Housing Application Lifecycle
Applications are a multi-screen workflow: create/basic details, edit, document upload, review/submit, list/history, and contract viewing. Its central server boundaries are src/features/application/api/housingApplicationApi.ts and src/features/application/api/housingDocumentApi.ts; domain contracts reside in src/features/application/types/application.ts. The likely control flow is project selection → application creation/data collection → document upload → review/submission → status tracking/contract access, coordinated by src/features/application/navigation/ApplicationNavigator.tsx.
Payment and External Web Flow
Payment starts from the application domain (src/features/application/components/ApplicationPaymentSection.tsx) and crosses into the payment navigator. src/features/payment/api/paymentApi.ts obtains or updates payment state; src/features/payment/screens/PaymentWebViewScreen.tsx hosts an external payment page, then processing and success screens resolve the return flow. This WebView is a material trust and lifecycle boundary between native app state and a payment provider.
User Engagement and Support
Notifications are fetched through src/features/notification/api/notificationApi.ts, displayed in src/features/notification/screens/NotificationListScreen.tsx, and summarized by src/features/notification/hooks/useNotificationBadge.ts. Issue reporting is isolated in src/features/issue-reports/api/issueReportApi.ts and src/features/issue-reports/screens/IssueReportScreen.tsx. Account profile, password, and account-deletion operations are contained in src/features/user/UserNavigator.tsx and src/features/user/api/userApi.ts.
Runtime and Platform Boundaries
The runtime is TypeScript React Native under Expo, configured by app.json and babel.config.js; native Android build/runtime integration is Gradle-based under android/app/build.gradle and android/app/src/main/AndroidManifest.xml. Shared visual primitives and theming live at src/components/ScreenHeader.tsx and src/lib/theme.ts. Backend services are consumed through feature API modules rather than a visible backend in this repository.
Main entry points: MainTabNavigator.tsx Main tabs · HomeNavigator.tsx Housing discovery · ApplicationNavigator.tsx Application flow · apiClient.ts API client
Components 25
Runtime & shell
- JS entry
index.ts - App root
App.tsx - Android shell
android/app/src/main/java/com/anonymous/femobile/MainActivity.kt - API client · Shared authenticated request boundary.
src/lib/apiClient.ts - Token storage
src/lib/tokenStorage.ts
App navigation
- Auth flow
src/features/auth/AuthNavigator.tsx - Main tabs
src/features/main/MainTabNavigator.tsx - Application flow · Coordinates creation, documents, review, submission, and status.
src/features/application/navigation/ApplicationNavigator.tsx
Identity
- Auth API
src/features/auth/api/authApi.ts - eKYC flow
src/features/ekyc/EKycNavigator.tsx - eKYC API
src/features/ekyc/api/eKycApi.ts - Biometrics
src/lib/biometricService.ts
Housing workflow
- Housing discovery · Listings, project details, and map views.
src/features/home/navigation/HomeNavigator.tsx - Housing API
src/features/home/api/housingApi.ts - Geocoding service
src/features/home/services/geocodeService.ts - Saved projects
src/features/saved/api/wishlistApi.ts - Application API
src/features/application/api/housingApplicationApi.ts - Document API
src/features/application/api/housingDocumentApi.ts - Payment flow
src/features/payment/navigation/PaymentNavigator.tsx - Payment API
src/features/payment/api/paymentApi.ts - Payment WebView · Hosts and resolves the external payment return flow.
src/features/payment/screens/PaymentWebViewScreen.tsx
Engagement & account
- Notifications
src/features/notification/api/notificationApi.ts - Issue reporting
src/features/issue-reports/api/issueReportApi.ts - Account flow · Profile, password, and account deletion.
src/features/user/UserNavigator.tsx - User API
src/features/user/api/userApi.ts
Connections 26
- Android shell → JS entry: hosts bundle
- JS entry → App root: mounts
- App root → Auth flow: unauthenticated
- App root → Main tabs: authenticated
- Auth flow → Auth API: sign-in and recovery
- Auth API → API client: requests
- Auth API → Token storage: persists credentials
- Auth flow → Biometrics: device sign-in
- Main tabs → Housing discovery: discovery
- Main tabs → Application flow: applications
- Main tabs → eKYC flow: verification
- Main tabs → Account flow: account
- Housing discovery → Housing API: inventory
- Housing discovery → Geocoding service: map locations
- Housing discovery → Saved projects: save projects
- Housing discovery → Application flow: select project
- Application flow → Application API: create and track
- Application flow → Document API: upload documents
- Application flow → Payment flow: start payment
- Payment flow → Payment API: payment state
- Payment flow → Payment WebView: provider page
- eKYC flow → eKYC API: verify identity
- Notifications → API client: requests
- Issue reporting → API client: requests
- Account flow → User API: manage profile
- User API → API client: requests