# ramonsantospinto/uberclone architecture

> Architecture diagram of the GitHub repository ramonsantospinto/uberclone, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ramonsantospinto/uberclone
- Repository: https://github.com/ramonsantospinto/uberclone

## Overview

#### Purpose and Entry Points
UberClone is a Flutter Android/iOS urban-mobility portfolio app centered on location, destination search, route display, and trip lifecycle state. Flutter starts at `lib/main.dart`; native hosts bootstrap the Flutter runtime through `android/app/src/main/kotlin/br/com/uberclone/uberclone/MainActivity.kt` and `ios/Runner/AppDelegate.swift`.

#### Composition and Dependency Boundary
Centralized GetIt registration wires presentation to domain contracts and concrete data services in `lib/core/DI/injection.dart`. This is the main substitution boundary: UI/Bloc code should consume service interfaces rather than Google/Dio implementations. Shared device-location access sits separately in `lib/core/services/location_service.dart`.

#### Map Feature Structure
The primary feature is isolated under `lib/features/map`. Its domain layer defines provider-agnostic contracts and trip state: `lib/features/map/domain/services/i_places_service.dart`, `lib/features/map/domain/services/i_directions_service.dart`, and `lib/features/map/domain/enums/trip_status.dart`. This prevents presentation/domain code from depending directly on Google API details.

#### External Data Integration
Concrete implementations call mapping APIs and map responses into feature models: `lib/features/map/data/services/places_service_impl.dart`, `lib/features/map/data/services/directions_service_impl.dart`, `lib/features/map/data/models/place_prediction.dart`, and `lib/features/map/data/models/route_info.dart`. Google Maps/Places are the material external services; Dio is the HTTP client. API credentials also cross native boundaries via `android/app/src/main/AndroidManifest.xml` and `ios/Runner/AppDelegate.swift`.

#### State and Control Flow
`lib/features/map/presentation/bloc/map_bloc.dart` owns the reactive flow: location/map initialization, destination-search results, route calculation, and transitions through `TripStatus`. Events originate from presentation pages, invoke injected domain services, then emit state consumed by map and ride UI. The Bloc is the primary orchestration boundary between asynchronous services and rendering.

#### User-Facing Flow
The home/map flow is assembled in `lib/features/map/presentation/screens/home_screen.dart` and rendered through `lib/features/map/presentation/pages/map_page.dart`. Destination selection is handled by `lib/features/map/presentation/pages/search_destination_page.dart`; route/trip controls are surfaced through `lib/features/map/presentation/widgets/uber_bottom_sheet.dart`. Google Maps Flutter provides the native map surface, while marker and geometry utilities support map rendering in `lib/core/utils/map_custom_marker.dart` and `lib/core/utils/map_helpers.dart`.

#### Runtime and Platform Infrastructure
The app targets Flutter/Dart 3.x with native Android Gradle and iOS Xcode runners. Native map SDK configuration and permissions belong to `android/app/src/main/AndroidManifest.xml` and `ios/Runner/Info.plist`. The architecture currently represents a client application: no backend, persistence store, authentication provider, or dispatch service is present in the repository structure.

