# projetogestaoinsumos/front_insumos architecture

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

- Interactive diagram: https://gitdiagram.com/projetogestaoinsumos/front_insumos
- Repository: https://github.com/projetogestaoinsumos/front_insumos

## Overview

##### Project type and purpose
- This is a Flutter-based, multi‐platform front-end application called “Front-Insumos.”
- It targets Android, iOS, web, Linux, macOS and Windows via the standard Flutter project directories.
- There is no in-repo backend: all data comes from an external API (lib/api/api_service.dart).

##### File structure
- Top-level platform folders: android/, ios/, linux/, macos/, windows/, web/ – each holds the native shell and Flutter integration code.
- lib/ contains the Dart application code:
- main.dart – app entry point
- components/ – reusable UI widgets
- screens/ – page widgets (login, home, items)
- state/ – BLoC(s) for state management (auth_bloc.dart)
- api/ – API service for HTTP calls (api_service.dart)
- models/ – domain data models (user.dart)
- Configuration and build files: pubspec.yaml, analysis_options.yaml, platform build scripts (Gradle, Xcode, CMake).

##### Readme insights
- Very brief: confirms this is the front-end (“Front-Insumos”).
- No further architecture docs included, so we must infer the layered architecture from code organization.

##### Final advice
- Platform-level code as one group, emphasizing reuse of the single Flutter codebase.
- Don’t worry about every single file—group by function (e.g., “Components”, “Screens”, “State Management”).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Platforms
    subgraph "Client Platforms"
        Android["Android"]:::platform
        iOS["iOS"]:::platform
        Web["Web"]:::platform
        LinuxPlat["Linux"]:::platform
        macOSPlat["macOS"]:::platform
        WindowsPlat["Windows"]:::platform
    end

    %% Flutter Engine / Framework
    subgraph "Flutter Engine / Framework"
        GenericEngine["Flutter Engine"]:::engine
        FlutterIos["iOS Flutter"]:::engine
        FlutterLinux["Linux Flutter"]:::engine
        FlutterMacos["macOS Flutter"]:::engine
        FlutterWindows["Windows Flutter"]:::engine
    end

    %% Presentation Layer
    subgraph "Presentation Layer"
        CustomButton["CustomButton Widget"]:::presentation
        LoginScreen["LoginScreen"]:::presentation
        HomeScreen["HomeScreen"]:::presentation
        ItemsPage["ItemsPage"]:::presentation
    end

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        AuthBloc["AuthBloc"]:::business
    end

    %% Data Layer
    subgraph "Data Layer"
        ApiService["ApiService"]:::data
    end

    %% Domain Models
    subgraph "Domain Models"
        UserModel["User Model"]:::model
    end

    %% Utilities
    subgraph "Utilities"
        ColorsUtil["Colors Helper"]:::util
    end

    %% External Service
    ExternalApi["External Backend API"]:::external

    %% Connections
    Android -->|uses| GenericEngine
    Web -->|uses| GenericEngine
    iOS -->|uses| FlutterIos
    LinuxPlat -->|uses| FlutterLinux
    macOSPlat -->|uses| FlutterMacos
    WindowsPlat -->|uses| FlutterWindows

    GenericEngine -->|renders| CustomButton
    FlutterIos -->|renders| CustomButton
    FlutterLinux -->|renders| CustomButton
    FlutterMacos -->|renders| CustomButton
    FlutterWindows -->|renders| CustomButton

    CustomButton -->|navigates| LoginScreen
    CustomButton -->|navigates| HomeScreen
    CustomButton -->|navigates| ItemsPage

    LoginScreen -->|dispatches event| AuthBloc
    HomeScreen -->|dispatches event| AuthBloc
    ItemsPage -->|dispatches event| AuthBloc

    AuthBloc -->|calls| ApiService
    ApiService -->|requests| ExternalApi
    ExternalApi -->|responds| ApiService
    ApiService -->|returns data| AuthBloc
    AuthBloc -->|emits state| LoginScreen
    AuthBloc -->|emits state| HomeScreen
    AuthBloc -->|emits state| ItemsPage

    ApiService -->|maps to| UserModel
    UserModel -->|used by| AuthBloc
    ColorsUtil -->|styles| CustomButton

    %% Click Events
    click Android "https://github.com/projetogestaoinsumos/front_insumos/tree/main/android/"
    click iOS "https://github.com/projetogestaoinsumos/front_insumos/tree/main/ios/"
    click Web "https://github.com/projetogestaoinsumos/front_insumos/tree/main/web/"
    click LinuxPlat "https://github.com/projetogestaoinsumos/front_insumos/tree/main/linux/"
    click macOSPlat "https://github.com/projetogestaoinsumos/front_insumos/tree/main/macos/"
    click WindowsPlat "https://github.com/projetogestaoinsumos/front_insumos/tree/main/windows/"
    click FlutterIos "https://github.com/projetogestaoinsumos/front_insumos/tree/main/ios/Flutter/"
    click FlutterLinux "https://github.com/projetogestaoinsumos/front_insumos/tree/main/linux/flutter/"
    click FlutterMacos "https://github.com/projetogestaoinsumos/front_insumos/tree/main/macos/Flutter/"
    click FlutterWindows "https://github.com/projetogestaoinsumos/front_insumos/tree/main/windows/flutter/"
    click CustomButton "https://github.com/projetogestaoinsumos/front_insumos/blob/main/lib/components/custom_button.dart"
    click LoginScreen "https://github.com/projetogestaoinsumos/front_insumos/blob/main/lib/screens/login_screen.dart"
    click HomeScreen "https://github.com/projetogestaoinsumos/front_insumos/blob/main/lib/screens/home_screen.dart"
    click ItemsPage "https://github.com/projetogestaoinsumos/front_insumos/blob/main/lib/screens/items_page.dart"
    click AuthBloc "https://github.com/projetogestaoinsumos/front_insumos/blob/main/lib/state/auth_bloc.dart"
    click ApiService "https://github.com/projetogestaoinsumos/front_insumos/blob/main/lib/api/api_service.dart"
    click UserModel "https://github.com/projetogestaoinsumos/front_insumos/blob/main/lib/models/user.dart"
    click ColorsUtil "https://github.com/projetogestaoinsumos/front_insumos/blob/main/lib/utils/colors.dart"

    %% Styles
    classDef platform fill:#CCFFCC,stroke:#006600,color:#000;
    classDef engine fill:#CCE5FF,stroke:#004080,color:#000;
    classDef presentation fill:#FFFFCC,stroke:#666600,color:#000;
    classDef business fill:#FFCCCC,stroke:#800000,color:#000;
    classDef data fill:#FFD9B3,stroke:#805000,color:#000;
    classDef model fill:#E5CCFF,stroke:#400080,color:#000;
    classDef util fill:#FFCCFF,stroke:#800040,color:#000;
    classDef external fill:#CCCCCC,stroke:#333333,color:#000;
```
