# otniel113/rentacar-mobile architecture

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

- Interactive diagram: https://gitdiagram.com/otniel113/rentacar-mobile
- Repository: https://github.com/otniel113/rentacar-mobile

## Overview

##### Project type and purpose
- This is a cross-platform Flutter mobile application (“Rent A Car Mobile”) whose purpose is to let members browse vehicles (minibus, big car, small car), view details, register/login/logout, manage their profile, and make/view bookings.
- The backend (not included here) exposes REST APIs for authentication, profile, vehicle listings, and bookings.

##### File structure
- Top-level platform folders (android/, ios/, web/, windows/) contain the platform runners generated by Flutter.
- lib/ contains the core Dart application, organized into:
– api/: service classes calling REST endpoints
– models/: domain objects (Booking, Member, Minibus, Mobilbesar, Mobilkecil)
– session/: SessionManager (token storage & retrieval)
– utils/: input validators
– views/: UI layers split by BottomNavBar modules (home, booking, profile) plus login.dart, regist.dart, home.dart
- Configuration files include pubspec.yaml, analysis_options.yaml, and platform build scripts.

##### README for additional insights
- The README confirms four main UI modules mapped to BottomNavBar tabs: Home, Login/Register/Logout, Profile, Booking.
- The mobile app is a client for members; an admin web app (separate repo) manages vehicle availability.

