# apicharburanapa/e_hong_app architecture

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

- Interactive diagram: https://gitdiagram.com/apicharburanapa/e_hong_app
- Repository: https://github.com/apicharburanapa/e_hong_app

## Overview

##### Project Type and Purpose
- This is a **cross-platform mobile/desktop/web application** built with **Flutter** (Dart).
- It targets Android, iOS, Linux, macOS, Windows, and the Web using a single codebase under `lib/`.

##### File Structure
- Top-level “platform” folders:
– `android/` – Native Android embedding and Gradle build files
– `ios/`   – Native iOS embedding and Xcode project
– `linux/`, `macos/`, `windows/` – Desktop embeddings via CMake and native runners
- Shared app logic in `lib/`:
– `main.dart` – Application entrypoint and route setup
– `model/` – Domain objects (e.g., `profile.dart`)
– `screen/` – UI pages (e.g., `splash_screen.dart`, `login.dart`, `register.dart`, `home.dart`)
- Configuration files:
– `pubspec.yaml` – Dart/Flutter dependencies and assets
– Platform build scripts, manifest/plist files, Gradle/Kotlin or Xcode configs

##### README Insights
- Standard Flutter starter README. No custom backend or external services are documented—this appears to be a standalone client app.

##### Main Components
a. **Flutter App Core** (Dart code)
– Presentation Layer: Widgets/screens in `lib/screen/`
– Domain/Data Layer: Models in `lib/model/`
– App Entrypoint: `main.dart` (routes/navigation)
b. **Flutter Engine**
– Dart VM (debug) or AOT compiled code (release)
– Skia rendering engine
c. **Platform Embeddings**
– Android (via Kotlin), iOS (via Swift/Obj-C), Desktop (C++ runners), Web (HTML/JS/CSS)
d. **Operating Systems / Hardware**
e. *(Optional)* **External Services**

##### Relationships and Data Flows
- User interactions → Flutter UI Widgets (screens)
- UI invokes domain logic / model classes (e.g., loading or saving `Profile`)
- Flutter core communicates with native platform for things like:
– Plugin calls (camera, file system, network) via MethodChannels
– Asset loading (images from `assets/images`)
- Rendering pipeline: Dart code → Flutter Engine → Skia → GPU/Canvas on host OS
- Build pipeline: `flutter build apk/ios/…` generates platform binaries

##### Architectural Patterns / Design Principles
- **Layered Architecture**
– Presentation (Widgets) → Business Logic (state management, services) → Data (models, repositories)
- **Platform Abstraction**
– Single codebase → multiple native embeddings
- **Modularity**
– Separate folders for models vs. screens
- **Event-Driven / Reactive UI**
– StatelessWidget / StatefulWidget driven by state changes

