# raianrashidrimon/echosafe-a_woman_safety_app architecture

> Architecture diagram of the GitHub repository raianrashidrimon/echosafe-a_woman_safety_app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/raianrashidrimon/echosafe-a_woman_safety_app
- Repository: https://github.com/raianrashidrimon/echosafe-a_woman_safety_app

## Overview

1. **Project shape**
   - EchoSafe is a **single-module Android app** in `app/`, written in **Java** with **Gradle Kotlin DSL** build files.
   - The app is structured around **Activity-based screens** rather than fragments or a visible service layer.

2. **Startup and navigation flow**
   - `SplashActivity` is the entry point for app launch.
   - From there, users are routed into the authentication flow (`LoginActivity`, `RegistrationActivity`) or into the main app.
   - `HomeScreenActivity` acts as the central hub from which the safety features are launched.

3. **Authentication boundary**
   - The repo includes `google-services.json`, so **Firebase is integrated**.
   - The login/registration screens are likely backed by Firebase authentication or related Firebase setup, forming the app’s main external backend dependency.
   - This is the main boundary between the device UI and cloud identity services.

4. **Main feature hub**
   - `HomeScreenActivity` is the orchestration layer for the app’s core actions.
   - It connects the user to separate feature screens for SOS, siren, contacts, audio recording, fake call, location, self-defense, and helpline content.

5. **Emergency contacts subsystem**
   - `AddContactActivity` and `ViewContactsActivity` manage the emergency contact list.
   - The README says contacts are limited to **up to 5**, and users can add, view, and delete them.
   - This subsystem is important because it feeds the SOS workflow.

6. **SOS / location sharing path**
   - The SOS feature is described as sending a text message with the user’s **current location** to saved contacts.
   - This implies interaction with **Android location APIs** and **SMS/texting capabilities**.
   - Data flow is: location acquisition → message construction → dispatch to emergency contacts.

7. **Location-only feature**
   - `MainActivity` appears to represent the “Where Am I?” capability from the README.
   - This is a separate location lookup/use case from SOS, likely focused on showing the user’s current position without messaging.
   - It shares the same device-level location dependency as the SOS flow.

8. **Audio evidence and alarm subsystem**
   - `RecordAudioActivity` handles audio capture and saves a recording locally as an **MP3** after a period of time.
   - The app also includes `res/raw/siren_sound.mp3`, which is used by the siren feature.
   - These are two distinct media paths: one records from the microphone, the other plays bundled alarm audio.

9. **Fake call and escape aids**
   - `FakeCallActivity` generates a fake incoming call experience as a social escape mechanism.
   - `SelfDefenceActivity` and `HelpLineActivity` are informational/support screens rather than transactional features.
   - These screens widen the app beyond emergency response into prevention and guidance.

10. **UI/resource layer**
   - The visual layer is defined entirely in XML layouts under `res/layout`, with custom drawables for cards, buttons, and branding.
   - Themes, colors, and style resources live in `res/values`, and the siren sound is packaged as a local raw asset.
   - This makes the app largely self-contained on-device for presentation and media assets.

11. **Platform and infrastructure dependencies**
   - The app relies on standard Android runtime capabilities: **activity navigation, location, audio recording/playback, and messaging/telephony-related functions**.
   - Firebase is the only visible external cloud integration; no separate server backend or API layer is present in the tree.

12. **Testing and quality boundary**
   - There are both **instrumentation tests** (`androidTest`) and **unit tests** (`test`), indicating the project follows standard Android test separation.
   - The repository is designed as a consumer app with a fairly thin codebase and feature-specific screens, which is important for diagramming the architecture as a UI-driven mobile client.

