# etec-spring-final/flutter-car-rental-app architecture

> Architecture diagram of the GitHub repository etec-spring-final/flutter-car-rental-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/etec-spring-final/flutter-car-rental-app
- Repository: https://github.com/etec-spring-final/flutter-car-rental-app

## Overview

Auto Rent Premium is a Flutter car-rental frontend backed by a separately maintained Spring Boot REST service. The principal customer journey is vehicle discovery, detail review, rental selection and reservation, then KHQR/Bakong payment. The app also supports authentication, favorites, booking history, profiles, and notifications. The README documents a presentation/BLoC → use-case → repository → data-source/API layering; the feature modules below represent these responsibilities. Source excerpts are primarily platform runner code, so feature relationships are based on README documentation rather than inspected Dart call sites.

Main entry points: [`lib/core/network/dio_client.dart`](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/core/network/dio_client.dart) (Dio API Client), [`lib/feature/vehicle/presentation/view/explore_screen.dart`](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/vehicle/presentation/view/explore_screen.dart) (Vehicle Browsing), [`lib/feature/rental/presentation/view/booking_screen.dart`](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/rental/presentation/view/booking_screen.dart) (Rental Selection), [`lib/app/router/app_router.dart`](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/app/router/app_router.dart) (App Router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Vehicle Discovery"]
  node_vehicle_ui["Vehicle Browsing"]
  node_vehicle_detail["Vehicle Details"]
  node_brands["Brand Filters<br/>[brand_bloc.dart]"]
  node_favorites["Favorites<br/>[favorite_bloc.dart]"]
  node_vehicle_domain["Vehicle Use Cases"]
  node_vehicle_data["Vehicle Data"]
end

subgraph group_reservation["Rental &amp; Payment"]
  node_rental_ui["Rental Selection"]
  node_booking["Reservation History<br/>[booking_bloc.dart]"]
  node_booking_usecases["Booking Operations"]
  node_booking_data["Booking Data"]
  node_payment_ui["Payment Screen"]
  node_payment_ops["QR Payment Operations"]
  node_payment_data["Payment Data"]
end

subgraph group_account["Account"]
  node_auth["Authentication<br/>[login_screen.dart]"]
  node_profile["User Profile"]
  node_notifications["Notification Inbox"]
  node_push["Push Notifications"]
end

subgraph group_platform["App Platform"]
  node_app["Flutter App<br/>[main.dart]"]
  node_router["App Router<br/>[app_router.dart]"]
  node_http["Dio API Client<br/>[dio_client.dart]"]
end

node_customer(("Customer"))
node_api["Spring REST API"]

node_customer -->|"uses"| node_app
node_app -->|"routes through"| node_router
node_router -->|"routes to"| node_auth
node_router -->|"routes to"| node_vehicle_ui
node_vehicle_ui -->|"opens details"| node_vehicle_detail
node_vehicle_ui -->|"filters by"| node_brands
node_vehicle_ui -->|"saves favorites"| node_favorites
node_vehicle_ui -->|"requests vehicles"| node_vehicle_domain
node_vehicle_domain -->|"uses repository"| node_vehicle_data
node_vehicle_data -->|"requests data"| node_http
node_vehicle_detail -->|"starts rental"| node_rental_ui
node_rental_ui -->|"creates reservation"| node_booking
node_booking -->|"invokes"| node_booking_usecases
node_booking_usecases -->|"uses repository"| node_booking_data
node_booking_data -->|"requests data"| node_http
node_rental_ui -->|"continues to payment"| node_payment_ui
node_payment_ui -->|"requests QR"| node_payment_ops
node_payment_ops -->|"uses repository"| node_payment_data
node_payment_data -->|"requests data"| node_http
node_profile -->|"manages account"| node_http
node_notifications -->|"loads inbox"| node_http
node_push -.->|"feeds inbox"| node_notifications
node_http -->|"calls REST"| node_api

click node_app "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/main.dart"
click node_router "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/app/router/app_router.dart"
click node_auth "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/auth/presentation/view/login_screen.dart"
click node_vehicle_ui "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/vehicle/presentation/view/explore_screen.dart"
click node_vehicle_detail "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/vehicle/presentation/view/vehicle_detail_screen.dart"
click node_brands "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/brand/presentation/bloc/brand_bloc.dart"
click node_favorites "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/favorite/presentation/bloc/favorite_bloc.dart"
click node_vehicle_domain "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/vehicle/domain/usecase/get_vehicles_use_case.dart"
click node_vehicle_data "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/vehicle/data/repository/vehicle_repository_impl.dart"
click node_rental_ui "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/rental/presentation/view/booking_screen.dart"
click node_booking "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/booking/presentation/bloc/booking_bloc.dart"
click node_booking_usecases "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/booking/domain/usecase/create_booking.dart"
click node_booking_data "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/booking/data/repository/booking_repository_impl.dart"
click node_payment_ui "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/payment/presentation/view/payment_screen.dart"
click node_payment_ops "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/payment/domain/usecase/create_qr_usecase.dart"
click node_payment_data "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/payment/data/repository/payment_repository_impl.dart"
click node_profile "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/profile/presentation/view/profile_screen.dart"
click node_notifications "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/notification/presentation/view/notification_screen.dart"
click node_push "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/core/service/firebase/notification_service.dart"
click node_http "https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/core/network/dio_client.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_vehicle_ui,node_vehicle_detail,node_brands,node_favorites,node_vehicle_domain,node_vehicle_data toneBlue
class node_rental_ui,node_booking,node_booking_usecases,node_booking_data,node_payment_ui,node_payment_ops,node_payment_data toneAmber
class node_auth,node_profile,node_notifications,node_push,node_api toneMint
class node_app,node_router,node_http toneRose
class node_customer toneIndigo
```

## Components

### Vehicle Discovery

- [Vehicle Browsing](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/vehicle/presentation/view/explore_screen.dart): `lib/feature/vehicle/presentation/view/explore_screen.dart`
- [Vehicle Details](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/vehicle/presentation/view/vehicle_detail_screen.dart): `lib/feature/vehicle/presentation/view/vehicle_detail_screen.dart`
- [Brand Filters](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/brand/presentation/bloc/brand_bloc.dart): `lib/feature/brand/presentation/bloc/brand_bloc.dart`
- [Favorites](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/favorite/presentation/bloc/favorite_bloc.dart): `lib/feature/favorite/presentation/bloc/favorite_bloc.dart`
- [Vehicle Use Cases](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/vehicle/domain/usecase/get_vehicles_use_case.dart): `lib/feature/vehicle/domain/usecase/get_vehicles_use_case.dart`
- [Vehicle Data](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/vehicle/data/repository/vehicle_repository_impl.dart): `lib/feature/vehicle/data/repository/vehicle_repository_impl.dart`

### Rental & Payment

- [Rental Selection](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/rental/presentation/view/booking_screen.dart): `lib/feature/rental/presentation/view/booking_screen.dart`
- [Reservation History](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/booking/presentation/bloc/booking_bloc.dart): `lib/feature/booking/presentation/bloc/booking_bloc.dart`
- [Booking Operations](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/booking/domain/usecase/create_booking.dart): `lib/feature/booking/domain/usecase/create_booking.dart`
- [Booking Data](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/booking/data/repository/booking_repository_impl.dart): `lib/feature/booking/data/repository/booking_repository_impl.dart`
- [Payment Screen](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/payment/presentation/view/payment_screen.dart): `lib/feature/payment/presentation/view/payment_screen.dart`
- [QR Payment Operations](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/payment/domain/usecase/create_qr_usecase.dart): `lib/feature/payment/domain/usecase/create_qr_usecase.dart`
- [Payment Data](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/payment/data/repository/payment_repository_impl.dart): `lib/feature/payment/data/repository/payment_repository_impl.dart`

### Account

- [Authentication](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/auth/presentation/view/login_screen.dart): `lib/feature/auth/presentation/view/login_screen.dart`
- [User Profile](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/profile/presentation/view/profile_screen.dart): `lib/feature/profile/presentation/view/profile_screen.dart`
- [Notification Inbox](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/feature/notification/presentation/view/notification_screen.dart): `lib/feature/notification/presentation/view/notification_screen.dart`
- [Push Notifications](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/core/service/firebase/notification_service.dart): `lib/core/service/firebase/notification_service.dart`

### App Platform

- [Flutter App](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/main.dart): `lib/main.dart`
- [App Router](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/app/router/app_router.dart): `lib/app/router/app_router.dart`
- [Dio API Client](https://github.com/etec-spring-final/flutter-car-rental-app/blob/main/lib/core/network/dio_client.dart): `lib/core/network/dio_client.dart`

### Other components

- **Customer**
- **Spring REST API**

## Connections

- Customer → Flutter App: uses (evidence: `README.md`)
- Flutter App → App Router: routes through (evidence: `README.md`)
- App Router → Authentication: routes to (evidence: `README.md`)
- App Router → Vehicle Browsing: routes to (evidence: `README.md`)
- Vehicle Browsing → Vehicle Details: opens details (evidence: `README.md`)
- Vehicle Browsing → Brand Filters: filters by (evidence: `README.md`)
- Vehicle Browsing → Favorites: saves favorites (evidence: `README.md`)
- Vehicle Browsing → Vehicle Use Cases: requests vehicles (evidence: `README.md`)
- Vehicle Use Cases → Vehicle Data: uses repository (evidence: `README.md`)
- Vehicle Data → Dio API Client: requests data (evidence: `README.md`)
- Vehicle Details → Rental Selection: starts rental (evidence: `README.md`)
- Rental Selection → Reservation History: creates reservation (evidence: `README.md`)
- Reservation History → Booking Operations: invokes (evidence: `README.md`)
- Booking Operations → Booking Data: uses repository (evidence: `README.md`)
- Booking Data → Dio API Client: requests data (evidence: `README.md`)
- Rental Selection → Payment Screen: continues to payment (evidence: `README.md`)
- Payment Screen → QR Payment Operations: requests QR (evidence: `README.md`)
- QR Payment Operations → Payment Data: uses repository (evidence: `README.md`)
- Payment Data → Dio API Client: requests data (evidence: `README.md`)
- User Profile → Dio API Client: manages account (evidence: `README.md`)
- Notification Inbox → Dio API Client: loads inbox (evidence: `README.md`)
- Push Notifications → Notification Inbox: feeds inbox
- Dio API Client → Spring REST API: calls REST (evidence: `README.md`)
