# thanhlh-vaix/vice-animation architecture

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

- Interactive diagram: https://gitdiagram.com/thanhlh-vaix/vice-animation
- Repository: https://github.com/thanhlh-vaix/vice-animation

## Overview

##### Project type and purpose
- This is a cross-platform mobile application built with Flutter (Dart) targeting Android & iOS.
- The app (“vice_app”) renders a list of magazine editions (home feature) and detailed magazine pages (magazines_details feature) using locally bundled assets.

##### File structure
- Top-level platform folders:
- `android/` – native Android project wrapper & Gradle build files
- `ios/` – native iOS Xcode project wrapper & CocoaPods files
- Dart source in `lib/`:
- `lib/core/` – shared modules: app entrypoint, constants, theme, common widgets, domain entities
- `lib/features/` – feature-driven layers:
– `home/` – home screen UI & widgets
– `magazines_details/` – details screen UI & widgets
- `lib/main.dart` – application entrypoint
- Assets in `assets/img/` – magazine cover images, sample art
- Configuration: `pubspec.yaml` (dependencies), platform build scripts

##### README
- Standard Flutter starter README – confirms Flutter SDK usage.
- No remote API references: likely purely local data/asset-driven UI.

##### Main components & their relationships
a. Components:
- Mobile Device (Android / iOS)
- Flutter Engine & Framework
- App Layer (Dart code):
– Entry (main.dart)
– Core Module
· App setup & routing
· Theme & UI constants
· Shared domain entities
· Common widgets
– Feature Modules
· Home Feature (home_screen, list widgets)
· Magazine Details Feature (details_screen, page view widgets)
– Assets (images)
- Native Embedding (Android Activity / iOS AppDelegate)
b. Interactions:
- At launch: Native shell → Flutter engine → `main.dart`
- UI navigates between Home & Details via Flutter Navigator
- UI widgets consume domain entities & theme constants from Core
- Widgets load images from the assets bundle
c. Architectural patterns & principles:
- Feature-based modularization (core vs. feature)
- Layered separation: Presentation (screens & widgets) ↔ Domain (entities)
- Single entrypoint, shared theme & constants
d. Key technologies:
- Flutter framework (Dart)
- Gradle & Android SDK / CocoaPods & Xcode for native shells
- Asset bundling via pubspec.yaml

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Native Shells
    androidShell["Android Shell"]:::native
    iosShell["iOS Shell"]:::native

    %% Flutter Engine
    flutterEngine["Flutter Engine"]:::engine

    %% Flutter Application
    subgraph "Flutter App"
        entry["main.dart / App Entry"]:::app

        subgraph "Core Module"
            appSetup["ViceApp (app/vice_app.dart)"]:::core
            theme["Theme & UI Constants"]:::core
            sharedEntities["Shared Domain Entities"]:::core
            commonWidgets["Common Widgets"]:::core
        end

        subgraph "Feature Modules"
            subgraph "Home Feature"
                homeScreen["Home Screen"]:::feature
                homeWidgets["Home Widgets"]:::feature
            end
            subgraph "Magazine Details Feature"
                detailsScreen["Details Screen"]:::feature
                detailsWidgets["Details Widgets"]:::feature
            end
        end
    end

    %% Assets
    assetBundle["Assets Bundle"]:::asset

    %% Connections
    androidShell -->|"launch"| flutterEngine
    iosShell -->|"launch"| flutterEngine
    flutterEngine -->|"run App"| entry

    entry -->|"initializes"| appSetup
    entry -->|"configures routing"| homeScreen
    entry -->|"configures routing"| detailsScreen

    appSetup -->|"loads theme"| theme
    homeScreen -->|"uses theme"| theme
    detailsScreen -->|"uses theme"| theme

    homeScreen -->|"depends on"| commonWidgets
    detailsScreen -->|"depends on"| commonWidgets

    homeScreen -->|"uses entities"| sharedEntities
    detailsScreen -->|"uses entities"| sharedEntities

    assetBundle -->|"provides images"| commonWidgets
    assetBundle -->|"provides images"| homeWidgets
    assetBundle -->|"provides images"| detailsWidgets

    homeScreen -->|"builds UI with"| homeWidgets
    detailsScreen -->|"builds UI with"| detailsWidgets

    homeScreen -->|"navigates to"| detailsScreen
    detailsScreen -->|"navigates to"| homeScreen

    %% Click Events
    click androidShell "https://github.com/thanhlh-vaix/vice-animation/tree/main/android/"
    click iosShell "https://github.com/thanhlh-vaix/vice-animation/tree/main/ios/"
    click entry "https://github.com/thanhlh-vaix/vice-animation/blob/main/lib/main.dart"
    click appSetup "https://github.com/thanhlh-vaix/vice-animation/blob/main/lib/core/app/vice_app.dart"
    click theme "https://github.com/thanhlh-vaix/vice-animation/blob/main/lib/core/theme/theme.dart"
    click sharedEntities "https://github.com/thanhlh-vaix/vice-animation/blob/main/lib/core/shared/domain/domain.dart"
    click commonWidgets "https://github.com/thanhlh-vaix/vice-animation/blob/main/lib/core/shared/presentation/widgets/widgets.dart"
    click homeScreen "https://github.com/thanhlh-vaix/vice-animation/blob/main/lib/features/home/presentation/screens/home_screen.dart"
    click homeWidgets "https://github.com/thanhlh-vaix/vice-animation/blob/main/lib/features/home/presentation/widgets/widgets.dart"
    click detailsScreen "https://github.com/thanhlh-vaix/vice-animation/blob/main/lib/features/magazines_details/presentation/screens/magazines_details_screen.dart"
    click detailsWidgets "https://github.com/thanhlh-vaix/vice-animation/blob/main/lib/features/magazines_details/presentation/widgets/widgets.dart"
    click assetBundle "https://github.com/thanhlh-vaix/vice-animation/tree/main/assets/img/"

    %% Styles
    classDef native fill:#cccccc,stroke:#333,stroke-width:1px
    classDef engine fill:#add8e6,stroke:#333,stroke-width:1px
    classDef core fill:#98fb98,stroke:#333,stroke-width:1px
    classDef feature fill:#ffa500,stroke:#333,stroke-width:1px
    classDef asset fill:#ffff99,stroke:#333,stroke-width:1px
    classDef app fill:#d3d3d3,stroke:#333,stroke-width:1px
```
