# krishnn24/safe-her-pbl-project-work- architecture

> Architecture diagram of the GitHub repository krishnn24/safe-her-pbl-project-work-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/krishnn24/safe-her-pbl-project-work-
- Repository: https://github.com/krishnn24/safe-her-pbl-project-work-

## Overview

1. **Repository shape**
   - SafeHer is a **Vite + React + TypeScript** frontend app with a **Capacitor Android wrapper** and a **Supabase backend**.  
   - The README confirms the current emphasis is web-first: most product flows exist in the frontend, while backend enforcement and native capabilities are still being filled in.

2. **Primary runtime layers**
   - The app runs as a browser SPA built from `src/main.tsx` and `src/App.tsx`.
   - A native Android shell exists under `android/`, but it is currently a wrapper around the web app rather than a separate native product.
   - Deployment is likely web-hosted (there is a `vercel.json`), with Android packaging handled through Capacitor/Gradle.

3. **Navigation and page boundaries**
   - Top-level screens live in `src/pages`: `Index`, `Auth`, `Dashboard`, `ResetPassword`, and `NotFound`.
   - This implies a clear boundary between:
     - public marketing/entry experience,
     - authentication flows,
     - authenticated safety dashboard,
     - password recovery.
   - The main app likely routes users between these page-level shells and then composes feature sections inside them.

4. **Feature-oriented UI composition**
   - The UI is organized as reusable sections under `src/components`, especially:
     - landing/content sections like `HeroSection`, `FeaturesSection`, `SecuritySection`, `FAQSection`, `TestimonialsSection`, `Footer`, `Navbar`,
     - safety workflow components under `sos/`,
     - dashboard modules under `dashboard/`,
     - auth helpers under `auth/`.
   - This indicates a mostly **section-based architecture** rather than deeply nested domain services in the UI layer.

5. **SOS and emergency workflow subsystem**
   - The most important domain boundary is the SOS system, centered around:
     - `SOSButton`, `SOSConfirmationDialog`, `SOSActiveOverlay`, `PatternLockOverlay`, `ShakeDetector`,
     - `SOSContext`,
     - services such as `sosService`, `emergencyMessageService`, and `shakeDetectionService`.
   - The architecture suggests emergency actions originate from UI gestures or sensors, flow through shared SOS state, and then fan out into alert creation, recording, messaging, and location capture.

6. **Sensor and discreet-trigger support**
   - The app includes hooks/services for sensor-driven triggers: `useShakeDetection`, `ShakeDetector`, and `shakeDetectionService`.
   - `PatternLockOverlay` indicates a discreet pattern-based activation path.
   - `useAudioRecorder` and `discreteRecordingService` show planned or partial support for audio capture during emergencies, likely intended to integrate more fully once native mobile capabilities are available.

7. **Location and safety context**
   - `useGeolocation` and `locationTrackingService` provide the location subsystem.
   - Dashboard components like `PoliceStationLocatorSection`, `PoliceStationMap`, and `PoliceStationList` indicate the app is not only tracking the user, but also surfacing nearby assistance points.
   - This creates a data flow from device location into dashboard UI and emergency workflows, with location being part of the SOS payload rather than just a standalone feature.

8. **User account and settings domain**
   - Authentication and user management are handled through `useAuth`, `ProtectedRoute`, and pages like `Auth` and `ResetPassword`.
   - `useUserSettings` and dashboard sections such as `ProfileSettingsSection`, `TrustedContactsSection`, and `SOSAlertsSection` suggest user-specific configuration is part of the authenticated experience.
   - The `TrustedContactsSection` is a key data boundary: it likely feeds both alert routing and emergency notification recipients.

9. **Supabase as backend boundary**
   - Backend integration is centered on `src/integrations/supabase/client.ts` and generated `types.ts`.
   - The presence of `supabase/migrations` indicates the data model lives in Supabase SQL migrations, with schema evolution managed alongside the frontend.
   - `supabase/functions/trigger-sos` is the main server-side executable shown in the repo, likely used for emergency-event orchestration or notification triggering.
   - The README notes that **RLS** is intended, so access control is part of the backend boundary even if still in progress.

