A Zero-Trust, Predictive Safety Ecosystem
Next-generation intelligent safety platform leveraging Edge AI and zero-touch triggers.
In high-stress emergency situations, existing personal safety applications consistently fail at their core premise. They rely on a fundamentally reactive model: expecting a victim who is under physical threat, harassment, or extreme panic to possess the fine motor skills and time required to pull out a phone, unlock the screen, navigate to an app, and manually press an SOS button.
When a real threat occurs, physical interaction with a device is often the first thing compromised. By the time a user manages to trigger an alarm, the critical window for prevention has already closed. Current apps act as passive digital pagers, failing victims exactly when they need an active shield the most.
SafeSphere AI removes the burden of action from the victim. We are shifting personal safety from a model of reactive panic to predictive intelligence and zero-touch intervention.
We built a platform that acts as an autonomous digital bodyguard. By continuously analyzing environmental, spatial, and behavioral telemetry, SafeSphere detects risks before they escalate. If a threat materializes or the user is incapacitated, the system triggers invisible, hardware-level safeguardsβbroadcasting live location, recording encrypted evidence, and notifying guardiansβall without requiring a single tap on the screen. SafeSphere knows when you are in danger and acts on your behalf.
Instead of waiting for an emergency, the system calculates a real-time Safety Score (0-100) using high-frequency telemetry data:
- Spatial: Live GPS against crowd-sourced crime heatmaps.
- Environmental: Ambient light sensor data and time-of-day.
- Behavioral: Accelerometer motion patterns and travel speed anomalies.
When physical interaction with a device is compromised, SafeSphere provides alternative, invisible triggers:
- Voice Recognition: Always-listening local ML model detecting distress keywords (
"Help","Stop"). - Inertial Triggers: High-G accelerometer shake detection.
- Hardware Gestures: Volume button sequence mapping.
Upon emergency activation, the system bypasses user interaction to secure verifiable, tamper-proof evidence:
- Simultaneous front/back camera photo capture.
- Continuous audio/video recording.
- Instant Cloud Sync: AES-256 encrypted payloads uploaded immediately to prevent data loss if the device is destroyed.
Authorized contacts receive real-time access to a low-latency dashboard featuring:
- High-precision GPS tracking.
- Device health (Battery %, Network strength).
- Live Safety Score and activity status.
The platform operates on a Feature-First Clean Architecture spanning the mobile client, Supabase backend, Edge Functions, and AI processing layer. Every component is purpose-built for high-throughput safety analytics at scale:
flowchart TD
subgraph Client ["π Client Tier β React Native Expo"]
direction TB
UI["βοΈ Feature UI<br>(Expo Router + NativeWind)"]
State["π§ Local State & Cache<br>(Zustand + TanStack Query)"]
UI --> State
Sync["π Sync Engine<br>(Expo SQLite Outbox)"]
State --> Sync
end
Client -- "REST / Realtime" --> Backend
subgraph Backend ["βοΈ Backend Tier β Supabase"]
direction TB
Auth["π Supabase Auth<br>(JWT)"]
Postgres["ποΈ PostgreSQL Database<br>(Row Level Security + PostGIS)"]
Storage["π Supabase Storage<br>(AES-256 Encrypted Evidence)"]
Edge["β‘ Edge Functions<br>(Deno / AI Integration)"]
Realtime["π Supabase Realtime<br>(Live Location Tracking)"]
Auth --> Postgres
Postgres --> Edge
Postgres --> Realtime
Postgres --> Storage
end
Backend -- "Serverless / RPC" --> AI
subgraph AI ["π€ AI Engine Tier"]
direction TB
Gemini["π§ Gemini 2.0 Flash<br>(Risk Analysis + Chatbot)"]
TFLite["π TensorFlow Lite<br>(On-device Pattern Detection)"]
Gemini ~~~ TFLite
end
Backend -- "REST API" --> Maps
subgraph Maps ["π Location & Maps Tier"]
direction TB
SDK["πΊοΈ Maps SDK<br>(Live Heatmaps)"]
Places["π₯ Places API<br>(Nearby Safe Zones)"]
SDK ~~~ Places
end
%% Node Styling (Matching the provided screenshots)
style React fill:#1E3A8A,color:#fff,stroke:#3B82F6
style Zustand fill:#1E3A8A,color:#fff,stroke:#3B82F6
style Router fill:#1E3A8A,color:#fff,stroke:#3B82F6
style Services fill:#1E3A8A,color:#fff,stroke:#3B82F6
style Auth fill:#4C1D95,color:#fff,stroke:#8B5CF6
style Firestore fill:#4C1D95,color:#fff,stroke:#8B5CF6
style Storage fill:#4C1D95,color:#fff,stroke:#8B5CF6
style FCM fill:#4C1D95,color:#fff,stroke:#8B5CF6
style Gemini fill:#065F46,color:#fff,stroke:#10B981
style TFLite fill:#065F46,color:#fff,stroke:#10B981
style SDK fill:#9F1239,color:#fff,stroke:#F43F5E
style Places fill:#9F1239,color:#fff,stroke:#F43F5E
%% Subgraph Styling (Grey background, no borders)
style Client fill:#424242,stroke:none,color:#fff
style Backend fill:#424242,stroke:none,color:#fff
style AI fill:#424242,stroke:none,color:#fff
style Maps fill:#424242,stroke:none,color:#fff
The platform implements a Zero-Trust, Defense-in-Depth security model across both client and server tiers:
flowchart LR
subgraph APISide ["βοΈ API-Side Security"]
direction TB
Rules["π‘οΈ Postgres RLS<br>(Row Level Security)"]
CORS["π CORS Whitelist<br>(Only allowed origins)"]
Rate["β±οΈ Rate Limiting<br>Edge Functions (Vault secrets)"]
StorageSec["π Storage Security<br>(Auth-only Evidence Upload)"]
NoSQL["π§Ή Schema Validator<br>(Postgres constraints + Enums)"]
JWT["π JWT Verify<br>(Supabase Auth)"]
Rules --> CORS --> Rate --> StorageSec --> NoSQL --> JWT
end
subgraph ClientSide ["π Client-Side Security"]
direction LR
Zod["β
Zod Schema Validation<br>(Client-side form guards)"]
Route["π‘οΈ Route Guards<br>(Expo Router auth middleware)"]
Store["π Encrypted MMKV Store<br>(AES-256 for local state)"]
Logout["πͺ Auto Logout<br>(401 response -> clear token + redirect)"]
Backoff["β³ Exponential Backoff<br>(5xx retry: 1s -> 2s -> fail)"]
Zod --> Route --> Store
Store --> Logout
Store --> Backoff
end
ClientSide -- "HTTPS / WSS" --> APISide
%% Node Styling
style Rules fill:#4C1D95,color:#fff,stroke:#8B5CF6
style CORS fill:#4C1D95,color:#fff,stroke:#8B5CF6
style Rate fill:#4C1D95,color:#fff,stroke:#8B5CF6
style StorageSec fill:#4C1D95,color:#fff,stroke:#8B5CF6
style NoSQL fill:#4C1D95,color:#fff,stroke:#8B5CF6
style JWT fill:#4C1D95,color:#fff,stroke:#8B5CF6
style Zod fill:#1E3A8A,color:#fff,stroke:#3B82F6
style Route fill:#1E3A8A,color:#fff,stroke:#3B82F6
style Store fill:#1E3A8A,color:#fff,stroke:#3B82F6
style Logout fill:#1E3A8A,color:#fff,stroke:#3B82F6
style Backoff fill:#1E3A8A,color:#fff,stroke:#3B82F6
%% Subgraph Styling
style APISide fill:#424242,stroke:none,color:#fff
style ClientSide fill:#424242,stroke:none,color:#fff
erDiagram
PROFILES ||--o{ TRUSTED_CONTACTS : has
PROFILES ||--o{ JOURNEYS : starts
PROFILES ||--o{ SOS_EVENTS : triggers
PROFILES ||--o{ COMMUNITY_REPORTS : submits
PROFILES ||--o{ REPORT_VOTES : casts
PROFILES ||--o{ PUSH_TOKENS : registers
PROFILES ||--o{ ASSISTANT_CONVERSATIONS : owns
SOS_EVENTS ||--o{ SOS_LOCATION_PINGS : streams
SOS_EVENTS ||--o{ SOS_GUARDIANS : notifies
SOS_EVENTS ||--o{ EVIDENCE_FILES : captures
JOURNEYS ||--o{ JOURNEY_CHECKINS : records
JOURNEYS ||--o| SOS_EVENTS : "may escalate to"
TRUSTED_CONTACTS }o--|| PROFILES : "guardian profile"
COMMUNITY_REPORTS ||--o{ REPORT_VOTES : receives
COMMUNITY_REPORTS ||--o{ REPORT_COMMENTS : receives
SAFETY_SCORES }o--|| GEO_CELLS : "computed for"
| Layer | Technology | Purpose |
|---|---|---|
| Core Framework | React Native + Expo | Cross-platform mobile architecture |
| State Management | Zustand + React Query | Predictable local and server state sync |
| Styling Engine | NativeWind (Tailwind CSS) | Utility-first, performant glassmorphism |
| Cloud Backend | Supabase (Postgres/Auth/Edge/Realtime) | Robust RLS and scalable backend |
| Offline Storage | Expo SQLite (Drizzle ORM) | Durable SOS outbox and sync engine |
| AI Processing | Gemini 2.0 Flash + TF Lite | Millisecond-latency risk analysis |
| Geolocation | Google Maps Platform | Routing, Heatmaps, and Safe Zones |
We follow a strict Feature-First Clean Architecture. Each domain is isolated to prevent tangled dependencies.
Infinity_Coders-v2v/
βββ src
β βββ features
β β βββ ai-assistant
β β β βββ components
β β β βββ hooks
β β β βββ repository
β β β βββ index.ts
β β β βββ types.ts
β β βββ auth
β β β βββ components
β β β βββ hooks
β β β βββ repository
β β β βββ index.ts
β β β βββ types.ts
β β βββ community-reports
β β β βββ components
β β β βββ hooks
β β β βββ repository
β β β βββ index.ts
β β β βββ types.ts
β β βββ evidence-vault
β β β βββ components
β β β βββ hooks
β β β βββ repository
β β β βββ index.ts
β β β βββ types.ts
β β βββ journeys
β β β βββ components
β β β βββ hooks
β β β βββ repository
β β β βββ index.ts
β β β βββ types.ts
β β βββ profile-settings
β β β βββ components
β β β βββ hooks
β β β βββ repository
β β β βββ index.ts
β β β βββ types.ts
β β βββ safe-navigation
β β β βββ components
β β β βββ hooks
β β β βββ repository
β β β βββ index.ts
β β β βββ types.ts
β β βββ safety-score
β β β βββ components
β β β βββ hooks
β β β βββ repository
β β β βββ index.ts
β β β βββ types.ts
β β βββ sos
β β β βββ components
β β β βββ hooks
β β β βββ offline
β β β βββ repository
β β β βββ index.ts
β β β βββ types.ts
β β βββ trusted-contacts
β β βββ components
β β βββ hooks
β β βββ repository
β β βββ index.ts
β β βββ types.ts
β βββ i18n
β βββ navigation
β βββ shared
β βββ constants
β βββ hooks
β βββ lib
β β βββ sync-engine
β β β βββ outbox.ts
β β β βββ worker.ts
β β βββ axios-client.ts
β β βββ sqlite-db.ts
β β βββ supabase-client.ts
β βββ stores
β βββ ui
βββ supabase
β βββ functions
β β βββ ai-assistant-chat
β β βββ classify-report
β β βββ compute-safety-score
β β βββ notify-guardians
β β βββ suggest-safe-route
β βββ migrations
βββ assets
βββ logo.png
- Node.js
v18+ - Expo CLI
- Docker (for local Supabase instance)
- Supabase CLI
-
Clone the repository:
git clone https://github.com/your-org/Infinity_Coders-v2v.git cd Infinity_Coders-v2v npm install -
Configure Environment:
cp .env.example .env # Add your API keys to .env -
Start Development Server:
npx expo start
Designed and engineered for maximum reliability. Built by Infinity Coders.
