# mamarco13/emoodiario architecture

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

- Interactive diagram: https://gitdiagram.com/mamarco13/emoodiario
- Repository: https://github.com/mamarco13/emoodiario

## Overview

##### File structure
- Top-level directories:
- android, ios, linux, macos, windows, web → platform hosts & native code (Gradle, Xcode, CMake)
- lib → the entire Flutter/Dart codebase, subdivided into:
– constants (emotion definitions, resource paths)
– models (e.g., MediaFile, representing a day’s media)
– screens (Calendar, EditDay, Video, FullscreenImage)
– utils (EmotionUtils, FFmpegHelpers)
– widgets (custom UI components)
- assets/audio & assets/readme_images → bundled media & documentation images
- pubspec.yaml / pubspec.lock → dependencies, including FFmpeg plugin
- test → widget tests
- No remote backend or network-related files: data is local (likely file system or embedded DB).

##### README for insights
- Four core UI flows:
2. **Edit_day_screen** (enter title, phrase, attach ≤3 media, assign 1–2 emotions with slider)
3. **Video_screen** (configure & generate month-summary video, choose music, filters, random order)
4. **Fullscreen_image_page** (view/download media, minimal UI)
- FFmpeg is used at runtime to stitch media clips into videos (via a custom helper).

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Flutter Layer"
        direction TB
        AppMain["main.dart"]:::ui
        subgraph "Presentation"
            direction TB
            Cal["CalendarScreen"]:::ui
            Edit["EditDayScreen"]:::ui
            Vid["VideoScreen"]:::ui
            Full["FullscreenImagePage"]:::ui
            Widgets["Shared Widgets"]:::ui
        end
        subgraph "Business Logic"
            direction TB
            EmotionUtils["EmotionUtils"]:::logic
            VidConfig["VideoConfig Builder"]:::logic
        end
        subgraph "Data Layer"
            direction TB
            MediaModel["MediaFile Model"]:::data
            Storage["Local Storage Manager"]:::data
            EmotionDefs["Emotion Definitions"]:::data
            VideoRes["Video Screen Resources"]:::data
        end
        subgraph "Service Layer"
            direction TB
            AssetMgr["AssetManager"]:::data
            FFmpegSvc["FFmpegHelpers"]:::logic
            PlatformChan["Platform Channel"]:::data
        end
    end

    subgraph "Assets"
        direction TB
        Audio["Audio Assets"]:::asset
        Images["Image Assets"]:::asset
        Videos["Generated Videos"]:::asset
    end

    subgraph "Native Hosts"
        direction TB
        Android["Android Host"]:::native
        iOS["iOS Host"]:::native
        Linux["Linux Host"]:::native
        macOS["macOS Host"]:::native
        Windows["Windows Host"]:::native
        FFmpegBin["FFmpeg Binary"]:::native
    end

    AppMain --> Cal
    AppMain --> Edit
    AppMain --> Vid
    AppMain --> Full

    Cal --> EmotionUtils
    Edit --> EmotionUtils
    Vid --> VidConfig
    Vid --> AssetMgr

    EmotionUtils --> MediaModel
    VidConfig --> FFmpegSvc

    MediaModel --> Storage
    EmotionDefs --> EmotionUtils
    VideoRes --> Vid

    AssetMgr --> Audio
    AssetMgr --> Images

    FFmpegSvc --> PlatformChan
    PlatformChan --> Android
    PlatformChan --> iOS
    PlatformChan --> Linux
    PlatformChan --> macOS
    PlatformChan --> Windows

    Android --> FFmpegBin
    iOS --> FFmpegBin
    Linux --> FFmpegBin
    macOS --> FFmpegBin
    Windows --> FFmpegBin

    FFmpegBin --> Videos
    Storage --> Videos
    Full --> Videos

    click Cal "https://github.com/mamarco13/emoodiario/blob/main/lib/screens/calendar_screen.dart"
    click Edit "https://github.com/mamarco13/emoodiario/blob/main/lib/screens/edit_day_screen.dart"
    click Vid "https://github.com/mamarco13/emoodiario/blob/main/lib/screens/video_screen.dart"
    click Full "https://github.com/mamarco13/emoodiario/blob/main/lib/screens/fullscreen_image_page.dart"
    click Widgets "https://github.com/mamarco13/emoodiario/tree/main/lib/widgets/"
    click EmotionUtils "https://github.com/mamarco13/emoodiario/blob/main/lib/utils/emotion_utils.dart"
    click FFmpegSvc "https://github.com/mamarco13/emoodiario/blob/main/lib/utils/ffmpeg_helpers.dart"
    click MediaModel "https://github.com/mamarco13/emoodiario/blob/main/lib/models/media_file.dart"
    click EmotionDefs "https://github.com/mamarco13/emoodiario/blob/main/lib/constants/emotions.dart"
    click VideoRes "https://github.com/mamarco13/emoodiario/blob/main/lib/constants/video_screen_resources.dart"
    click AppMain "https://github.com/mamarco13/emoodiario/blob/main/lib/main.dart"
    click Audio "https://github.com/mamarco13/emoodiario/tree/main/assets/audio/"
    click Android "https://github.com/mamarco13/emoodiario/blob/main/android/app/src/main/kotlin/com/example/app_emociones/MainActivity.kt"
    click iOS "https://github.com/mamarco13/emoodiario/blob/main/ios/Runner/AppDelegate.swift"
    click Linux "https://github.com/mamarco13/emoodiario/blob/main/linux/runner/main.cc"
    click macOS "https://github.com/mamarco13/emoodiario/blob/main/macos/Runner/AppDelegate.swift"
    click Windows "https://github.com/mamarco13/emoodiario/blob/main/windows/runner/main.cpp"

    classDef ui fill:#D0E7FF,stroke:#0366d6,stroke-width:1px
    classDef logic fill:#DFFFD0,stroke:#228B22,stroke-width:1px
    classDef data fill:#FFE4B5,stroke:#FF8C00,stroke-width:1px
    classDef asset fill:#E0E0E0,stroke:#888888,stroke-width:1px
    classDef native fill:#F0D0FF,stroke:#800080,stroke-width:1px
```
