# lucasgalindo/barbermanagerfe architecture

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

- Interactive diagram: https://gitdiagram.com/lucasgalindo/barbermanagerfe
- Repository: https://github.com/lucasgalindo/barbermanagerfe

## Overview

##### Project type and purpose
- From the file tree and README, this is a Flutter-based, cross-platform mobile (Android/iOS) and web client called “barbermanager_fe.”
- It’s organized as a front-end application (Dart + Flutter) that likely consumes external APIs (e.g., a barber-shop management backend) and includes a small Python “ia” service, perhaps for AI/ML support.

##### File structure
- Top-level:
- android/ and ios/: Native wrapper projects generated by Flutter.
- web/: Flutter’s web assets (index.html, manifest.json).
- lib/: The core Dart code:
– models/: Data classes (Barber, User, JWT, etc.)
– repositories/: Data-access abstraction (UserRepository).
– utils/: Local utilities (SharedPreferences).
– view_models/: Business logic / state (MVVM-style ChangeNotifier providers).
– views/ & widgets/: UI screens and reusable components.
- ia/: A Python microservice (main.py + requirements.txt).
- fonts/, assets/: Static assets.
- pubspec.yaml: Flutter dependencies.

##### README for additional insights
- The README is boilerplate; no architectural notes. We infer architecture from file layout and naming conventions (MVVM, Provider).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Native Shells
    subgraph "Native Shells"
        android["Android Shell"]:::external
        ios["iOS Shell"]:::external
        web["Web Shell"]:::external
    end

    android --> FlutterEngine
    ios --> FlutterEngine
    web --> FlutterEngine

    %% Flutter Engine
    FlutterEngine["Flutter Engine"]:::external

    %% Flutter App Layers
    subgraph "Flutter Client"
        %% Presentation Layer
        subgraph "Presentation Layer"
            direction TB
            subgraph "Views" 
                direction TB
                BarberChoiceView["BarberChoiceView"]:::presentation
                DateTimeSelectionView["DateTimeSelectionView"]:::presentation
                SummaryView["SummaryView"]:::presentation
                BarbershopDetailsView["barbershop_details_view"]:::presentation
                BarbershopServicesView["barbershop_services_view"]:::presentation
                EmbeddedPublicScreen["embedded_public_screen"]:::presentation
                InitialScreen["initial_screen"]:::presentation
                LoginScreen["login_screen"]:::presentation
                RegisterPage["register_page"]:::presentation
                FirstEntryLogin["first_entry_login"]:::presentation
                HomeView["home_view"]:::presentation
            end
            subgraph "Widgets"
                direction TB
                BarberChoiceCard["BarberChoiceCard"]:::presentation
                BarberServiceCard["BarberServiceCard"]:::presentation
                InfoBox["InfoBox"]:::presentation
                BarberShopCard["barber_shop_card"]:::presentation
                BoxOfCarousel["box_of_carousel"]:::presentation
                PrimaryButton["primary_button"]:::presentation
                TextInputField["text_input_field"]:::presentation
            end
        end

        %% Business Logic Layer
        subgraph "Business Logic (ViewModels)"
            direction TB
            AuthProvider["auth_provider"]:::business
            BarbershopViewModel["barbershop_view_model"]:::business
            FirstEntryViewModel["first_entry_view_model"]:::business
            InitialViewModel["initial_view_model"]:::business
            LoginViewModel["login_view_model"]:::business
            RegisterViewModel["register_view_model"]:::business
            SeekServiceViewModel["seek_service_view_model"]:::business
        end

        %% Data Layer
        subgraph "Data Layer"
            direction TB
            subgraph "Models"
                direction TB
                BarberModel["barber"]:::data
                BarberShopModel["barber_shop"]:::data
                BarberServiceModel["barberservice"]:::data
                JWTModel["jwt"]:::data
                SeekServiceModel["seek_service_model"]:::data
                UserCredentialsModel["user_creddentials"]:::data
                UserModel["user_model"]:::data
                UserTypeModel["user_type_model"]:::data
            end
            subgraph "Repositories / Utils"
                direction TB
                UserRepository["user_repository"]:::data
                SharedPrefs["SharedPreferences"]:::data
            end
        end
    end

    %% External Services
    PythonIA["Python IA Service"]:::external
    ExternalAPI["External Backend API"]:::external

    %% Data Flows
    FlutterEngine -->|"renders UI"| BarberChoiceView
    BarberChoiceView -->|"invokes"| AuthProvider
    DateTimeSelectionView -->|"invokes"| SeekServiceViewModel
    SummaryView -->|"invokes"| RegisterViewModel
    AuthProvider -->|"calls"| UserRepository
    SeekServiceViewModel -->|"calls"| UserRepository
    UserRepository -->|"fetches/saves"| ExternalAPI
    UserRepository -->|"reads/writes"| SharedPrefs
    AuthProvider -->|"may call IA"| PythonIA
    PythonIA -->|"returns predictions"| AuthProvider

    %% Click Events - Native Shells
    click android "https://github.com/lucasgalindo/barbermanagerfe/tree/main/android/"
    click ios "https://github.com/lucasgalindo/barbermanagerfe/tree/main/ios/"
    click web "https://github.com/lucasgalindo/barbermanagerfe/tree/main/web/"

    %% Click Events - Views
    click BarberChoiceView "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/views/BarberChoiceView.dart"
    click DateTimeSelectionView "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/views/DateTimeSelectionView.dart"
    click SummaryView "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/views/SummaryView.dart"
    click BarbershopDetailsView "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/views/barbershop_details_view.dart"
    click BarbershopServicesView "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/views/barbershop_services_view.dart"
    click EmbeddedPublicScreen "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/views/embedded_public_screen.dart"
    click InitialScreen "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/views/initial_screen.dart"
    click LoginScreen "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/views/login_screen.dart"
    click RegisterPage "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/views/register_page.dart"
    click FirstEntryLogin "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/views/protected/first_entry_login.dart"
    click HomeView "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/views/protected/home_view.dart"

    %% Click Events - Widgets
    click BarberChoiceCard "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/widgets/BarberChoiceCard.dart"
    click BarberServiceCard "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/widgets/BarberServiceCard.dart"
    click InfoBox "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/widgets/InfoBox.dart"
    click BarberShopCard "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/widgets/barber_shop_card.dart"
    click BoxOfCarousel "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/widgets/box_of_carousel.dart"
    click PrimaryButton "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/widgets/primary_button.dart"
    click TextInputField "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/widgets/text_input_field.dart"

    %% Click Events - ViewModels
    click AuthProvider "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/view_models/auth_provider.dart"
    click BarbershopViewModel "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/view_models/barbershop_view_model.dart"
    click FirstEntryViewModel "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/view_models/first_entry_view_model.dart"
    click InitialViewModel "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/view_models/initial_view_model.dart"
    click LoginViewModel "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/view_models/login_view_model.dart"
    click RegisterViewModel "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/view_models/register_view_model.dart"
    click SeekServiceViewModel "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/view_models/seek_service_view_model.dart"

    %% Click Events - Models
    click BarberModel "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/models/barber.dart"
    click BarberShopModel "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/models/barber_shop.dart"
    click BarberServiceModel "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/models/barberservice.dart"
    click JWTModel "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/models/jwt.dart"
    click SeekServiceModel "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/models/seek_service_model.dart"
    click UserCredentialsModel "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/models/user_creddentials.dart"
    click UserModel "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/models/user_model.dart"
    click UserTypeModel "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/models/user_type_model.dart"

    %% Click Events - Repositories / Utils
    click UserRepository "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/repositories/user_repository.dart"
    click SharedPrefs "https://github.com/lucasgalindo/barbermanagerfe/blob/main/lib/utils/shared_preferences_utils.dart"

    %% Click Events - Python IA
    click PythonIA "https://github.com/lucasgalindo/barbermanagerfe/blob/main/ia/main.py"

    %% Click Events - External API (placeholder)
    click ExternalAPI "https://github.com/lucasgalindo/barbermanagerfe/tree/main/external_api/"

    %% Styles
    classDef presentation fill:#ADD8E6,stroke:#000
    classDef business fill:#90EE90,stroke:#000
    classDef data fill:#FFA500,stroke:#000
    classDef external fill:#D3D3D3,stroke:#000
```
