# viethoangtran/quickstep_app architecture

> Architecture diagram of the GitHub repository viethoangtran/quickstep_app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/viethoangtran/quickstep_app
- Repository: https://github.com/viethoangtran/quickstep_app

## Overview

##### Main Components
- Mobile Frontend: The Flutter codebase (primarily organized in the "lib" directory) includes UI (screens, widgets), controllers (using GetX for state management), models, and services (e.g., auth_service, db_service, hive_service). Notice that separate platform-specific directories (“android” and “ios”) provide native setup details.
- Backend Server: Even though its code isn’t in the repository, the README points to a Node.js backend. Represent this as a separate component handling authentication, real-time socket communication (using socket.io), and business logic.
- External Services: List Google Maps APIs (with custom markers, live tracking) and email services for account verification (OTP features).
- Local Storage & Utilities: Include components like Hive (for persistence) and other utilities that support local caching and offline operations.

##### Relationships and Interactions
- Mobile Components Internal Flow: Break down the mobile app into its major layers:
– UI Layer: Comprising various screens (authentication, home, movements, notifications, profile) and widgets.
– Controller/Business Logic Layer: Represented by controllers (in "lib/controllers") and state management (using GetX).
– Service Layer: Handling external communications like network requests (Dio) and local data storage (Hive).
– Models: Representing data structures (user, account, movement, etc.) that are used by controllers and screens.
- Integration with Google Maps: Emphasize that the mobile app integrates with Google Maps (API keys configured in AndroidManifest.xml and AppDelegate.swift) for live location tracking.

##### Architectural Patterns and Design Principles
- Separation of Concerns: Clearly separate the UI, business logic, and data layers.
- Cross-platform Development: Emphasize the Flutter structure that allows unified UI code but with separate configuration for Android and iOS.
- Real-time Communication: Capture the use of Socket.io for live chat and location updates.
- State Management: Mark the use of GetX pattern for handling state across the app.
- Offline/Local Storage: Include how Hive is used to store data locally when needed.

##### Relevant Technologies and Frameworks
- Flutter / Dart for mobile app development.
- GetX for state management.
- Dio for network requests.
- Hive for local storage.
- Google Maps API for mapping and location tracking.
- Socket.io for real-time communication.
- Node.js for backend service (external integration).

##### Essential Elements
– User interactions triggering API calls to the backend.
– Real-time socket connections between the mobile app and the Node.js backend.
– Data retrieval from local storage via Hive.
– Map data fetched from Google Maps.
- Annotations: Brief notes on the responsibilities of each layer/component (e.g., "Auth service handles login, registration, OTP verification" or "Movements controller manages real-time location updates").

## Diagram (Mermaid)

```mermaid
graph TD
    U("User Interaction"):::external
    J("Entry Point"):::frontend
    subgraph "Mobile App (Flutter)"
        A("UI Screens"):::frontend
        B("Controllers (GetX)"):::controller
        C("Auth Service"):::service
        D("DB Service"):::service
        E("Hive Service"):::service
        F("Data Models"):::model
        H("Chat Messaging"):::frontend
        I("Local Utilities & Theme"):::util
        G("Google Maps Integration"):::external
        P("Custom Marker Widget"):::external
    end
    subgraph "External Systems"
        K("Backend Server (Node.js)"):::backend
        L("Google Maps API"):::external
        M("Email Service"):::external
        N("Android Config"):::external
        O("iOS Config"):::external
    end

    %% Flow for Mobile App
    U -->|"initiates"| J
    J -->|"launches"_UI| A
    A -->|"delegates_to"| B
    A -->|"utilizes"| I
    B -->|"calls"_Auth| C
    B -->|"calls"_DB| D
    B -->|"calls"_Hive| E
    B -->|"manages"| H
    B -->|"uses"| F
    B -->|"handles_location"| G

    %% Service and External Interactions
    C -->|"OTP_verification"| M
    D -->|"API_calls"| K
    H -->|"socket_communication"| K
    G -->|"map_API_calls"| L
    G -->|"android_setup"| N
    G -->|"ios_setup"| O
    G -->|"renders_marker"| P

    %% Click Events
    click A "https://github.com/viethoangtran/quickstep_app/tree/main/lib/screens"
    click B "https://github.com/viethoangtran/quickstep_app/tree/main/lib/controllers"
    click C "https://github.com/viethoangtran/quickstep_app/blob/main/lib/services/auth_service.dart"
    click D "https://github.com/viethoangtran/quickstep_app/blob/main/lib/services/db_service.dart"
    click E "https://github.com/viethoangtran/quickstep_app/blob/main/lib/services/hive_service.dart"
    click F "https://github.com/viethoangtran/quickstep_app/tree/main/lib/models"
    click H "https://github.com/viethoangtran/quickstep_app/blob/main/lib/screens/movements/map/menu_pages/messages.dart"
    click I "https://github.com/viethoangtran/quickstep_app/tree/main/lib/utils"
    click J "https://github.com/viethoangtran/quickstep_app/blob/main/lib/main.dart"
    click P "https://github.com/viethoangtran/quickstep_app/blob/main/lib/screens/movements/map/widgets/marker_custom.dart"
    click N "https://github.com/viethoangtran/quickstep_app/blob/main/android/app/src/main/AndroidManifest.xml"
    click O "https://github.com/viethoangtran/quickstep_app/blob/main/ios/Runner/AppDelegate.swift"

    %% Styles
    classDef frontend fill:#BBDEFB,stroke:#0D47A1,stroke-width:2px;
    classDef controller fill:#C8E6C9,stroke:#2E7D32,stroke-width:2px;
    classDef service fill:#FFE082,stroke:#FF6F00,stroke-width:2px;
    classDef model fill:#FFCDD2,stroke:#C62828,stroke-width:2px;
    classDef backend fill:#D1C4E9,stroke:#512DA8,stroke-width:2px;
    classDef external fill:#F0F4C3,stroke:#827717,stroke-width:2px;
    classDef util fill:#CFD8DC,stroke:#455A64,stroke-width:2px;
```