Main entry points: [`lib/features/map/presentation/bloc/map_bloc.dart`](https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/presentation/bloc/map_bloc.dart) (Map Bloc), [`lib/core/DI/injection.dart`](https://github.com/ramonsantospinto/uberclone/blob/main/lib/core/DI/injection.dart) (GetIt composition), [`lib/features/map/presentation/pages/map_page.dart`](https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/presentation/pages/map_page.dart) (Map page), [`lib/features/map/data/services/places_service_impl.dart`](https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/data/services/places_service_impl.dart) (Places service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_flutter_app["Flutter app entry<br/>Flutter bootstrap<br/>[main.dart]"]
  node_android_host["Android host<br/>native runner<br/>[MainActivity.kt]"]
  node_ios_host["iOS host<br/>native runner<br/>[AppDelegate.swift]"]
  node_android_config["Android map config<br/>manifest"]
  node_ios_config["iOS permissions<br/>plist<br/>[Info.plist]"]
end

subgraph group_core["Core composition"]
  node_injection{{"GetIt composition<br/>dependency injection<br/>[injection.dart]"}}
  node_location_service["Device location<br/>location service"]
  node_map_rendering["Map rendering utilities<br/>map utilities"]
  node_map_helpers["Map helpers<br/>geometry utilities<br/>[map_helpers.dart]"]
end

subgraph group_map_domain["Map domain"]
  node_places_contract["Places contract<br/>domain interface"]
  node_directions_contract["Directions contract<br/>domain interface"]
  node_trip_status["Trip status<br/>domain state<br/>[trip_status.dart]"]
end

subgraph group_map_data["Map data"]
  node_places_service["Places service<br/>data service"]
  node_directions_service["Directions service<br/>data service"]
  node_place_prediction["Place prediction<br/>data model"]
  node_route_info["Route info<br/>data model<br/>[route_info.dart]"]
  node_google_apis{{"Google Maps &amp; Places<br/>external APIs"}}
end

subgraph group_presentation["Map presentation"]
  node_map_bloc{{"Map Bloc<br/>state orchestration<br/>[map_bloc.dart]"}}
  node_home_screen["Home screen<br/>[home_screen.dart]"]
  node_map_page["Map page<br/>map rendering<br/>[map_page.dart]"]
  node_destination_search["Destination search<br/>page"]
  node_trip_controls["Trip controls<br/>widget"]
end

node_android_host -->|"boots"| node_flutter_app
node_ios_host -->|"boots"| node_flutter_app
node_flutter_app -->|"initializes"| node_injection
node_android_config -.->|"credentials"| node_google_apis
node_ios_host -.->|"credentials"| node_google_apis
node_injection -->|"binds implementation"| node_places_contract
node_injection -->|"binds implementation"| node_directions_contract
node_injection -->|"provides"| node_location_service
node_places_service -->|"implements"| node_places_contract
node_directions_service -->|"implements"| node_directions_contract
node_places_service -->|"searches"| node_google_apis
node_directions_service -->|"requests routes"| node_google_apis
node_places_service -->|"maps responses"| node_place_prediction
node_directions_service -->|"maps responses"| node_route_info
node_home_screen -->|"assembles"| node_map_page
node_map_page -->|"renders state"| node_map_bloc
node_destination_search -->|"dispatches search"| node_map_bloc
node_trip_controls -->|"dispatches trip actions"| node_map_bloc
node_map_bloc -->|"initializes location"| node_location_service
node_map_bloc -->|"searches destinations"| node_places_contract
node_map_bloc -->|"calculates route"| node_directions_contract
node_map_bloc -->|"transitions"| node_trip_status
node_map_page -->|"draws markers"| node_map_rendering
node_map_page -->|"draws geometry"| node_map_helpers
node_ios_config -.->|"permits access"| node_location_service

click node_flutter_app "https://github.com/ramonsantospinto/uberclone/blob/main/lib/main.dart"
click node_android_host "https://github.com/ramonsantospinto/uberclone/blob/main/android/app/src/main/kotlin/br/com/uberclone/uberclone/MainActivity.kt"
click node_ios_host "https://github.com/ramonsantospinto/uberclone/blob/main/ios/Runner/AppDelegate.swift"
click node_android_config "https://github.com/ramonsantospinto/uberclone/blob/main/android/app/src/main/AndroidManifest.xml"
click node_ios_config "https://github.com/ramonsantospinto/uberclone/blob/main/ios/Runner/Info.plist"
click node_injection "https://github.com/ramonsantospinto/uberclone/blob/main/lib/core/DI/injection.dart"
click node_location_service "https://github.com/ramonsantospinto/uberclone/blob/main/lib/core/services/location_service.dart"
click node_places_contract "https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/domain/services/i_places_service.dart"
click node_directions_contract "https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/domain/services/i_directions_service.dart"
click node_trip_status "https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/domain/enums/trip_status.dart"
click node_places_service "https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/data/services/places_service_impl.dart"
click node_directions_service "https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/data/services/directions_service_impl.dart"
click node_place_prediction "https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/data/models/place_prediction.dart"
click node_route_info "https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/data/models/route_info.dart"
click node_map_bloc "https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/presentation/bloc/map_bloc.dart"
click node_home_screen "https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/presentation/screens/home_screen.dart"
click node_map_page "https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/presentation/pages/map_page.dart"
click node_destination_search "https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/presentation/pages/search_destination_page.dart"
click node_trip_controls "https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/presentation/widgets/uber_bottom_sheet.dart"
click node_map_rendering "https://github.com/ramonsantospinto/uberclone/blob/main/lib/core/utils/map_custom_marker.dart"
click node_map_helpers "https://github.com/ramonsantospinto/uberclone/blob/main/lib/core/utils/map_helpers.dart"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_flutter_app,node_android_host,node_ios_host,node_android_config,node_ios_config toneBlue
class node_injection,node_location_service,node_map_rendering,node_map_helpers toneAmber
class node_places_contract,node_directions_contract,node_trip_status toneMint
class node_places_service,node_directions_service,node_place_prediction,node_route_info,node_google_apis toneRose
class node_map_bloc,node_home_screen,node_map_page,node_destination_search,node_trip_controls toneIndigo
```

## Components

### Runtime

- [Flutter app entry](https://github.com/ramonsantospinto/uberclone/blob/main/lib/main.dart): Flutter bootstrap · `lib/main.dart`
- [Android host](https://github.com/ramonsantospinto/uberclone/blob/main/android/app/src/main/kotlin/br/com/uberclone/uberclone/MainActivity.kt): native runner · `android/app/src/main/kotlin/br/com/uberclone/uberclone/MainActivity.kt`
- [iOS host](https://github.com/ramonsantospinto/uberclone/blob/main/ios/Runner/AppDelegate.swift): native runner · `ios/Runner/AppDelegate.swift`
- [Android map config](https://github.com/ramonsantospinto/uberclone/blob/main/android/app/src/main/AndroidManifest.xml): manifest · Supplies map SDK credentials and permissions. · `android/app/src/main/AndroidManifest.xml`
- [iOS permissions](https://github.com/ramonsantospinto/uberclone/blob/main/ios/Runner/Info.plist): plist · Declares native location and map permissions. · `ios/Runner/Info.plist`

### Core composition

- [GetIt composition](https://github.com/ramonsantospinto/uberclone/blob/main/lib/core/DI/injection.dart): dependency injection · Wires contracts to concrete services. · `lib/core/DI/injection.dart`
- [Device location](https://github.com/ramonsantospinto/uberclone/blob/main/lib/core/services/location_service.dart): location service · `lib/core/services/location_service.dart`
- [Map rendering utilities](https://github.com/ramonsantospinto/uberclone/blob/main/lib/core/utils/map_custom_marker.dart): map utilities · Builds custom markers and map geometry. · `lib/core/utils/map_custom_marker.dart`
- [Map helpers](https://github.com/ramonsantospinto/uberclone/blob/main/lib/core/utils/map_helpers.dart): geometry utilities · `lib/core/utils/map_helpers.dart`

### Map domain

- [Places contract](https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/domain/services/i_places_service.dart): domain interface · `lib/features/map/domain/services/i_places_service.dart`
- [Directions contract](https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/domain/services/i_directions_service.dart): domain interface · `lib/features/map/domain/services/i_directions_service.dart`
- [Trip status](https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/domain/enums/trip_status.dart): domain state · `lib/features/map/domain/enums/trip_status.dart`

### Map data

- [Places service](https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/data/services/places_service_impl.dart): data service · `lib/features/map/data/services/places_service_impl.dart`
- [Directions service](https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/data/services/directions_service_impl.dart): data service · `lib/features/map/data/services/directions_service_impl.dart`
- [Place prediction](https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/data/models/place_prediction.dart): data model · `lib/features/map/data/models/place_prediction.dart`
- [Route info](https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/data/models/route_info.dart): data model · `lib/features/map/data/models/route_info.dart`
- **Google Maps & Places**: external APIs

### Map presentation

- [Map Bloc](https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/presentation/bloc/map_bloc.dart): state orchestration · Coordinates initialization, search, routing, and trip transitions. · `lib/features/map/presentation/bloc/map_bloc.dart`
- [Home screen](https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/presentation/screens/home_screen.dart): screen · `lib/features/map/presentation/screens/home_screen.dart`
- [Map page](https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/presentation/pages/map_page.dart): map rendering · `lib/features/map/presentation/pages/map_page.dart`
- [Destination search](https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/presentation/pages/search_destination_page.dart): page · `lib/features/map/presentation/pages/search_destination_page.dart`
- [Trip controls](https://github.com/ramonsantospinto/uberclone/blob/main/lib/features/map/presentation/widgets/uber_bottom_sheet.dart): widget · `lib/features/map/presentation/widgets/uber_bottom_sheet.dart`

## Connections

- Android host → Flutter app entry: boots
- iOS host → Flutter app entry: boots
- Flutter app entry → GetIt composition: initializes
- Android map config → Google Maps & Places: credentials
- iOS host → Google Maps & Places: credentials
- GetIt composition → Places contract: binds implementation
- GetIt composition → Directions contract: binds implementation
- GetIt composition → Device location: provides
- Places service → Places contract: implements
- Directions service → Directions contract: implements
- Places service → Google Maps & Places: searches
- Directions service → Google Maps & Places: requests routes
- Places service → Place prediction: maps responses
- Directions service → Route info: maps responses
- Home screen → Map page: assembles
- Map page → Map Bloc: renders state
- Destination search → Map Bloc: dispatches search
- Trip controls → Map Bloc: dispatches trip actions
- Map Bloc → Device location: initializes location
- Map Bloc → Places contract: searches destinations
- Map Bloc → Directions contract: calculates route
- Map Bloc → Trip status: transitions
- Map page → Map rendering utilities: draws markers
- Map page → Map helpers: draws geometry
- iOS permissions → Device location: permits access
