# oscarbz-011/app_fluter_tfg architecture

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

- Interactive diagram: https://gitdiagram.com/oscarbz-011/app_fluter_tfg
- Repository: https://github.com/oscarbz-011/app_fluter_tfg

## Overview

##### Main Components
- Flutter Application (UI/logic layer): The core of the project lives in the lib directory. It includes:
- lib/main.dart – the entry point.
- lib/Models – for data models.
- lib/src which is further subdivided into functional areas like map, menu, news, news_details, and report.
- Platform-specific Integration:
- Android folder: Contains native Android project files and configuration.
- iOS folder: Contains Xcode project files, storyboards, and plist configurations.
- Assets and Configuration:
- Configuration files like pubspec.yaml, environment files (.env) and IDE settings.

##### Relationships and Interactions
- The Flutter UI layer interacts with the underlying business logic and data models defined in the lib directory.
- The functional modules (map, menu, news, etc.) likely communicate with each other through shared states or navigation flows.
- The native platform directories (android and ios) enable access to device-specific functionalities but primarily serve as the shell to run the bundled Flutter app.

##### Architectural Patterns and Design Principles
- Separation of Concerns: The project separates user interface (lib directory components), data models (Models), and domain-specific functionality (segmented under lib/src). This is similar to a clean architecture or layered approach.
- Modular Design: Each functional piece (like news, map, report) is organized into its own subdirectory, suggesting that the app can grow by adding or modifying modules independently.
- Platform Abstraction: The distinct android and ios folders illustrate the Flutter approach of abstracting UI code away from platform-specific code.

## Diagram (Mermaid)

```mermaid
flowchart TB
    A["Flutter App Core"]:::core
    B["Presentation Layer (lib/)"]:::ui
    C["Business Logic (lib/src)"]:::logic
    D["Data Models (lib/Models)"]:::data
    E["Shared Data (lib/data.dart)"]:::data
    subgraph "Functional Modules"
        M1["Map Module"]:::module
        M2["Menu Module"]:::module
        M3["News Module"]:::module
        M4["News Details Module"]:::module
        M5["Report Module"]:::module
    end
    F["Android Platform"]:::native
    G["iOS Platform"]:::native
    H["Assets & Config"]:::assets

    %% Relationships within Flutter App Core
    A -->|"includes"| B
    A -->|"includes"| C
    A -->|"includes"| D
    A -->|"includes"| E

    %% Business Logic to Functional Modules
    C -->|"comprises"| M1
    C -->|"comprises"| M2
    C -->|"comprises"| M3
    C -->|"comprises"| M4
    C -->|"comprises"| M5

    %% Example interaction between modules
    M3 -->|"sharesDataWith"| M5

    %% Native platforms depend on Flutter Core
    F -->|"hosts"| A
    G -->|"hosts"| A

    %% Assets & Config provide resources to Flutter Core
    H -->|"resourcesTo"| A

    %% Styles
    classDef core fill:#bbdefb,stroke:#0d47a1,stroke-width:2px;
    classDef ui fill:#c8e6c9,stroke:#2e7d32,stroke-width:2px;
    classDef logic fill:#ffe0b2,stroke:#ef6c00,stroke-width:2px;
    classDef module fill:#f8bbd0,stroke:#880e4f,stroke-width:2px;
    classDef data fill:#d7ccc8,stroke:#4e342e,stroke-width:2px;
    classDef native fill:#bbdefb,stroke:#1565c0,stroke-width:2px;
    classDef assets fill:#e1bee7,stroke:#6a1b9a,stroke-width:2px;

    %% Click Events
    click A "https://github.com/oscarbz-011/app_fluter_tfg/blob/main/lib/main.dart"
    click D "https://github.com/oscarbz-011/app_fluter_tfg/tree/main/lib/Models"
    click M1 "https://github.com/oscarbz-011/app_fluter_tfg/tree/main/lib/src/map"
    click M2 "https://github.com/oscarbz-011/app_fluter_tfg/tree/main/lib/src/menu"
    click M3 "https://github.com/oscarbz-011/app_fluter_tfg/tree/main/lib/src/news"
    click M4 "https://github.com/oscarbz-011/app_fluter_tfg/tree/main/lib/src/news_details"
    click M5 "https://github.com/oscarbz-011/app_fluter_tfg/tree/main/lib/src/report"
    click E "https://github.com/oscarbz-011/app_fluter_tfg/blob/main/lib/data.dart"
    click F "https://github.com/oscarbz-011/app_fluter_tfg/tree/main/android"
    click G "https://github.com/oscarbz-011/app_fluter_tfg/tree/main/ios"
    click H "https://github.com/oscarbz-011/app_fluter_tfg/tree/main/assets"
```