Main entry points: [`EchoSafe/app/src/main/java/com/example/echosafe/HomeScreenActivity.java`](https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/HomeScreenActivity.java) (Home), [`EchoSafe/app/src/main/java/com/example/echosafe/SplashActivity.java`](https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/SplashActivity.java) (Splash), [`EchoSafe/app/src/main/res/layout`](https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/tree/main/EchoSafe/app/src/main/res/layout) (Layouts), [`EchoSafe/app/src/main/java/com/example/echosafe/ViewContactsActivity.java`](https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/ViewContactsActivity.java) (View Contacts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_screens["Screens"]
  node_splash["Splash<br/>activity"]
  node_login["Login<br/>activity<br/>[LoginActivity.java]"]
  node_register["Register<br/>activity"]
  node_home["Home<br/>activity"]
  node_main["Where Am I<br/>activity<br/>[MainActivity.java]"]
  node_contacts_add["Add Contact<br/>activity"]
  node_contacts_view["View Contacts<br/>activity"]
  node_record["Record Audio<br/>activity"]
  node_fakecall["Fake Call<br/>activity"]
  node_selfdefense["Self Defence<br/>activity"]
  node_helpline["Help Line<br/>activity"]
end

subgraph group_platform["Platform"]
  node_location_api(("Location API<br/>android service"))
  node_sms_api(("SMS Dispatch<br/>android service"))
  node_audio_api(("Audio Capture<br/>android service"))
end

subgraph group_assets["Assets"]
  node_layouts["Layouts<br/>xml ui"]
  node_siren["Siren Audio<br/>raw media<br/>[siren_sound.mp3]"]
  node_styles["Themes<br/>resources"]
end

subgraph group_backend["Backend"]
  node_firebase[("Firebase<br/>cloud auth")]
end

node_splash -->|"route to auth"| node_login
node_splash -->|"route to signup"| node_register
node_splash -->|"enter app"| node_home
node_login -->|"authenticate"| node_firebase
node_register -->|"create account"| node_firebase
node_home -->|"manage contacts"| node_contacts_add
node_home -->|"view contacts"| node_contacts_view
node_home -->|"location lookup"| node_main
node_home -->|"record evidence"| node_record
node_home -->|"escape aid"| node_fakecall
node_home -->|"guidance"| node_selfdefense
node_home -->|"support info"| node_helpline
node_home -->|"play alarm"| node_siren
node_contacts_add -->|"persist list"| node_contacts_view
node_contacts_view -->|"alert recipients"| node_sms_api
node_main -->|"read position"| node_location_api
node_home -->|"sos location"| node_location_api
node_home -->|"send sos"| node_sms_api
node_record -->|"capture audio"| node_audio_api
node_home -->|"alarm audio"| node_audio_api
node_layouts -->|"ui shell"| node_splash
node_layouts -->|"ui shell"| node_home
node_styles -->|"theme resources"| node_layouts

click node_splash "https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/SplashActivity.java"
click node_login "https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/LoginActivity.java"
click node_register "https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/RegistrationActivity.java"
click node_home "https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/HomeScreenActivity.java"
click node_main "https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/MainActivity.java"
click node_contacts_add "https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/AddContactActivity.java"
click node_contacts_view "https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/ViewContactsActivity.java"
click node_record "https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/RecordAudioActivity.java"
click node_fakecall "https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/FakeCallActivity.java"
click node_selfdefense "https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/SelfDefenceActivity.java"
click node_helpline "https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/HelpLineActivity.java"
click node_firebase "https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/google-services.json"
click node_layouts "https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/tree/main/EchoSafe/app/src/main/res/layout"
click node_siren "https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/res/raw/siren_sound.mp3"
click node_styles "https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/tree/main/EchoSafe/app/src/main/res/values"

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_splash,node_login,node_register,node_home,node_main,node_contacts_add,node_contacts_view,node_record,node_fakecall,node_selfdefense,node_helpline toneBlue
class node_location_api,node_sms_api,node_audio_api toneAmber
class node_layouts,node_siren,node_styles toneMint
class node_firebase toneRose
```

## Components

### Screens

Activity-based UI flow for launch, auth, hub, and feature screens

- [Splash](https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/SplashActivity.java): activity · Launch entry and routing gate · `EchoSafe/app/src/main/java/com/example/echosafe/SplashActivity.java`
- [Login](https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/LoginActivity.java): activity · Authentication sign-in screen · `EchoSafe/app/src/main/java/com/example/echosafe/LoginActivity.java`
- [Register](https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/RegistrationActivity.java): activity · New user sign-up screen · `EchoSafe/app/src/main/java/com/example/echosafe/RegistrationActivity.java`
- [Home](https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/HomeScreenActivity.java): activity · Main hub for safety actions · `EchoSafe/app/src/main/java/com/example/echosafe/HomeScreenActivity.java`
- [Where Am I](https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/MainActivity.java): activity · Current-location lookup screen · `EchoSafe/app/src/main/java/com/example/echosafe/MainActivity.java`
- [Add Contact](https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/AddContactActivity.java): activity · Create emergency contacts · `EchoSafe/app/src/main/java/com/example/echosafe/AddContactActivity.java`
- [View Contacts](https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/ViewContactsActivity.java): activity · Browse and delete saved contacts · `EchoSafe/app/src/main/java/com/example/echosafe/ViewContactsActivity.java`
- [Record Audio](https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/RecordAudioActivity.java): activity · Microphone recording to local MP3 · `EchoSafe/app/src/main/java/com/example/echosafe/RecordAudioActivity.java`
- [Fake Call](https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/FakeCallActivity.java): activity · Simulated incoming call escape aid · `EchoSafe/app/src/main/java/com/example/echosafe/FakeCallActivity.java`
- [Self Defence](https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/SelfDefenceActivity.java): activity · Safety guidance and tips · `EchoSafe/app/src/main/java/com/example/echosafe/SelfDefenceActivity.java`
- [Help Line](https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/java/com/example/echosafe/HelpLineActivity.java): activity · Support and hotline information · `EchoSafe/app/src/main/java/com/example/echosafe/HelpLineActivity.java`

### Platform

Android device capabilities used by emergency features

- **Location API**: android service · Device location lookup used by SOS and Where Am I
- **SMS Dispatch**: android service · Text message delivery for emergency alerts
- **Audio Capture**: android service · Microphone recording and playback capability

### Assets

Packaged UI and media resources

- [Layouts](https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/tree/main/EchoSafe/app/src/main/res/layout): xml ui · Screen layouts and visual structure · `EchoSafe/app/src/main/res/layout`
- [Siren Audio](https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/src/main/res/raw/siren_sound.mp3): raw media · Bundled alarm sound asset · `EchoSafe/app/src/main/res/raw/siren_sound.mp3`
- [Themes](https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/tree/main/EchoSafe/app/src/main/res/values): resources · Colors, styles, and theme definitions · `EchoSafe/app/src/main/res/values`

### Backend

External cloud identity integration

- [Firebase](https://github.com/raianrashidrimon/echosafe-a_woman_safety_app/blob/main/EchoSafe/app/google-services.json): cloud auth · External identity and backend integration · `EchoSafe/app/google-services.json`

## Connections

- Splash → Login: route to auth · Launch can enter the sign-in flow
- Splash → Register: route to signup · Launch can enter account creation
- Splash → Home: enter app · Authenticated users proceed to the main hub
- Login → Firebase: authenticate · Sign-in is backed by Firebase integration
- Register → Firebase: create account · Registration connects to cloud identity
- Home → Add Contact: manage contacts · Hub opens the emergency contact editor
- Home → View Contacts: view contacts · Hub opens saved-contact management
- Home → Where Am I: location lookup · Hub launches the current-location screen
- Home → Record Audio: record evidence · Hub launches audio capture
- Home → Fake Call: escape aid · Hub launches fake call mode
- Home → Self Defence: guidance · Hub opens self-defense content
- Home → Help Line: support info · Hub opens hotline information
- Home → Siren Audio: play alarm · Hub can trigger the bundled siren sound
- Add Contact → View Contacts: persist list · Saved contacts are surfaced in the viewer
- View Contacts → SMS Dispatch: alert recipients · Emergency alerts are sent to stored contacts
- Where Am I → Location API: read position · Where Am I uses device location
- Home → Location API: sos location · SOS flow depends on current location acquisition
- Home → SMS Dispatch: send sos · SOS dispatch uses messaging/telephony capability
- Record Audio → Audio Capture: capture audio · Recording uses the microphone path
- Home → Audio Capture: alarm audio · Siren and recording features rely on audio capability
- Layouts → Splash: ui shell · Screen presentation is defined in XML layouts
- Layouts → Home: ui shell · Main hub layout is XML-driven
- Themes → Layouts: theme resources · Layouts are supported by shared resource styling