10. **Shared UI and design system**
   - The `src/components/ui` directory is a large shadcn/ui-style component library: dialogs, forms, tabs, tables, toasts, etc.
   - This is a shared presentation layer used across landing pages, authentication, and dashboard features.
   - It helps keep the domain sections thin and makes the repository’s architecture more composition-driven than framework-specific.

11. **Cross-cutting hooks and utilities**
   - Common behavior is factored into hooks such as `use-mobile`, `use-toast`, `useAudioRecorder`, `useGeolocation`, `useShakeDetection`, and `useUserSettings`.
   - Utility code is concentrated in `src/lib`, including `passwordValidation` and shared helpers.
   - These are the main reuse points that connect feature sections to browser APIs, device capabilities, and UI feedback.

12. **Native mobile boundary**
   - The `android/` project is a standard Gradle/Android app scaffold produced for Capacitor.
   - `MainActivity.java`, `AndroidManifest.xml`, and `file_paths.xml` show the app is already prepared for native packaging and file-access capabilities, but the README makes clear native behavior is still planned/in progress.
   - Architecturally, Android is a delivery shell around the web app rather than the primary business-logic host.

13. **Operational and build tooling**
   - The repo is built with Vite, TypeScript, Tailwind CSS, ESLint, and PostCSS.
   - `capacitor.config.ts`, `vite.config.ts`, and `tailwind.config.ts` define the main build/runtime boundaries.
   - The existence of Bun and npm lockfiles suggests the project has been iterated with multiple package managers, but that does not change the runtime architecture.

14. **Overall data flow**
   - A user enters through the public pages, authenticates, and reaches the dashboard.
   - From the dashboard or SOS overlays, the user can trigger an emergency flow via button, pattern, or shake.
   - That flow gathers context such as location, trusted contacts, and optional recording, then hands off to Supabase-backed persistence/processing and the `trigger-sos` edge function.
   - The architecture is therefore a **frontend-driven safety workflow** with backend services increasingly taking over persistence, authorization, and notification responsibilities.

