Below is a step-by-step, plain-language checklist of every missing or incomplete feature, API, and socket integration in the LifeLine codebase. This is written for maximum clarity—no technical jargon, just what’s missing and what needs to be done.
- NGO Resource Management
- There are no backend APIs for NGOs to add, update, or remove resources like blood banks, beds, or volunteers.
- No way for NGOs to see or manage their resources in the backend.
- NGO Dashboard Data
- The backend does not collect or send summary stats for NGOs (like number of cases, resources, or payments).
- NGO Payment Logic
- Payment endpoints exist, but there is no logic for actually processing payouts, updating payment status, or letting admins review payments.
- Helper History
- Helpers cannot get a list of all their past cases or services from the backend.
- Medical Profile CRUD
- The backend has some medical data logic, but full create, read, update, and delete (CRUD) for user medical info is not complete or robust.
- Medical info is not always included in SOS/emergency flows.
- Admin Endpoints
- There are no backend APIs for admins to approve or reject NGOs, helpers, or manage system data.
- Socket Events
- Not all real-time events are implemented. For example, NGOs and helpers do not get live updates about resources, payments, or admin actions.
- NGO Registration Screen
- There is no screen for NGOs to sign up, upload documents, or select their service type.
- NGO Dashboard
- NGOs cannot see a dashboard with their stats, resources, or payments.
- NGO Profile Page
- There is no detailed page showing NGO info, status, and contact details for users/helpers.
- NGO Payment UI
- NGOs cannot view their payment history or start a payment from the frontend.
- NGO Resource Management UI
- NGOs cannot add, edit, or remove resources (like blood, beds, volunteers) from the frontend.
- Helper Payment/Earnings Screen
- Helpers cannot see their earnings, payment status, or transaction history.
- Helper History Screen
- Helpers cannot see a list of their past cases or services.
- Medical Profile CRUD UI
- Users cannot fully add, edit, or delete their medical info in the app.
- SOS AI Triage UI
- The SOS AI screen is present, but does not have full voice-to-text, text-to-voice, or backend integration.
- Nearby NGOs
- The Nearby screen shows NGOs, but you cannot tap to see full NGO profiles or request help from an NGO.
- Admin Management UIs
- There are no screens for admins to approve/reject NGOs or helpers, or manage system data.
- Profile Completion UI
- There is no progress bar or checklist showing users/helpers/NGOs what steps are missing in their profile.
- Socket Integration
- Many screens do not use real-time updates (for example, payment status, resource changes, or admin notifications).
- Error Handling & Loading States
- Some screens do not show errors or loading spinners when waiting for data or when something goes wrong.
- NGO API
- The frontend does not call all the backend NGO APIs (registration, dashboard, payments, resource management).
- Helper Payment API
- The frontend does not use the helper payment endpoints.
- Medical Profile API
- The frontend does not fully use the backend medical info endpoints.
- Socket Events
- Real-time updates for NGOs, helpers, and users are not fully connected in the frontend (for example, payment status, resource changes, admin actions).
- Testing
- There are no end-to-end tests for these new flows.
- Backend:
- Build APIs for NGO resource management, dashboard stats, and payment logic.
- Add endpoints for helper history, admin approvals, and robust medical CRUD.
- Implement all missing socket events for real-time updates.
- Frontend:
- Create screens for NGO registration, dashboard, profile, payments, and resource management.
- Add helper earnings/history screens, medical CRUD, and admin management UIs.
- Add profile completion progress bars/checklists.
- Integrate all missing APIs and sockets.
- Improve error handling and loading states everywhere.
- Testing:
- Write end-to-end tests for all new features and flows.
- Documentation:
- Update API docs and UI guides for all new features.
This checklist is your roadmap. Work through each item to make LifeLine complete, reliable, and user-friendly for everyone.
This plan outlines the specific steps needed to bridge the gap between the existing frontend UI and the missing backend features, with a focus on real-time Socket.IO integration, external AI integrations, and missing application screens.
The current Helper Dashboard UI is hardcoded. We need a dedicated metrics endpoint.
- Model Update: Add
EarningandServiceLogschemas or aggregate fromEmergencymodel. - Controller:
HelperController.getDashboardMetrics(helperId)-
Endpoint:
GET /api/helpers/v1/:id/dashboard -
Payload:
{ "today": { "onlineTime": "3h 15m", "callsAttended": 5 }, "earnings": { "total": 45200, "pending": 3400, "weeklyGrowth": "+12%" }, "stats": { "casesSolved": 124, "activeCases": 1 }, "recentActivity": [ { "time": "10:30 AM", "title": "Cardiac Arrest #4092", "status": "Completed", "payout": 500 } ] }
-
We need to support full NGO registration alongside fetching nearby organizations.
-
New Module:
NGO- Schema:
Name, Location, ServiceType, Contact, Distance, RegistrationStatus, Documents - Controller:
NGOController.getNearby(lat, lng, radius),NGOAuth.register() - Endpoint:
GET /api/ngo/v1/nearby,POST /api/ngo/v1/register
- Schema:
-
Frontend Signup Integration: Allow users to choose "NGO" on the signup page and complete an NGO-specific registration flow.
The UserController currently only handles a reference to medicalId.
- Implementation: Implement full CRUD in
MedicalController. - Integration: Ensure
EmergencyService.triggerSOSfetches the latest medical data to include in the SOS alert broadcast to helpers.
- User Flow: When the user clicks the global SOS button, SOS mode activates immediately. They are redirected to a dedicated "SOS Activate AI Screen".
- Sarvam AI Integration: Utilize Sarvam API for real-time, regional language voice interactions.
- Speech-to-Text (STT): Transcribe the user's spoken emergency details, parsing language, nuances, and urgency.
- Text-to-Speech (TTS): Allow the AI Triage agent to respond back with clarifying questions or reassuring voice instructions in natural audio.
- Implementation:
- Setup React Native / Expo audio capture.
- Stream audio to backend/Sarvam AI.
- Build UI with audio waveforms / glowing mic indications to provide interaction feedback.
- Replace hardcoded values in
app/Helper/Dashboard.tsxwith selectors fromhelperSliceor a newdashboardSlice. - Add
useEffectto fetch dashboard data on mount. - Wire
StatusToggleto theupdateAvailabilitythunk.
- Update
app/User/Nearby.tsxto useuseSelectorfor the helper list. - Fetch real NGOs from the new
GET /api/ngo/v1/nearbyendpoint.
- Remove Mock Data: Update
app/(global)/Map.tsxto readhelperLocationanduserLocationfromemergencySlice. - Socket Subscription: Use
socketService.onUserLocationUpdateto move markers in real-time. - Auto-Routing: Ensure the map re-calculates the route geometry only when the distance moved exceeds a threshold (e.g., 50m) to save performance.
The overall flow has gaps that need to be built:
- User Screens:
User/SOSActivate(The Sarvam AI Voice Triage interact screen).User/MedicalProfile(Dedicated full CRUD forms for updating medical conditions/history).
- Helper Screens:
Helper/Registration(Helper specific onboarding and verified documents upload).Helper/History(Record of past received and solved emergencies).
- NGO Screens:
SignupAdd NGO type branching in main registration.NGO/Dashboard(Resource overview, incoming nearby cases).NGO/ResourceMgr(Management flow for blood banks, beds, volunteers).
- Implement
Helper.getDashboardlogic. - Implement
NGO.getNearbyandNGOAuth.registercontrollers. - Add
Messageschema and persistence inemergency:sendMessage. - Verify
triage.handler.mjsis correctly linked to AI service.
- Add
TRIAGEemitters tosocketService.ts. - Add listeners for
emergency:joined,emergency:message,location:userLocationUpdate. - Create
socketMiddlewarein Redux to handle incoming socket events. - Sarvam AI APIs: Integrate Sarvam STT and TTS in the triage message-processing loop.
- Implement user flow branching: NGO vs Helper vs User Registration.
- Build the
User/SOSActivatescreen and plug in Sarvam audio streams. - Build missing pages:
Helper/Registration,Helper/History,User/MedicalProfile,NGO/Dashboard. - Connect
HelperDashboardtohelperSlicemetrics. - Replace
Nearby.tsxstatic list withnearbyHelpersfromemergencySlice. - Implement the "Incoming Emergency" alert modal for helpers.
- End-to-End SOS: Trigger SOS (User) -> Receive Alert (Helper) -> Accept (Helper) -> Track Map (Both).
- AI Triage with Sarvam: Click SOS -> SOS Activate Screen -> Speak problem (STT) -> Receive instruction (TTS) -> Broadcast details.
- Offline Resilience: Test socket reconnection logic on network switch.
Note: Priority should be given to the Emergency Alerting Flow as it is the core "Life-Saving" feature of the app.