How shubhvarshney30/sheheroes works
Based on our analysis of the file tree and the README, this is a mobile‐first women safety application (SheHeroes) built principally in Flutter. The application targets both Android and iOS (with platform-specific code under the directories “android”, “ios”, and “Sheheroes_WatchOS”), while also including a web landing page (inside the “SheHeroes-template” folder) that serves as an informational or promotional site. The app leverages external services such as Firestore for backend storage, Google Map API for mapping and location tracking, and CrimeoMeter API for crime statistics; it also includes features for voice assistance, emergency SOS calls, shake-based alerts, camera integration, and more.
Main Components
• Mobile Client (Flutter App):
– The “lib” folder contains most of the UI pages (e.g., emergency_dashboard, login_page, several feature pages like camera, map, voice, etc.), along with shared utilities, widgets, and themes.
– “lib/providers” and “lib/services” show that the project uses state management and dependency injection (service_locator) to manage business logic and hardware interactions (e.g., calls_and_messages_service, shake detection).
• Platform-Specific Code:
– “android” and “ios” folders for native builds employing Gradle and Xcode. These include configurations, manifests, and platform assets.
– “Sheheroes_WatchOS” indicates additional client code that might be designed for wearable or extended device interaction, with its own native folders for Android and iOS.
• Web Landing Page:
– The “SheHeroes-template” folder contains HTML, CSS, JavaScript, and media assets. This is structured as a static site to showcase the app.
• External Services & APIs:
– Firestore (as per the README’s tech stack)
– Google Map API & CrimeoMeter API used within the app (likely triggered from the corresponding services in the code)
– Additional native phone functionalities for emergency SMS, calls, and so on.
• DevOps/CI:
– The “.github” directory with workflows (ci.yml) shows integration for continuous integration.
– Gradle files, pubspec.yaml, and various configuration files demonstrate a modern build system and dependency management.
Establish Relationships and Interactions
• The Flutter Mobile Client (UI) interacts with its internal Providers and Services. The UI pages (in “lib/pages”) forward user events to Providers (under “lib/providers”) which in turn call the Services (in “lib/services”) to perform tasks like authentication (GoogleAuth), shake detection, camera usage, etc.
• The Services layer manages integration to external APIs (Google Map, Firestore, CrimeoMeter) and platform-specific functionalities (calls, SMS, and media capture).
• There is a clear data flow: User Input (via mobile UI) → UI Widgets → Provider/State Management → Services → (if needed) External API call, and notifications back to the UI.
• For the web landing page, the static site packages provide general information and might link out to app store pages or download links.
• The build system components (Gradle for Android, Xcode for iOS, and Flutter’s pubspec.yaml) ensure that the correct dependencies and configurations are applied across platforms.
Architectural Patterns / Design Principles
• The project leverages Flutter’s widget-based model for its cross-platform mobile UI.
• There is a type of separation-of-concerns: UI components are separated from business logic (Providers/Services) as shown by the “lib/providers” and “lib/services” directories.
• Usage of a service locator pattern (in service_locator.dart) for dependency injection improves testability and modularity.
• The overall architecture is modular—each functionality (e.g., voice assistant, emergency map, camera, SOS, etc.) is encapsulated in its own page and/or service, which simplifies scaling and future feature integration.