Main entry points: [`src/App.tsx`](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/App.tsx) (App), [`src/pages/Dashboard.tsx`](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/pages/Dashboard.tsx) (Dashboard), [`src/pages/Index.tsx`](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/pages/Index.tsx) (Home), [`src/services/sosService.ts`](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/services/sosService.ts) (SOS Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web App"]
  node_main(("Main<br/>SPA entry<br/>[main.tsx]"))
  node_app["App<br/>router shell<br/>[App.tsx]"]
  node_index_page["Home<br/>landing page<br/>[Index.tsx]"]
  node_notfound_page["404<br/>fallback page<br/>[NotFound.tsx]"]
  node_navbar["Navbar<br/>navigation<br/>[Navbar.tsx]"]
  node_hero["Hero<br/>landing section<br/>[HeroSection.tsx]"]
  node_features["Features<br/>landing section"]
  node_security["Security<br/>landing section"]
end

subgraph group_sos["SOS System"]
  node_sos_context(("SOS Context<br/>shared state<br/>[SOSContext.tsx]"))
  node_sos_button["SOS Button<br/>trigger UI<br/>[SOSButton.tsx]"]
  node_sos_overlay["Active Overlay<br/>emergency UI"]
  node_pattern_lock["Pattern Lock<br/>discreet trigger"]
  node_shake_detector["Shake Detector<br/>sensor UI<br/>[ShakeDetector.tsx]"]
  node_sos_service["SOS Service<br/>workflow service<br/>[sosService.ts]"]
  node_message_service["Message Service<br/>alert payload"]
  node_location_service["Location Service"]
  node_recording_service["Recording Service<br/>audio capture"]
end

subgraph group_account["Account & Dashboard"]
  node_auth_page["Auth<br/>login page<br/>[Auth.tsx]"]
  node_dashboard_page["Dashboard<br/>private page<br/>[Dashboard.tsx]"]
  node_reset_page["Reset<br/>recovery page<br/>[ResetPassword.tsx]"]
  node_use_auth(("Auth Hook<br/>[useAuth.ts]"))
  node_protected_route["Protected Route<br/>route guard<br/>[ProtectedRoute.tsx]"]
  node_settings["Settings<br/>profile section"]
  node_contacts["Contacts<br/>dashboard section"]
  node_alerts["SOS Alerts<br/>dashboard section"]
  node_locator["Police Locator<br/>dashboard section"]
end

subgraph group_backend["Supabase"]
  node_supabase_client[("Supabase Client<br/>backend client<br/>[client.ts]")]
  node_supabase_types["Supabase Types<br/>generated types<br/>[types.ts]"]
  node_trigger_sos["Trigger SOS<br/>edge function<br/>[index.ts]"]
  node_migrations["Migrations<br/>schema SQL"]
end

subgraph group_mobile["Android Shell"]
  node_main_activity["Main Activity<br/>android shell<br/>[MainActivity.java]"]
  node_manifest["Manifest<br/>android config"]
end

node_main -->|"boots"| node_app
node_app -->|"routes"| node_index_page
node_app -->|"routes"| node_auth_page
node_app -->|"routes"| node_dashboard_page
node_app -->|"routes"| node_reset_page
node_app -->|"fallback"| node_notfound_page
node_index_page -->|"composes"| node_navbar
node_index_page -->|"composes"| node_hero
node_index_page -->|"composes"| node_features
node_index_page -->|"composes"| node_security
node_app -->|"guards"| node_protected_route
node_protected_route -->|"permits"| node_dashboard_page
node_auth_page -->|"uses"| node_use_auth
node_dashboard_page -->|"composes"| node_settings
node_dashboard_page -->|"composes"| node_contacts
node_dashboard_page -->|"composes"| node_alerts
node_dashboard_page -->|"composes"| node_locator
node_sos_button -->|"updates"| node_sos_context
node_pattern_lock -->|"updates"| node_sos_context
node_shake_detector -->|"updates"| node_sos_context
node_sos_context -->|"orchestrates"| node_sos_service
node_sos_service -->|"builds"| node_message_service
node_sos_service -->|"includes"| node_location_service
node_sos_service -->|"includes"| node_recording_service
node_sos_service -->|"persists"| node_supabase_client
node_supabase_client -->|"typed by"| node_supabase_types
node_trigger_sos -->|"backed by"| node_migrations
node_dashboard_page -->|"loads"| node_supabase_client
node_use_auth -->|"authenticates"| node_supabase_client
node_main_activity -->|"declared in"| node_manifest
node_main_activity -->|"hosts"| node_app

click node_main "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/main.tsx"
click node_app "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/App.tsx"
click node_index_page "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/pages/Index.tsx"
click node_auth_page "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/pages/Auth.tsx"
click node_dashboard_page "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/pages/Dashboard.tsx"
click node_reset_page "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/pages/ResetPassword.tsx"
click node_notfound_page "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/pages/NotFound.tsx"
click node_navbar "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/Navbar.tsx"
click node_hero "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/HeroSection.tsx"
click node_features "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/FeaturesSection.tsx"
click node_security "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/SecuritySection.tsx"
click node_sos_context "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/contexts/SOSContext.tsx"
click node_sos_button "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/sos/SOSButton.tsx"
click node_sos_overlay "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/sos/SOSActiveOverlay.tsx"
click node_pattern_lock "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/sos/PatternLockOverlay.tsx"
click node_shake_detector "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/sos/ShakeDetector.tsx"
click node_sos_service "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/services/sosService.ts"
click node_message_service "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/services/emergencyMessageService.ts"
click node_location_service "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/services/locationTrackingService.ts"
click node_recording_service "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/services/discreteRecordingService.ts"
click node_use_auth "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/hooks/useAuth.ts"
click node_protected_route "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/auth/ProtectedRoute.tsx"
click node_settings "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/dashboard/ProfileSettingsSection.tsx"
click node_contacts "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/dashboard/TrustedContactsSection.tsx"
click node_alerts "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/dashboard/SOSAlertsSection.tsx"
click node_locator "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/dashboard/PoliceStationLocatorSection.tsx"
click node_supabase_client "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/integrations/supabase/client.ts"
click node_supabase_types "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/integrations/supabase/types.ts"
click node_trigger_sos "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/supabase/functions/trigger-sos/index.ts"
click node_migrations "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/supabase/migrations/20251208132143_6b4787d5-b612-4b60-afae-5998ab4c44aa.sql"
click node_main_activity "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/android/app/src/main/java/com/safeher/app/MainActivity.java"
click node_manifest "https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/android/app/src/main/AndroidManifest.xml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_app,node_index_page,node_notfound_page,node_navbar,node_hero,node_features,node_security toneBlue
class node_sos_context,node_sos_button,node_sos_overlay,node_pattern_lock,node_shake_detector,node_sos_service,node_message_service,node_location_service,node_recording_service toneAmber
class node_auth_page,node_dashboard_page,node_reset_page,node_use_auth,node_protected_route,node_settings,node_contacts,node_alerts,node_locator toneMint
class node_supabase_client,node_supabase_types,node_trigger_sos,node_migrations toneRose
class node_main_activity,node_manifest toneIndigo
```

## Components

### Web App

Vite + React SPA entry, routing, and page shells.

- [Main](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/main.tsx): SPA entry · Bootstraps the React application. · `src/main.tsx`
- [App](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/App.tsx): router shell · Top-level app composition and route wiring. · `src/App.tsx`
- [Home](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/pages/Index.tsx): landing page · Public entry and marketing experience. · `src/pages/Index.tsx`
- [404](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/pages/NotFound.tsx): fallback page · Unknown-route fallback. · `src/pages/NotFound.tsx`
- [Navbar](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/Navbar.tsx): navigation · Top-level site navigation. · `src/components/Navbar.tsx`
- [Hero](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/HeroSection.tsx): landing section · Primary landing-page call to action. · `src/components/HeroSection.tsx`
- [Features](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/FeaturesSection.tsx): landing section · Product feature overview. · `src/components/FeaturesSection.tsx`
- [Security](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/SecuritySection.tsx): landing section · Trust and safety positioning. · `src/components/SecuritySection.tsx`

### SOS System

Emergency trigger, sensor, and alert workflow.

- [SOS Context](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/contexts/SOSContext.tsx): shared state · Shared emergency state and coordination point. · `src/contexts/SOSContext.tsx`
- [SOS Button](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/sos/SOSButton.tsx): trigger UI · Primary emergency activation control. · `src/components/sos/SOSButton.tsx`
- [Active Overlay](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/sos/SOSActiveOverlay.tsx): emergency UI · In-progress emergency screen. · `src/components/sos/SOSActiveOverlay.tsx`
- [Pattern Lock](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/sos/PatternLockOverlay.tsx): discreet trigger · Secret activation interface. · `src/components/sos/PatternLockOverlay.tsx`
- [Shake Detector](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/sos/ShakeDetector.tsx): sensor UI · Device-motion trigger listener. · `src/components/sos/ShakeDetector.tsx`
- [SOS Service](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/services/sosService.ts): workflow service · Orchestrates emergency event creation. · `src/services/sosService.ts`
- [Message Service](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/services/emergencyMessageService.ts): alert payload · Builds emergency messages and notification content. · `src/services/emergencyMessageService.ts`
- [Location Service](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/services/locationTrackingService.ts): location service · Captures and tracks location for emergencies. · `src/services/locationTrackingService.ts`
- [Recording Service](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/services/discreteRecordingService.ts): audio capture · Discrete audio capture support for incidents. · `src/services/discreteRecordingService.ts`

### Account & Dashboard

Authenticated user experience and safety settings.

- [Auth](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/pages/Auth.tsx): login page · Sign-in and sign-up flow. · `src/pages/Auth.tsx`
- [Dashboard](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/pages/Dashboard.tsx): private page · Authenticated safety workspace. · `src/pages/Dashboard.tsx`
- [Reset](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/pages/ResetPassword.tsx): recovery page · Password reset flow. · `src/pages/ResetPassword.tsx`
- [Auth Hook](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/hooks/useAuth.ts): hook · Client authentication state and helpers. · `src/hooks/useAuth.ts`
- [Protected Route](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/auth/ProtectedRoute.tsx): route guard · Blocks unauthenticated access to private pages. · `src/components/auth/ProtectedRoute.tsx`
- [Settings](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/dashboard/ProfileSettingsSection.tsx): profile section · User profile and preferences management. · `src/components/dashboard/ProfileSettingsSection.tsx`
- [Contacts](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/dashboard/TrustedContactsSection.tsx): dashboard section · Trusted contact management. · `src/components/dashboard/TrustedContactsSection.tsx`
- [SOS Alerts](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/dashboard/SOSAlertsSection.tsx): dashboard section · Emergency alert history and status. · `src/components/dashboard/SOSAlertsSection.tsx`
- [Police Locator](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/components/dashboard/PoliceStationLocatorSection.tsx): dashboard section · Nearby assistance discovery. · `src/components/dashboard/PoliceStationLocatorSection.tsx`

### Supabase

Database, auth boundary, migrations, and edge function.

- [Supabase Client](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/integrations/supabase/client.ts): backend client · Frontend database/auth integration point. · `src/integrations/supabase/client.ts`
- [Supabase Types](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/src/integrations/supabase/types.ts): generated types · Typed schema bindings for backend data. · `src/integrations/supabase/types.ts`
- [Trigger SOS](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/supabase/functions/trigger-sos/index.ts): edge function · Server-side emergency orchestration entrypoint. · `supabase/functions/trigger-sos/index.ts`
- [Migrations](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/supabase/migrations/20251208132143_6b4787d5-b612-4b60-afae-5998ab4c44aa.sql): schema SQL · Supabase schema and access control evolution. · `supabase/migrations/20251208132143_6b4787d5-b612-4b60-afae-5998ab4c44aa.sql`

### Android Shell

Capacitor-wrapped Android delivery project.

- [Main Activity](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/android/app/src/main/java/com/safeher/app/MainActivity.java): android shell · Capacitor Android host activity. · `android/app/src/main/java/com/safeher/app/MainActivity.java`
- [Manifest](https://github.com/krishnn24/safe-her-pbl-project-work-/blob/main/android/app/src/main/AndroidManifest.xml): android config · Android app configuration and entry metadata. · `android/app/src/main/AndroidManifest.xml`

## Connections

- Main → App: boots · Application startup loads the top-level app shell.
- App → Home: routes · Public landing route.
- App → Auth: routes · Authentication route.
- App → Dashboard: routes · Authenticated dashboard route.
- App → Reset: routes · Password recovery route.
- App → 404: fallback · Unhandled routes land here.
- Home → Navbar: composes · Landing page uses shared navigation.
- Home → Hero: composes · Landing page feature entry.
- Home → Features: composes · Landing feature overview.
- Home → Security: composes · Trust and safety section.
- App → Protected Route: guards · Private routes are wrapped by auth protection.
- Protected Route → Dashboard: permits · Authenticated users reach the dashboard.
- Auth → Auth Hook: uses · Authentication UI depends on auth state.
- Dashboard → Settings: composes · Profile configuration section.
- Dashboard → Contacts: composes · Trusted contacts section.
- Dashboard → SOS Alerts: composes · Alert history and status section.
- Dashboard → Police Locator: composes · Nearby assistance locator section.
- SOS Button → SOS Context: updates · Activation state flows through shared SOS context.
- Pattern Lock → SOS Context: updates · Discreet activation also feeds SOS state.
- Shake Detector → SOS Context: updates · Sensor trigger feeds emergency state.
- SOS Context → SOS Service: orchestrates · Shared state launches emergency workflow.
- SOS Service → Message Service: builds · Emergency message content is prepared.
- SOS Service → Location Service: includes · Location context is collected for alerts.
- SOS Service → Recording Service: includes · Optional incident recording is captured.
- SOS Service → Supabase Client: persists · Emergency events and related data use Supabase.
- Supabase Client → Supabase Types: typed by · Backend schema bindings drive client types.
- Trigger SOS → Migrations: backed by · Edge function operates on the Supabase schema.
- Dashboard → Supabase Client: loads · Dashboard sections read backend data.
- Auth Hook → Supabase Client: authenticates · Auth hook depends on Supabase auth/client APIs.
- Main Activity → Manifest: declared in · Android entrypoint is configured by the manifest.
- Main Activity → App: hosts · Android shell wraps the web app.
