# pedroermarinho/site architecture

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

- Interactive diagram: https://gitdiagram.com/pedroermarinho/site
- Repository: https://github.com/pedroermarinho/site

## Overview

##### Project Type and Purpose
- This is a Flutter application that serves as a personal portfolio site developed by Pedro Marinho. It targets multiple platforms (Android, iOS, Linux desktop, and Web) and showcases personal projects, academic details, work experience, and more.
- The README clearly states that it’s a “Portfolio” and gives installation instructions using “flutter run”. The presence of platform-specific directories (android, ios, linux, web) confirms the cross-platform nature of the application.

##### Analysis of the File Structure
- Top-Level Directories: Notice directories like “android”, “ios”, “linux”, “web” which indicate the cross-platform builds.
- The main Flutter code resides in the “lib” directory. Inside “lib/app” the code is split into several subdirectories:
- “config”: holds application configuration (constants, assets paths, environment, error configurations).
- “data”: holds repositories (for GitHub data, markdown, settings, theme) and services (like storage service). These represent data access layers for external (or local) data.
- “domain”: contains entities, errors, use cases, and view models. This represents the business logic layer following a clean architecture approach.
- “ui”: represents the presentation layer with different pages (home, markdown, projects, settings) and components. It also includes shared components and widgets.
- “utils” and “generated”: additional helper classes and automatically generated code.
- The test directory mirrors the structure for unit tests for repositories and use cases.

##### Specific Elements
- Clear labels for each component, for example: “Platform (Android/iOS/…)", “Flutter App Entry (main.dart)”, “UI Layer”, “ViewModels”, “Domain/Use Cases”, “Data Repositories (GitHub, Markdown, Settings, Theme)”, “Local/Remote Services”, “Configuration & Utilities”.
- From UI -> ViewModels -> Use Cases -> Repositories -> Services.
- Feedback loops for error handling and configuration.
- Optionally, include annotations for key technologies like Flutter, Dart, and any notable libraries (e.g., PDF generation utilities).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Platform Entry Points"
        A1["Android"]:::platform
        A2["iOS"]:::platform
        A3["Linux"]:::platform
        A4["Web"]:::platform
    end

    A1 --> B1["Flutter App Entry (main.dart)"]:::app
    A2 --> B1
    A3 --> B1
    A4 --> B1

    B1 --> C1["UI Layer (lib/app/ui)"]:::ui
    C1 --> D1["Domain Layer (ViewModels & Use Cases)"]:::domain
    D1 --> E2["Repositories (lib/app/data/repositories)"]:::data
    E2 --> E3["Services (lib/app/data/services)"]:::data

    E2 -->|"fetch"| G1["GitHub/Markdown API"]:::external
    G1 -->|"response"| E2

    F1["Configuration (lib/app/config)"]:::config
    F2["Utilities (lib/app/utils)"]:::utility
    F1 --- B1
    F2 --- B1

    click A1 "https://github.com/pedroermarinho/site/blob/master/android/app/src/main/kotlin/io/github/pedroermarinho/site/MainActivity.kt"
    click A2 "https://github.com/pedroermarinho/site/blob/master/ios/Runner/AppDelegate.swift"
    click A3 "https://github.com/pedroermarinho/site/blob/master/linux/main.cc"
    click A4 "https://github.com/pedroermarinho/site/blob/master/web/index.html"
    click B1 "https://github.com/pedroermarinho/site/blob/master/lib/main.dart"
    click C1 "https://github.com/pedroermarinho/site/tree/master/lib/app/ui"
    click D1 "https://github.com/pedroermarinho/site/tree/master/lib/app/domain"
    click E2 "https://github.com/pedroermarinho/site/tree/master/lib/app/data/repositories"
    click E3 "https://github.com/pedroermarinho/site/tree/master/lib/app/data/services"
    click F1 "https://github.com/pedroermarinho/site/tree/master/lib/app/config"
    click F2 "https://github.com/pedroermarinho/site/tree/master/lib/app/utils"

    classDef platform fill:#AEDFF7,stroke:#005F6B,stroke-width:2px;
    classDef app fill:#C1F0C1,stroke:#0B620B,stroke-width:2px;
    classDef ui fill:#FFF1BA,stroke:#E6B800,stroke-width:2px;
    classDef domain fill:#F7C6C7,stroke:#C70039,stroke-width:2px;
    classDef data fill:#E6E6E6,stroke:#4D4D4D,stroke-width:2px;
    classDef config fill:#E0BBE4,stroke:#9B59B6,stroke-width:2px;
    classDef utility fill:#FFDFBA,stroke:#FF851B,stroke-width:2px;
    classDef external fill:#D0E1F9,stroke:#0074D9,stroke-width:2px;
```
