# lokesh-comrade/safezone-sentinel architecture

> Architecture diagram of the GitHub repository lokesh-comrade/safezone-sentinel, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lokesh-comrade/safezone-sentinel
- Repository: https://github.com/lokesh-comrade/safezone-sentinel

## Overview

SafeZone Sentinel combines an Android personal-safety app with a web command portal. The user configures contacts and safe zones, then can trigger SOS manually or through the motion watchdog; the app gathers location and dispatches alerts, calls, and telemetry, which operators monitor in the portal. The Android excerpts show onboarding persistence, service-to-activity shake broadcasts, and Firestore writes; several other capabilities and the portal’s internals are documented only in the README, so those relationships are identified as documented or left unverified.

Main entry points: [`app/src/main/java/com/safezone/sentinel/MainActivity.java`](https://github.com/lokesh-comrade/safezone-sentinel/blob/main/app/src/main/java/com/safezone/sentinel/MainActivity.java) (Safety Dashboard), [`app/src/main/java/com/safezone/sentinel/SplashActivity.java`](https://github.com/lokesh-comrade/safezone-sentinel/blob/main/app/src/main/java/com/safezone/sentinel/SplashActivity.java) (Startup Router), [`web_admin/index.html`](https://github.com/lokesh-comrade/safezone-sentinel/blob/main/web_admin/index.html) (Command Dashboard), [`app/src/main/java/com/safezone/sentinel/OnboardingActivity.java`](https://github.com/lokesh-comrade/safezone-sentinel/blob/main/app/src/main/java/com/safezone/sentinel/OnboardingActivity.java) (Safety Setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App Entry"]
  node_splash["Startup Router"]
  node_onboarding["Safety Setup"]
end

subgraph group_safety["Safety App"]
  node_main["Safety Dashboard<br/>[MainActivity.java]"]
  node_watchdog["Motion Watchdog"]
  node_location["Location Provider"]
end

subgraph group_response["Emergency Response"]
  node_sms["SMS Network"]
  node_phone["Emergency Calling"]
  node_firestore[("Firebase Firestore")]
end

subgraph group_command["Command Portal"]
  node_portal["Command Dashboard<br/>[index.html]"]
  node_map["Map and Geocoding"]
end

node_user(("Mobile User"))
node_operator(("Safety Operator"))

node_user -->|"opens app"| node_splash
node_splash -->|"routes if new"| node_onboarding
node_splash -->|"routes if configured"| node_main
node_user -->|"sets profile"| node_onboarding
node_onboarding -->|"writes profile"| node_firestore
node_user -->|"triggers SOS"| node_main
node_main -->|"starts service"| node_watchdog
node_watchdog -->|"broadcasts shake"| node_main
node_main -->|"requests updates"| node_location
node_main -->|"sends alert"| node_sms
node_main -->|"dials emergency"| node_phone
node_main -->|"writes telemetry"| node_firestore
node_operator -->|"monitors alerts"| node_portal
node_portal -->|"renders locations"| node_map
node_portal -.->|"reads and disarms"| node_firestore

click node_splash "https://github.com/lokesh-comrade/safezone-sentinel/blob/main/app/src/main/java/com/safezone/sentinel/SplashActivity.java"
click node_onboarding "https://github.com/lokesh-comrade/safezone-sentinel/blob/main/app/src/main/java/com/safezone/sentinel/OnboardingActivity.java"
click node_main "https://github.com/lokesh-comrade/safezone-sentinel/blob/main/app/src/main/java/com/safezone/sentinel/MainActivity.java"
click node_watchdog "https://github.com/lokesh-comrade/safezone-sentinel/blob/main/app/src/main/java/com/safezone/sentinel/SentinelService.java"
click node_portal "https://github.com/lokesh-comrade/safezone-sentinel/blob/main/web_admin/index.html"

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_onboarding,node_user toneBlue
class node_main,node_watchdog,node_location toneAmber
class node_sms,node_phone,node_firestore toneMint
class node_portal,node_map toneRose
class node_operator toneIndigo
```

## Components

### App Entry

- [Startup Router](https://github.com/lokesh-comrade/safezone-sentinel/blob/main/app/src/main/java/com/safezone/sentinel/SplashActivity.java): `app/src/main/java/com/safezone/sentinel/SplashActivity.java`
- [Safety Setup](https://github.com/lokesh-comrade/safezone-sentinel/blob/main/app/src/main/java/com/safezone/sentinel/OnboardingActivity.java): `app/src/main/java/com/safezone/sentinel/OnboardingActivity.java`

### Safety App

- [Safety Dashboard](https://github.com/lokesh-comrade/safezone-sentinel/blob/main/app/src/main/java/com/safezone/sentinel/MainActivity.java): `app/src/main/java/com/safezone/sentinel/MainActivity.java`
- [Motion Watchdog](https://github.com/lokesh-comrade/safezone-sentinel/blob/main/app/src/main/java/com/safezone/sentinel/SentinelService.java): `app/src/main/java/com/safezone/sentinel/SentinelService.java`
- **Location Provider**

### Emergency Response

- **SMS Network**
- **Emergency Calling**
- **Firebase Firestore**

### Command Portal

- [Command Dashboard](https://github.com/lokesh-comrade/safezone-sentinel/blob/main/web_admin/index.html): `web_admin/index.html`
- **Map and Geocoding**

### Other components

- **Mobile User**
- **Safety Operator**

## Connections

- Mobile User → Startup Router: opens app (evidence: `README.md`)
- Startup Router → Safety Setup: routes if new (evidence: `app/src/main/java/com/safezone/sentinel/SplashActivity.java`)
- Startup Router → Safety Dashboard: routes if configured (evidence: `app/src/main/java/com/safezone/sentinel/SplashActivity.java`)
- Mobile User → Safety Setup: sets profile (evidence: `README.md`)
- Safety Setup → Firebase Firestore: writes profile (evidence: `app/src/main/java/com/safezone/sentinel/OnboardingActivity.java`)
- Mobile User → Safety Dashboard: triggers SOS (evidence: `README.md`)
- Safety Dashboard → Motion Watchdog: starts service (evidence: `app/src/main/java/com/safezone/sentinel/MainActivity.java`)
- Motion Watchdog → Safety Dashboard: broadcasts shake (evidence: `app/src/main/java/com/safezone/sentinel/SentinelService.java`)
- Safety Dashboard → Location Provider: requests updates (evidence: `README.md`)
- Safety Dashboard → SMS Network: sends alert (evidence: `README.md`)
- Safety Dashboard → Emergency Calling: dials emergency (evidence: `README.md`)
- Safety Dashboard → Firebase Firestore: writes telemetry (evidence: `app/src/main/java/com/safezone/sentinel/MainActivity.java`)
- Safety Operator → Command Dashboard: monitors alerts (evidence: `README.md`)
- Command Dashboard → Map and Geocoding: renders locations (evidence: `README.md`)
- Command Dashboard → Firebase Firestore: reads and disarms