##### Detail Checklist
– [ ] Presentation Layer: list all screens (Splash, Welcome, Login, Register, Home)
– [ ] Domain Layer: Profile model
– [ ] App Entrypoint and Navigation in `main.dart`
– [ ] Flutter Engine block (Dart VM / AOT, Skia)
– [ ] Native Embeddings: Android, iOS, Linux, macOS, Windows, Web
– [ ] Assets: images and configuration (`pubspec.yaml`)
– [ ] Build Tools: Flutter CLI → Gradle / Xcode / CMake / Browser bundler

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User Interaction
    User(("User")):::user
    User -->|"taps"| Splash

    %% Shared Dart Code
    subgraph "Shared Dart Code"
        subgraph "Presentation Layer"
            Splash["Splash Screen<br/>(splash_screen.dart)"]:::presentation
            Welcome["Welcome Screen<br/>(welcome.dart)"]:::presentation
            Login["Login Screen<br/>(login.dart)"]:::presentation
            Register["Register Screen<br/>(register.dart)"]:::presentation
            Home["Home Screen<br/>(home.dart)"]:::presentation
        end
        Model["Profile Model<br/>(profile.dart)"]:::domain
        Entrypoint["App Entrypoint<br/>(main.dart)"]:::entry
        Config["Pubspec Configuration<br/>(pubspec.yaml)"]:::config
    end

    %% Flutter Engine
    subgraph "Flutter Engine"
        VM["Dart VM / AOT"]:::engine
        Skia["Skia Rendering"]:::engine
    end

    %% Native Embedding Layers
    subgraph "Native Embedding"
        subgraph Android
            A1["MainActivity.kt"]:::native
            A2["build.gradle.kts"]:::native
            A3["AndroidManifest.xml"]:::native
        end
        subgraph iOS
            I1["AppDelegate.swift"]:::native
            I2["Info.plist"]:::native
            I3["Runner.xcodeproj"]:::native
        end
        subgraph Linux
            L1["main.cc"]:::native
            L2["my_application.cc"]:::native
            L3["CMakeLists.txt"]:::native
            L4["generated_plugin_registrant.cc"]:::native
        end
        subgraph macOS
            M1["AppDelegate.swift"]:::native
            M2["MainFlutterWindow.swift"]:::native
            M3["Runner.xcodeproj"]:::native
        end
        subgraph Windows
            W1["main.cpp"]:::native
            W2["flutter_window.cpp"]:::native
            W3["utils.cpp"]:::native
            W4["CMakeLists.txt"]:::native
        end
        subgraph Web
            Web1["index.html"]:::native
            Web2["manifest.json"]:::native
            Web3["icons/"]:::native
        end
    end

    %% OS / Hardware
    subgraph "OS / Hardware"
        AndroidDevice((Android)):::os
        iOSDevice((iOS)):::os
        WindowsPC((Windows)):::os
        macOSMachine((macOS)):::os
        LinuxBox((Linux)):::os
        Browser((Web Browser)):::os
    end

    %% Data & Navigation Flows
    Splash -->|"navigate"| Welcome
    Welcome -->|"navigate"| Login
    Login -->|"onSuccess"| Home
    Register -->|"onSuccess"| Home
    Login -->|"navigate to register"| Register
    Home -->|"loads data"| Model
    Model -->|"provided by"| Entrypoint
    Entrypoint -->|"defines routes"| Splash
    Entrypoint -->|"defines routes"| Welcome
    Entrypoint -->|"defines routes"| Login
    Entrypoint -->|"defines routes"| Register
    Entrypoint -->|"defines routes"| Home
    Config -->|"defines assets & deps"| Entrypoint

    %% Engine Rendering & Platform Channels
    Home -->|"renders"| VM
    VM -->|"draws with"| Skia
    Skia -->|"renders on"| AndroidDevice
    Skia -->|"renders on"| iOSDevice
    Skia -->|"renders on"| WindowsPC
    Skia -->|"renders on"| macOSMachine
    Skia -->|"renders on"| LinuxBox
    Skia -->|"renders on"| Browser

    VM -->|"plugin calls"| A1
    VM -->|"plugin calls"| I1
    VM -->|"plugin calls"| L1
    VM -->|"plugin calls"| M1
    VM -->|"plugin calls"| W1
    VM -->|"plugin calls"| Web1

    %% Click Events
    click Splash "https://github.com/apicharburanapa/e_hong_app/blob/main/lib/screen/splash_screen.dart"
    click Welcome "https://github.com/apicharburanapa/e_hong_app/blob/main/lib/screen/welcome.dart"
    click Login "https://github.com/apicharburanapa/e_hong_app/blob/main/lib/screen/login.dart"
    click Register "https://github.com/apicharburanapa/e_hong_app/blob/main/lib/screen/register.dart"
    click Home "https://github.com/apicharburanapa/e_hong_app/blob/main/lib/screen/home.dart"
    click Model "https://github.com/apicharburanapa/e_hong_app/blob/main/lib/model/profile.dart"
    click Entrypoint "https://github.com/apicharburanapa/e_hong_app/blob/main/lib/main.dart"
    click Config "https://github.com/apicharburanapa/e_hong_app/blob/main/pubspec.yaml"
    click A1 "https://github.com/apicharburanapa/e_hong_app/blob/main/android/app/src/main/kotlin/com/example/e_hong_app/MainActivity.kt"
    click A2 "https://github.com/apicharburanapa/e_hong_app/blob/main/android/app/build.gradle.kts"
    click A3 "https://github.com/apicharburanapa/e_hong_app/blob/main/android/app/src/main/AndroidManifest.xml"
    click I1 "https://github.com/apicharburanapa/e_hong_app/blob/main/ios/Runner/AppDelegate.swift"
    click I2 "https://github.com/apicharburanapa/e_hong_app/blob/main/ios/Runner/Info.plist"
    click I3 "https://github.com/apicharburanapa/e_hong_app/blob/main/ios/Runner.xcodeproj"
    click L1 "https://github.com/apicharburanapa/e_hong_app/blob/main/linux/runner/main.cc"
    click L2 "https://github.com/apicharburanapa/e_hong_app/blob/main/linux/runner/my_application.cc"
    click L3 "https://github.com/apicharburanapa/e_hong_app/blob/main/linux/CMakeLists.txt"
    click L4 "https://github.com/apicharburanapa/e_hong_app/blob/main/linux/flutter/generated_plugin_registrant.cc"
    click M1 "https://github.com/apicharburanapa/e_hong_app/blob/main/macos/Runner/AppDelegate.swift"
    click M2 "https://github.com/apicharburanapa/e_hong_app/blob/main/macos/Runner/MainFlutterWindow.swift"
    click M3 "https://github.com/apicharburanapa/e_hong_app/blob/main/macos/Runner.xcodeproj"
    click W1 "https://github.com/apicharburanapa/e_hong_app/blob/main/windows/runner/main.cpp"
    click W2 "https://github.com/apicharburanapa/e_hong_app/blob/main/windows/runner/flutter_window.cpp"
    click W3 "https://github.com/apicharburanapa/e_hong_app/blob/main/windows/runner/utils.cpp"
    click W4 "https://github.com/apicharburanapa/e_hong_app/blob/main/windows/CMakeLists.txt"
    click Web1 "https://github.com/apicharburanapa/e_hong_app/blob/main/web/index.html"
    click Web2 "https://github.com/apicharburanapa/e_hong_app/blob/main/web/manifest.json"
    click Web3 "https://github.com/apicharburanapa/e_hong_app/tree/main/web/icons/"

    %% Styles
    classDef presentation fill:#D0E8FF,stroke:#0366D6,color:#0366D6
    classDef domain fill:#E8F8D0,stroke:#6DAC36,color:#6DAC36
    classDef entry fill:#D0F0E8,stroke:#239A78,color:#239A78
    classDef engine fill:#E0FFE0,stroke:#00A000,color:#006000
    classDef native fill:#FFE8D0,stroke:#D67A00,color:#D67A00
    classDef os fill:#F0F0F0,stroke:#909090,color:#909090
    classDef config fill:#FFF4D0,stroke:#D6B700,color:#D6B700
    classDef user fill:#FFE0E0,stroke:#D00000,color:#D00000
```
