How hariom317/vsafe-women-safety-app works
1. Repository shape
- This is a Flutter cross-platform mobile app with generated platform shells for Android, iOS, web, Windows, macOS, and Linux.
- The actual product logic lives almost entirely under lib/; the native folders are thin launch/bridge layers.
2. App entry and shell
- lib/main.dart is the Dart entry point and likely decides the initial route and global app setup.
- Platform-specific runners (android/.../MainActivity.kt, ios/Runner/AppDelegate.swift, etc.) only host the Flutter runtime; they are not where the app’s domain logic lives.
3. Primary product boundary: safety app UI
- The UI is organized by feature area:
- intro_pages for splash/onboarding
- user for sign-up/login/profile recovery
- navbar_pages for the main post-login tabs
- required_pages for core safety flows
- widgets and components for reusable UI parts
- This gives the architecture a clear split between authentication/onboarding and the main safety dashboard.
4. Authentication and user lifecycle
- lib/src/user/ contains the account flow: welcome screen, login, registration, password reset, email/OTP verification, and profile update.
- This is the app’s front door and likely gates access to all safety and communication features.
- User identity is represented in lib/src/model/user_model.dart, suggesting the app stores a structured profile separate from UI.
5. Main navigation and feature hub
- lib/src/widgets/bottom_nav_bar.dart and lib/src/widgets/drawer_widgets/screen_drawer.dart indicate two major navigation surfaces:
- a bottom tab bar for primary workflows
- a drawer for secondary settings/help/legal screens
- navbar_pages/home_screen.dart, chat_screen.dart, fake_call_screen.dart, and profile_screen.dart suggest the core app is centered around these four main sections.
6. Safety operations subsystem
- The home experience is decomposed into focused widgets:
- emergency.dart for SOS actions
- nearby_map_service.dart for map/location-based assistance
- safety_tips.dart and situation.dart for guidance and contextual content
- custom_carousel.dart for surfaced content on the home page
- The feature set from the README—SOS, shake-trigger alerts, emergency contacts, and real-time location sharing—appears to live here.
7. Emergency and fake-call flows
- required_pages/fake_call.dart, incoming_fake_call.dart, and navbar_pages/fake_call_screen.dart model a dedicated de-escalation/escape flow.
- flutter_background_services.dart implies background execution is used for time-sensitive behaviors like shake detection or alerting while the app is not foregrounded.
- assets/audio/caller_tune.mp3 supports the fake-call experience with realistic ringing audio.
8. Chat and contact subsystem
- lib/src/chat/ contains the full one-to-one messaging stack: user cards, message cards, profile dialog, user chat screen, and profile viewing.
- lib/src/model/contact_model.dart and user_message.dart define the data boundary for contacts and chat messages.
- chat/apis.dart and db/db_services.dart suggest backend/persistence access is abstracted away from the UI, likely to Firebase or another cloud datastore as described in the README.
9. Persistence and lightweight local state
- db_services.dart and share_pref.dart indicate two storage layers:
- app/database services for structured records
- shared preferences for local flags or session-like state
- This likely supports remembered login state, onboarding completion, profile cache, and possibly selected settings.
10. Support content and informational surfaces
- The app includes non-transactional content flows for safety education and support:
- drawer_widgets/help_page.dart, privacy_policy_page.dart, terms_and_conditions.dart, feedback_page.dart, notification_page.dart, setting_page.dart
- required_pages/chatbot.dart for guided assistance
- These are important because the app is not only operational SOS tooling; it also provides guidance, policy, and support content.
11. Content-heavy asset pipeline
- The assets/ tree is a major part of the product: Lottie animations, intro imagery, safety-tip images, and safety-training videos.
- This indicates the app leans heavily on rich educational and onboarding media rather than plain text-only screens.
- The architecture therefore includes a presentation/content layer as a first-class subsystem.
12. Backend and platform integration boundaries
- The README states Firebase is used for backend services, and ios/Runner/GoogleService-Info.plist confirms Firebase configuration on iOS.
- The code layout suggests cloud-backed features for authentication, messaging, and possibly notifications/location services, while native code remains minimal.
- In a diagram, the key boundaries are: Flutter UI layer → app services/data layer → Firebase/backend services, with native runners acting only as platform hosts.
Main entry points: main.dart Main · bottom_nav_bar.dart Nav shell · home_screen.dart Home hub · login_screen.dart Auth flow
Components 22
Flutter app
Dart application logic and UI
- Main · Dart app entry and bootstrap
lib/main.dart - Intro flow · Splash and onboarding screens
lib/src/pages/intro_pages/onboarding_screen.dart - Auth flow · Login, registration, reset and verification
lib/src/user/login_screen.dart - User model · Structured user profile data
lib/src/model/user_model.dart - Home hub · Post-login safety dashboard
lib/src/pages/navbar_pages/home_screen.dart - Nav shell · Bottom tabs and drawer navigation
lib/src/widgets/bottom_nav_bar.dart - Profile · User profile and account view
lib/src/pages/navbar_pages/profile_screen.dart - Chat · Main messaging entry screen
lib/src/pages/navbar_pages/chat_screen.dart - Chat stack · User cards, messages and profile dialogs
lib/src/chat/user_chat_screen.dart - Contact data · Contacts and message records
lib/src/model/contact_model.dart - DB services · Backend and record access layer
lib/src/db/db_services.dart - Prefs · Local flags and session state
lib/src/db/share_pref.dart - Safety widgets · SOS, nearby map, tips and situation content
lib/src/widgets/home_widgets/emergency.dart - Fake call · Fake-call and incoming-call flow
lib/src/pages/required_pages/fake_call.dart - Background svc · Background execution for time-sensitive actions
lib/src/utils/flutter_background_services.dart - Support pages · Help, privacy, terms, settings and feedback
lib/src/widgets/drawer_widgets/screen_drawer.dart - Chatbot · Guided help and support assistant
lib/src/pages/required_pages/chatbot.dart - Shared UI · Reusable buttons, text fields and routes
lib/src/components/custom_textfield.dart
Platform hosts
Native launch shells and platform integration
- Android · Flutter host shell for Android
android/app/src/main/kotlin/com/safety/vsafe/MainActivity.kt - iOS · Flutter host shell for iOS
ios/Runner/AppDelegate.swift - Desktop/Web · Flutter host shells for web, Windows, macOS and Linux
web/index.html
Assets
Media and content used by the app
- Media assets · Animations, audio, images and videos
assets/animations/intro_app_animations/sos.json
Connections 24
- Main → Intro flow: starts · Launches onboarding and splash experience
- Main → Auth flow: routes · Enters account setup and sign-in flows
- Main → Home hub: opens · Loads the main app shell after entry
- Intro flow → Media assets: uses · Displays onboarding animations and imagery
- Auth flow → User model: writes · Creates and updates structured user data
- Auth flow → Shared UI: uses · Builds forms and action controls
- Home hub → Nav shell: contained in · Runs inside the main tab and drawer shell
- Nav shell → Profile: switches to · One of the primary bottom-tab destinations
- Nav shell → Chat: switches to · One of the primary bottom-tab destinations
- Nav shell → Safety widgets: hosts · Primary dashboard content is composed from safety widgets
- Nav shell → Support pages: opens · Drawer exposes secondary support and settings pages
- Home hub → Fake call: triggers · Launches the de-escalation escape path
- Home hub → Chatbot: offers · Surfaces guided assistance from the dashboard
- Safety widgets → Background svc: depends on · Supports shake detection and alert timing in background
- Fake call → Media assets: plays · Uses ringing audio and fake-call visuals
- Chat → Chat stack: navigates to · Opens the one-to-one chat detail stack
- Chat stack → Contact data: reads · Renders contact and message records
- Chat stack → DB services: syncs · Fetches and stores chat data through backend services
- DB services → Prefs: uses · Combines cloud-backed data with local session state
- DB services → User model: persists · Stores user profile records
- Support pages → Media assets: uses · Displays help and informational content assets
- Android → Main: hosts · Android shell launches the Flutter entrypoint
- iOS → Main: hosts · iOS shell launches the Flutter entrypoint
- Desktop/Web → Main: hosts · Web and desktop shells launch the Flutter entrypoint