# billy272/taxi-app architecture

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

- Interactive diagram: https://gitdiagram.com/billy272/taxi-app
- Repository: https://github.com/billy272/taxi-app

## Overview

##### Recognize the Project Type and Purpose
- This is a mobile application built using Dart and Flutter, targeting multiple platforms (Android, iOS, web, desktop on Linux, macOS, and Windows).
- The app seems to be designed for taxi-related functionalities, including user login, registration, profile management, wallet/payments, and route/directions handling.
- The README screenshots and information about payment methods (via *334# and Google Pay) indicate that the app integrates with external payment services and possibly maps/direction services.

##### File Structure to Identify Architectural Components
- The “lib” directory contains the core Flutter code. Files like main.dart, home_screen.dart, login.dart, sign_up.dart, forgot_password.dart, profile.dart, wallet.dart, along with the directions-related files, represent the UI and business logic layers.
- Platform-specific directories (android, ios, linux, macos, windows, web) indicate that the same Flutter codebase is adapted for different environments through native shell integration.
- Additional configuration files (e.g., pubspec.yaml, analysis_options.yaml) and test scripts (in “test”) support build, dependency management, and widget testing.

##### Main Components to Capture
- Flutter Core / Mobile Client:
- UI Layer: List all major screens/components – Home, Login, Sign Up, Profile, Wallet, and any other widget-specific files.
- Navigation and State Management: Represent how main.dart boots the app and routes between pages.
- Business/Domain Logic:
- Direction Handling: Capture the “direction_model.dart” and “directions.dart” as part of the route mapping or geolocation module.
- Payment Integration: Though not explicitly detailed, include a component for Payment Processing or external Payment Gateway integration, reflecting the use of Google Pay and phone-based payment (*334#).
- Platform-Specific Native Layers:
- Android (Kotlin files, build configurations, native Android manifest, etc.)
- iOS (Swift, Objective-C files, storyboard interfaces, AppDelegate, etc.)
- Other platforms (Linux, macOS, Windows, and Web): Show these as deployment targets where the base Flutter code is packaged respectively.
- External Services and Integrations:
- Payment Service Providers: External gateway via Google Pay.
- Possibly a mapping or directions service (if integrated with external APIs) inferred from direction files.

##### Relationships and Interactions
- How the Flutter UI communicates with the business logic layer.
- Connections from business logic components (for directions, payment) to external services.
- Bridge between the shared Flutter code and the native layers. For example, use connectors between the Flutter engine and platform-specific modules to highlight how native controllers (Android’s MainActivity.kt or iOS’s AppDelegate.swift) interface with the app.

##### Architectural Patterns and Design Principles
- Multi-platform Adaptation: Clearly show that the same codebase (in “lib”) supports several deployment targets.
- Separation of Concerns: The UI is separate from core business logic and external service integrations.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Flutter Client: UI Layer
    subgraph "UI Layer"
        A["App Bootstrapping (main.dart)"]:::nav
        H["Home Screen"]:::ui
        L["Login Screen"]:::ui
        S["Sign Up Screen"]:::ui
        F["Forgot Password Screen"]:::ui
        P["Profile Screen"]:::ui
        U["User Profile Screen"]:::ui
    end

    %% UI Navigation Connections
    A -->|"routesTo"| H
    A -->|"routesTo"| L
    A -->|"routesTo"| S
    A -->|"routesTo"| F
    A -->|"routesTo"| P
    A -->|"routesTo"| U

    %% Business Logic Layer
    subgraph "Business Logic"
        D["Direction & Geolocation Module"]:::biz
        Dh["Directions Helper"]:::biz
        Pay["Payment Integration Module"]:::biz
    end

    %% Connections from UI to Business Logic
    A -->|"handlesNavigation"| D
    A -->|"handlesNavigation"| Pay
    D -->|"includes"| Dh

    %% External Services
    EM["External Mapping Service"]:::external
    EP["External Payment Gateway"]:::external
    D -->|"fetchesRoutes"| EM
    Pay -->|"processesPayment"| EP

    %% Native Layers
    subgraph "Native Layers"
        And["Android Native Layer"]:::native
        Ios["iOS Native Layer"]:::native
    end

    %% Native configuration components
    And -->|"config"| AM["Android Manifest"]:::native
    Ios -->|"config"| iOSInfo["iOS Info.plist"]:::native

    %% Connections from Flutter to Native Layers
    A -->|"bridgesTo"| And
    A -->|"bridgesTo"| Ios

    %% Deployment Targets
    subgraph "Deployment Targets"
        Lin["Linux"]:::deploy
        Mac["macOS"]:::deploy
        Win["Windows"]:::deploy
        Web["Web"]:::deploy
    end

    %% Additional deployment components
    Lin -->|"includes"| LApp["Linux Application"]:::deploy
    Mac -->|"includes"| MacWindow["Main Flutter Window"]:::deploy
    Web -->|"includes"| WM["Web Manifest"]:::deploy

    %% Connection from Flutter to Deployment Targets
    A -->|"deployedTo"| Lin
    A -->|"deployedTo"| Mac
    A -->|"deployedTo"| Win
    A -->|"deployedTo"| Web

    %% Click Events for Flutter UI Layer
    click A "https://github.com/billy272/taxi-app/blob/main/taxi1_app/lib/main.dart"
    click H "https://github.com/billy272/taxi-app/blob/main/taxi1_app/lib/home_screen.dart"
    click L "https://github.com/billy272/taxi-app/blob/main/taxi1_app/lib/login.dart"
    click S "https://github.com/billy272/taxi-app/blob/main/taxi1_app/lib/sign_up.dart"
    click F "https://github.com/billy272/taxi-app/blob/main/taxi1_app/lib/forgot_password.dart"
    click P "https://github.com/billy272/taxi-app/blob/main/taxi1_app/lib/profile.dart"
    click U "https://github.com/billy272/taxi-app/blob/main/taxi1_app/lib/user_profile.dart"

    %% Click Events for Business Logic
    click D "https://github.com/billy272/taxi-app/blob/main/taxi1_app/lib/direction_model.dart"
    click Dh "https://github.com/billy272/taxi-app/blob/main/taxi1_app/lib/directions.dart"
    click Pay "https://github.com/billy272/taxi-app/blob/main/taxi1_app/lib/wallet.dart"

    %% Click Events for Native Layers
    click And "https://github.com/billy272/taxi-app/blob/main/taxi1_app/android/app/src/main/kotlin/com/example/taxi1_app/MainActivity.kt"
    click AM "https://github.com/billy272/taxi-app/blob/main/taxi1_app/android/app/src/main/AndroidManifest.xml"
    click Ios "https://github.com/billy272/taxi-app/blob/main/taxi1_app/ios/Runner/AppDelegate.swift"
    click iOSInfo "https://github.com/billy272/taxi-app/blob/main/taxi1_app/ios/Runner/Info.plist"

    %% Click Events for Deployment Targets
    click Lin "https://github.com/billy272/taxi-app/blob/main/taxi1_app/linux/main.cc"
    click LApp "https://github.com/billy272/taxi-app/blob/main/taxi1_app/linux/my_application.cc"
    click Mac "https://github.com/billy272/taxi-app/blob/main/taxi1_app/macos/Runner/AppDelegate.swift"
    click MacWindow "https://github.com/billy272/taxi-app/blob/main/taxi1_app/macos/Runner/MainFlutterWindow.swift"
    click Win "https://github.com/billy272/taxi-app/blob/main/taxi1_app/windows/runner/main.cpp"
    click Web "https://github.com/billy272/taxi-app/blob/main/taxi1_app/web/index.html"
    click WM "https://github.com/billy272/taxi-app/blob/main/taxi1_app/web/manifest.json"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef nav fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef biz fill:#FFD700,stroke:#333,stroke-width:2px;
    classDef native fill:#FFA07A,stroke:#333,stroke-width:2px;
    classDef deploy fill:#DDA0DD,stroke:#333,stroke-width:2px;
    classDef external fill:#D3D3D3,stroke:#333,stroke-width:2px;
```
