Skip to content

#019 Share My Trip and SOS Button - #38

Open
Viviiii16 wants to merge 1 commit into
wncc:mainfrom
Viviiii16:issue-019-share-trip-and-sos
Open

Viviiii16 wants to merge 1 commit into
wncc:mainfrom
Viviiii16:issue-019-share-trip-and-sos

Conversation

@Viviiii16

@Viviiii16 Viviiii16 commented Oct 27, 2026 •

Copy link
Copy Markdown

This pull request introduces the "Share Trip" and "SOS" emergency safety features for riders during active trips.

Screenshot 2026-10-27 at 10 02 29 PM Screenshot 2026-10-27 at 10 02 15 PM Screenshot 2026-10-27 at 10 01 54 PM Screenshot 2026-10-27 at 10 01 01 PM Screenshot 2026-10-27 at 10 00 52 PM Screenshot 2026-10-27 at 8 58 55 PM 1. Frontend Components & UI

Created SafetyActionsBar.tsx (mobile/src/components/SafetyActionsBar.tsx):**
Built a responsive, dark-themed safety action bar containing the "Share Trip" and "SOS" buttons.
Integrated Share Trip functionality: calls the backend sharing endpoint and utilizes native OS sharing (react-native Share API) on mobile or writes the tracking URL directly to the clipboard on web platforms.

Integrated SOS functionality: triggers a confirmation modal warning the user, non-blockingly launches the emergency dialer (tel:112), and concurrently logs the user's live GPS coordinates (lat, lng) to the server.

Rider Screen Integration (mobile/app/(rider)/ride/[id].tsx):
Integrated the SafetyActionsBar into the active rider interface sheet.
Configured conditional rendering to display the safety controls dynamically across active ride states (driver_assigned, driver_arrived, and in_progress).

  1. API Client & Networking

Expanded API Interface (mobile/src/lib/api.ts):
Added shareTrip(rideId) to fetch secure tracking URLs from the FastAPI backend.
Added triggerSOS(rideId, lat, lng) to transmit real-time emergency coordinates and record safety logs.

  1. Backend Services & Migrations

Backend Database & Schemas (backend/):
Added Alembic migrations to support ride sharing and emergency SOS event logging in the database schema.
Implemented corresponding FastAPI endpoints (/rides/{id}/share and /rides/{id}/sos) to handle token generation and emergency telemetry.

  1. Testing & Verification:-
    Passed all TypeScript type checks (npx tsc --noEmit), linter evaluations (npx eslint), and Python test suites (python test_all.py --quick).

Closes #19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Share my trip, and an SOS button

1 participant