# brahimbeloucif/myportfolio architecture

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

- Interactive diagram: https://gitdiagram.com/brahimbeloucif/myportfolio
- Repository: https://github.com/brahimbeloucif/myportfolio

## Overview

##### Project type and purpose
- This is a cross-platform mobile application built with Flutter.
- Its sole purpose is to showcase a personal portfolio (static content, no backend/API).

##### File structure
- Top-level directories:
- android/ – Android embedding, Gradle build scripts, Manifest, platform-specific Kotlin code (MainActivity)
- ios/   – iOS embedding, Xcode project, Swift AppDelegate, storyboards, asset catalogs
- lib/   – Dart code: UI screens (PortfolioScreen.dart), widgets (glassButton.dart, themeSwitch.dart), app entry (main.dart), configuration (app.dart), content modules
- assets/ – media assets (Rive animations, images, diplomas)
- test/  – widget test harness
- pubspec.yaml / lock – dependencies, asset registration
- No server or remote API dependencies—app is self-contained.

##### README for additional insights
- Contains screenshots of running app in Android emulator
- No textual architecture notes; code structure implies standard Flutter “single-page” portfolio with drawer and content screens

a. Main components:
- Presentation Layer (Widgets & Screens in lib/)
- Business/UI logic (State management if any – e.g., themeSwitch)
- Flutter Engine & Dart VM (framework core)
- Platform Embedder:
– Android embedding (android/app/src)
– iOS embedding (ios/Runner/)
- Asset Store (assets/, Rive .riv files, images)
- Build Tools: Gradle (Android), Xcode (iOS)
b. Relationships & interactions:
1. User taps UI widget → event to Dart code in lib/
2. Dart code calls Flutter Engine → renders UI, animations (Rive)
3. Flutter Engine communicates via Platform Channels to Android/iOS embedder for native services (e.g., orientation, lifecycle)
4. Build Tools package Dart AOT-compiled code + Flutter engine into native APK/IPA
c. Architectural patterns & design principles:
- MVC/MVVM-lite: UI widgets separated from content modules
- Single codebase for UI/business logic; platform code only wraps embedding
- Asset bundling via pubspec
d. Key technologies & frameworks:
- Dart & Flutter
- Rive for animations
- Android Gradle build system
- iOS Xcode/Swift embedder

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interaction
    User["User"]:::external
    User -->|"taps UI widget"| Presentation

    %% Flutter Layer
    subgraph "Flutter Layer"
        direction TB
        Presentation["Presentation Layer<br/>(UI Screens & Widgets)"]:::flutter
        BL["Business/UI Logic<br/>(State Management)"]:::flutter
        Engine["Flutter Engine"]:::flutter
        DartVM["Dart VM"]:::flutter
        Presentation -->|renders via| Engine
        BL -->|processes events| Presentation
        Presentation -->|calls business logic| BL
        Engine -->|executes code on| DartVM
    end

    %% Components inside Flutter Layer
    subgraph "Dart Code Files"
        direction TB
        Main["main.dart"]:::flutter
        App["app.dart"]:::flutter
        Screen["PortfolioScreen.dart"]:::flutter
        Contact["contact.dart"]:::flutter
        Drawer["portfolioDrawer.dart"]:::flutter
        Glass["glassButton.dart"]:::flutter
        Theme["themeswitch.dart"]:::flutter
        Content["portfolioContent.dart"]:::flutter
        Main --> App --> Screen --> Contact --> Drawer --> Glass --> Theme --> Content
        Content --> BL
        App --> BL
    end

    %% Platform Channels
    PlatformCh["Platform Channels"]:::flutter
    Engine -->|communicates via| PlatformCh

    %% Native Hosts
    subgraph "Android Host" 
        direction TB
        AHost["MainActivity.kt"]:::native
    end
    subgraph "iOS Host"
        direction TB
        IHost["AppDelegate.swift"]:::native
        XcodeProj["Runner.xcodeproj"]:::native
    end
    PlatformCh -->|to native services| AHost
    PlatformCh -->|to native services| IHost

    %% Asset Store
    subgraph "Asset Store"
        direction TB
        Riv1["shapes.riv"]:::asset
        Riv2["x.riv"]:::asset
        Diplomes["diplomes/"]:::asset
    end
    Riv1 --> Engine
    Riv2 --> Engine
    Diplomes --> Engine

    %% Dependency & Asset Registration
    subgraph "Dependency & Asset Registration"
        direction TB
        PubspecY["pubspec.yaml"]:::registration
        PubspecL["pubspec.lock"]:::registration
    end
    PubspecY --> AssetStore
    PubspecL --> AssetStore

    %% Build Tools
    subgraph "Build Tools"
        direction TB
        Gradle["Gradle Build System"]:::build
        Xcode["Xcode Build System"]:::build
    end
    PubspecY --> Gradle
    PubspecY --> Xcode
    Gradle -->|packages APK| APK["APK"]:::build
    Xcode -->|packages IPA| IPA["IPA"]:::build

    %% Testing
    Test["widget_test.dart"]:::test
    Test --> Presentation

    %% Click Events
    click Screen "https://github.com/brahimbeloucif/myportfolio/blob/main/lib/PortfolioScreen.dart"
    click Contact "https://github.com/brahimbeloucif/myportfolio/blob/main/lib/contact.dart"
    click Drawer "https://github.com/brahimbeloucif/myportfolio/blob/main/lib/portfolioDrawer.dart"
    click Glass "https://github.com/brahimbeloucif/myportfolio/blob/main/lib/glassButton.dart"
    click Theme "https://github.com/brahimbeloucif/myportfolio/blob/main/lib/themeswitch.dart"
    click Content "https://github.com/brahimbeloucif/myportfolio/blob/main/lib/portfolioContent.dart"
    click Main "https://github.com/brahimbeloucif/myportfolio/blob/main/lib/main.dart"
    click App "https://github.com/brahimbeloucif/myportfolio/blob/main/lib/app.dart"
    click Riv1 "https://github.com/brahimbeloucif/myportfolio/blob/main/assets/shapes.riv"
    click Riv2 "https://github.com/brahimbeloucif/myportfolio/blob/main/assets/x.riv"
    click Diplomes "https://github.com/brahimbeloucif/myportfolio/tree/main/assets/diplomes/"
    click AHost "https://github.com/brahimbeloucif/myportfolio/blob/main/android/app/src/main/kotlin/com/example/portfolio/MainActivity.kt"
    click Gradle "https://github.com/brahimbeloucif/myportfolio/blob/main/android/app/build.gradle"
    click XcodeProj "https://github.com/brahimbeloucif/myportfolio/tree/main/ios/Runner.xcodeproj/"
    click IHost "https://github.com/brahimbeloucif/myportfolio/blob/main/ios/Runner/AppDelegate.swift"
    click Test "https://github.com/brahimbeloucif/myportfolio/blob/main/test/widget_test.dart"
    click PubspecY "https://github.com/brahimbeloucif/myportfolio/blob/main/pubspec.yaml"
    click PubspecL "https://github.com/brahimbeloucif/myportfolio/blob/main/pubspec.lock"

    %% Styles
    classDef flutter fill:#1E90FF,stroke:#000,stroke-width:1px,color:#fff
    classDef native fill:#32CD32,stroke:#000,stroke-width:1px
    classDef asset fill:#FFD700,stroke:#000,stroke-width:1px
    classDef build fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef registration fill:#FFE4B5,stroke:#000,stroke-width:1px
    classDef external fill:#FFFACD,stroke:#000,stroke-width:1px,color:#000
    classDef test fill:#D8BFD8,stroke:#000,stroke-width:1px
```