##### Detailed capturing of essential architecture
- BottomNavBar modules as separate UI components that share the same API and SessionManager.
- External dependencies (e.g., pubspec plugins) if they play a critical role (secure storage, http).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Platform Targets
    subgraph "Platform Targets"
        style PlatformTargets fill:#eeeeee,stroke:#cccccc,stroke-width:2px
        Android["Android"]:::platform
        iOS["iOS"]:::platform
        Web["Web"]:::platform
        Windows["Windows"]:::platform
    end

    %% Flutter Entry Point
    Main["App Entry Point\nlib/main.dart"]:::entry

    %% Flutter Application Layers
    subgraph "Flutter Application"
        style FlutterApp fill:#f0f8ff,stroke:#4444aa,stroke-width:2px

        %% Presentation Layer - Views
        subgraph "Presentation Layer\n(lib/views)" 
            style Presentation fill:#d0e1f9,stroke:#6b8eb5,stroke-width:1px

            %% BottomNavBar Components
            NavbarHome["NavbarHome"]:::view
            NavbarBooking["NavbarBooking"]:::view
            NavbarProfile["NavbarProfile"]:::view

            %% Home Module
            subgraph "Home Module"
                MinibusView["MinibusView"]:::view
                MinibusDetail["MinibusDetail"]:::view
                MobilbesarView["MobilbesarView"]:::view
                MobilbesarDetail["MobilbesarDetail"]:::view
                MobilkecilView["MobilkecilView"]:::view
                MobilkecilDetail["MobilkecilDetail"]:::view
            end

            %% Booking Module
            MyBookingList["MyBookingList"]:::view

            %% Profile Module
            subgraph "Profile Module"
                ProfileData["ProfileData"]:::view
                ProfileDetail["ProfileDetail"]:::view
            end

            %% Authentication Views
            Login["Login"]:::view
            Regist["Regist"]:::view
        end

        %% Application Layer
        SessionManager["SessionManager"]:::session

        %% API Layer
        subgraph "API Layer\n(lib/api)"
            style ApiLayer fill:#f4e1d2,stroke:#d47f3b,stroke-width:1px
            APILogin["api_login.dart"]:::api
            APILogout["api_logout.dart"]:::api
            APIRegister["api_register.dart"]:::api
            APIProfile["api_profile.dart"]:::api
            APIMinibus["api_minibus.dart"]:::api
            APIMobilbesar["api_mobilbesar.dart"]:::api
            APIMobilkecil["api_mobilkecil.dart"]:::api
            APIBooking["api_booking.dart"]:::api
            APIGetMobilBooking["api_get_mobil_booking.dart"]:::api
        end

        %% Domain Models
        subgraph "Domain Models\n(lib/models)"
            BookingModel["booking.dart"]:::model
            MemberModel["member.dart"]:::model
            MinibusModel["minibus.dart"]:::model
            MobilbesarModel["mobilbesar.dart"]:::model
            MobilkecilModel["mobilkecil.dart"]:::model
        end

        %% Utilities
        Validator["validator.dart"]:::util

        %% Local Storage
        SecureStorage["Token Store"]:::storage
    end

    %% External Backend
    ExternalBackend["External REST Backend\n(login, vehicles, bookings, profile)"]:::external

    %% Connections
    Android --> Main
    iOS --> Main
    Web --> Main
    Windows --> Main

    Main --> Presentation
    Presentation --> SessionManager
    Presentation --> ApiLayer
    SessionManager --> SecureStorage
    SessionManager --> APILogin
    SessionManager --> APILogout
    APILogin --> ExternalBackend
    APIRegister --> ExternalBackend
    APILogout --> ExternalBackend
    APIProfile --> ExternalBackend
    APIMinibus --> ExternalBackend
    APIMobilbesar --> ExternalBackend
    APIMobilkecil --> ExternalBackend
    APIBooking --> ExternalBackend
    APIGetMobilBooking --> ExternalBackend
    ExternalBackend --> APILogin
    ExternalBackend --> APIProfile
    ExternalBackend --> APIMinibus
    ExternalBackend --> APIMobilbesar
    ExternalBackend --> APIMobilkecil
    ExternalBackend --> APIBooking
    ExternalBackend --> APIGetMobilBooking
    APILogin --> MemberModel
    APIProfile --> MemberModel
    APIMinibus --> MinibusModel
    APIMobilbesar --> MobilbesarModel
    APIMobilkecil --> MobilkecilModel
    APIBooking --> BookingModel
    APIGetMobilBooking --> BookingModel
    Presentation --> BookingModel
    Presentation --> MemberModel
    Presentation --> MinibusModel
    Presentation --> MobilbesarModel
    Presentation --> MobilkecilModel
    Presentation --> Validator

    %% Click Events
    click Main "https://github.com/otniel113/rentacar-mobile/blob/master/lib/main.dart"
    click MinibusView "https://github.com/otniel113/rentacar-mobile/blob/master/lib/views/bottomNavBar/home/minibus_view.dart"
    click MinibusDetail "https://github.com/otniel113/rentacar-mobile/blob/master/lib/views/bottomNavBar/home/minibus_detail.dart"
    click MobilbesarView "https://github.com/otniel113/rentacar-mobile/blob/master/lib/views/bottomNavBar/home/mobilbesar_view.dart"
    click MobilbesarDetail "https://github.com/otniel113/rentacar-mobile/blob/master/lib/views/bottomNavBar/home/mobilbesar_detail.dart"
    click MobilkecilView "https://github.com/otniel113/rentacar-mobile/blob/master/lib/views/bottomNavBar/home/mobilkecil_view.dart"
    click MobilkecilDetail "https://github.com/otniel113/rentacar-mobile/blob/master/lib/views/bottomNavBar/home/mobilkecil_detail.dart"
    click MyBookingList "https://github.com/otniel113/rentacar-mobile/blob/master/lib/views/bottomNavBar/booking/my_booking_list.dart"
    click ProfileData "https://github.com/otniel113/rentacar-mobile/blob/master/lib/views/bottomNavBar/profile/profile_data.dart"
    click ProfileDetail "https://github.com/otniel113/rentacar-mobile/blob/master/lib/views/bottomNavBar/profile/profile_detail.dart"
    click NavbarHome "https://github.com/otniel113/rentacar-mobile/blob/master/lib/views/bottomNavBar/navbar_home.dart"
    click NavbarBooking "https://github.com/otniel113/rentacar-mobile/blob/master/lib/views/bottomNavBar/navbar_booking.dart"
    click NavbarProfile "https://github.com/otniel113/rentacar-mobile/blob/master/lib/views/bottomNavBar/navbar_profile.dart"
    click Login "https://github.com/otniel113/rentacar-mobile/blob/master/lib/views/login.dart"
    click Regist "https://github.com/otniel113/rentacar-mobile/blob/master/lib/views/regist.dart"
    click APILogin "https://github.com/otniel113/rentacar-mobile/blob/master/lib/api/api_login.dart"
    click APILogout "https://github.com/otniel113/rentacar-mobile/blob/master/lib/api/api_logout.dart"
    click APIRegister "https://github.com/otniel113/rentacar-mobile/blob/master/lib/api/api_register.dart"
    click APIProfile "https://github.com/otniel113/rentacar-mobile/blob/master/lib/api/api_profile.dart"
    click APIMinibus "https://github.com/otniel113/rentacar-mobile/blob/master/lib/api/api_minibus.dart"
    click APIMobilbesar "https://github.com/otniel113/rentacar-mobile/blob/master/lib/api/api_mobilbesar.dart"
    click APIMobilkecil "https://github.com/otniel113/rentacar-mobile/blob/master/lib/api/api_mobilkecil.dart"
    click APIBooking "https://github.com/otniel113/rentacar-mobile/blob/master/lib/api/api_booking.dart"
    click APIGetMobilBooking "https://github.com/otniel113/rentacar-mobile/blob/master/lib/api/api_get_mobil_booking.dart"
    click SessionManager "https://github.com/otniel113/rentacar-mobile/blob/master/lib/session/session_manager.dart"
    click BookingModel "https://github.com/otniel113/rentacar-mobile/blob/master/lib/models/booking.dart"
    click MemberModel "https://github.com/otniel113/rentacar-mobile/blob/master/lib/models/member.dart"
    click MinibusModel "https://github.com/otniel113/rentacar-mobile/blob/master/lib/models/minibus.dart"
    click MobilbesarModel "https://github.com/otniel113/rentacar-mobile/blob/master/lib/models/mobilbesar.dart"
    click MobilkecilModel "https://github.com/otniel113/rentacar-mobile/blob/master/lib/models/mobilkecil.dart"
    click Validator "https://github.com/otniel113/rentacar-mobile/blob/master/lib/utils/validator.dart"
    click Android "https://github.com/otniel113/rentacar-mobile/tree/master/android/"
    click iOS "https://github.com/otniel113/rentacar-mobile/tree/master/ios/"
    click Web "https://github.com/otniel113/rentacar-mobile/tree/master/web/"
    click Windows "https://github.com/otniel113/rentacar-mobile/tree/master/windows/"

    %% Styles
    classDef platform fill:#dddddd,stroke:#888888,font-weight:bold
    classDef entry fill:#ffffff,stroke:#4444aa,stroke-width:2px
    classDef view fill:#bbdefb,stroke:#1976d2
    classDef session fill:#b2dfdb,stroke:#00796b
    classDef api fill:#ffe0b2,stroke:#e65100
    classDef model fill:#fff9c4,stroke:#fbc02d
    classDef util fill:#dcedc8,stroke:#558b2f
    classDef storage fill:#c8e6c9,stroke:#2e7d32,stroke-dasharray: 5 5
    classDef external fill:#ffccbc,stroke:#bf360c,font-weight:bold
```
