# rama-anwar/task5 architecture

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

- Interactive diagram: https://gitdiagram.com/rama-anwar/task5
- Repository: https://github.com/rama-anwar/task5

## Overview

##### Project Type and Purpose
- Cross-platform Flutter mobile (and desktop/web) application.
- Presents a “Store” of courses and a “Favorites” page, using in-app sample data (no backend service).
- Key functionalities: display categories, list courses, add/remove favorites, search/filter courses.

##### High-Level Architectural Layers
a. Platform Layer
– Android, iOS, Web, Windows, macOS, Linux native shells
– Hosts the Flutter Engine
b. Flutter Engine
– Skia renderer, platform channels, text/layout, Dart VM
c. Flutter Framework (Dart)
– Widgets, Rendering, Foundation, Services
d. Application Code
– Data Layer – lib/data/*.dart (sampleStoreData, sampleFavData)
– Domain Models – lib/models/*.dart (CourseModel, CategoriesModel)
– Business Logic – lib/helperFunctions.dart (add/remove favorite, filters)
– Presentation Layer
- Screens – lib/screens/{storePage.dart, favoritesPage.dart}
- Widgets – lib/widgets/*.dart (CourseCard, SearchBar, etc.)
e. Configuration & Build
– pubspec.yaml (dependencies, assets)
– android/, ios/, web/, linux/, macos/, windows/ (platform build files)

##### Main Components & Their Relationships
↳ Embed → Flutter Engine
2. Flutter Engine
↳ Hosts → Dart VM & Skia Renderer
↳ Communicates via → Platform Channels (if Native plugins were used)
3. Flutter Framework
↳ Provides → Widgets Library, Rendering Tree, Gestures, etc.
4. Application Code
– main.dart → boots the app, initializes routes to StorePage & FavoritesPage
– StorePage / FavoritesPage → orchestrate UI composition
– Widgets → reusable UI components
– HelperFunctions → pure Dart functions for business rules
– Data Layer → in-memory lists of courses & favorites
– Models → typed data structures used by both functions & UI
5. Assets
↳ Rendered by → Widgets (e.g., CourseImage uses assets/courses)

##### Architectural Patterns & Design Principles
- Layered architecture: Presentation → Business Logic → Data → Models
- Separation of concerns:
– UI code stays within Screens/Widgets
– Business logic is isolated in helperFunctions
– Data is decoupled as sample data files
- Stateless components: most widgets are StatelessWidget, derive data via parameters
- No external network calls or databases in this iteration

##### Final Checklist
– Each layer clearly separated and labeled

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Platform Layer
    subgraph "Platform Shells"
        direction TB
        Android["Android"]:::platform
        iOS["iOS"]:::platform
        Web["Web"]:::platform
        Linux["Linux"]:::platform
        macOS["macOS"]:::platform
        Windows["Windows"]:::platform
    end

    %% Flutter Engine
    FlutterEngine["Flutter Engine\n(Skia, Dart VM)"]:::engine

    %% Flutter Framework
    subgraph "Flutter Framework"
        direction TB
        WidgetsLib["Widgets, Rendering, Gestures"]:::framework
        Foundation["Foundation, Services"]:::framework
    end

    %% Application Code
    subgraph "Application Code"
        direction TB

        Entry["main.dart"]:::app
        subgraph "Data Layer"
            direction TB
            StoreData["sampleStoreData.dart"]:::app
            FavData["sampleFavData.dart"]:::app
        end
        subgraph "Domain Models"
            direction TB
            CourseModel["courseModel.dart"]:::app
            CategoriesModel["categoriesModel.dart"]:::app
        end
        subgraph "Business Logic"
            direction TB
            Helper["helperFunctions.dart"]:::app
            AddFav["add_to_favorites.dart"]:::app
            RemFav["remove_from_favorites.dart"]:::app
            InFav["inFavorites.dart"]:::app
            GetCatByCourse["get_category_by_course.dart"]:::app
            GetCoursesByCat["get_courses_by_category.dart"]:::app
            GetFiltered["get_filtered_courses.dart"]:::app
        end
        subgraph "Presentation"
            direction TB
            subgraph "Screens"
                StorePage["storePage.dart"]:::app
                FavPage["favoritesPage.dart"]:::app
            end
            subgraph "Widgets"
                CourseCard["courseCard.dart"]:::app
                FavCard["favoriteCourseCard.dart"]:::app
                CourseImage["courseImage.dart"]:::app
                SearchBar["searchBar.dart"]:::app
                CategoriesRow["categoriesRow.dart"]:::app
                CoursesList["coursesListBuilder.dart"]:::app
                FavList["favCourseListBuilder.dart"]:::app
                FavIcon["favoriteIcon.dart"]:::app
                ArrowBtn["arrowIconBtn.dart"]:::app
                CircularBG["circularBackground.dart"]:::app
                Footer["footer.dart"]:::app
                Header["header.dart"]:::app
                PopularCat["popularCategory.dart"]:::app
                CategoryWidget["category.dart"]:::app
            end
        end
    end

    %% Assets
    subgraph "Assets"
        direction TB
        AssetsCourses["assets/courses/"]:::assets
        AssetsIcons["assets/icons/"]:::assets
        AssetsBottomLogos["assets/bottom logos/"]:::assets
        AssetsNormalLogos["assets/normal logos/"]:::assets
    end

    %% Configuration & Build
    subgraph "Configuration & Build"
        direction TB
        Pubspec["pubspec.yaml"]:::config
        Gradle["android/app/build.gradle.kts"]:::config
        XcodeIOS["ios/Runner.xcodeproj"]:::config
        IndexHTML["web/index.html"]:::config
        CMakeLinux["linux/CMakeLists.txt"]:::config
        XcodeMac["macos/Runner.xcodeproj"]:::config
        CMakeWin["windows/CMakeLists.txt"]:::config
        Analysis["analysis_options.yaml"]:::config
        Gitignore[".gitignore"]:::config
        Readme["README.md"]:::config
    end

    %% Connections
    Android -->|embeds| FlutterEngine
    iOS -->|embeds| FlutterEngine
    Web -->|embeds| FlutterEngine
    Linux -->|embeds| FlutterEngine
    macOS -->|embeds| FlutterEngine
    Windows -->|embeds| FlutterEngine

    FlutterEngine -->|hosts| WidgetsLib
    FlutterEngine -->|hosts| Foundation

    WidgetsLib -->|provides| Entry
    Foundation -->|supports| Entry

    Entry -->|initializes| StorePage
    Entry -->|initializes| FavPage

    StorePage -->|uses| CourseCard
    StorePage -->|calls| Helper
    FavPage -->|uses| FavCard
    FavPage -->|calls| Helper

    Helper -->|reads| StoreData
    Helper -->|reads| FavData
    Helper -->|utilizes| CourseModel
    Helper -->|utilizes| CategoriesModel

    CourseCard -->|loads| CourseImage
    CourseCard -->|invokes| Helper
    SearchBar -->|filters via| Helper

    CourseImage -->|consumes| AssetsCourses
    CourseCard -->|consumes| AssetsIcons
    Header -->|consumes| AssetsNormalLogos
    Footer -->|consumes| AssetsBottomLogos

    %% Config relationships
    Pubspec -->|registers| AssetsCourses
    Pubspec -->|registers| AssetsIcons
    Gradle -->|builds| Android
    XcodeIOS -->|builds| iOS
    IndexHTML -->|hosts| Web
    CMakeLinux -->|builds| Linux
    XcodeMac -->|builds| macOS
    CMakeWin -->|builds| Windows

    %% Click Events
    click Android "https://github.com/rama-anwar/task5/tree/master/android/"
    click iOS "https://github.com/rama-anwar/task5/tree/master/ios/"
    click Web "https://github.com/rama-anwar/task5/tree/master/web/"
    click Linux "https://github.com/rama-anwar/task5/tree/master/linux/"
    click macOS "https://github.com/rama-anwar/task5/tree/master/macos/"
    click Windows "https://github.com/rama-anwar/task5/tree/master/windows/"
    click Entry "https://github.com/rama-anwar/task5/blob/master/lib/main.dart"
    click StoreData "https://github.com/rama-anwar/task5/blob/master/lib/data/sampleStoreData.dart"
    click FavData "https://github.com/rama-anwar/task5/blob/master/lib/data/sampleFavData.dart"
    click CourseModel "https://github.com/rama-anwar/task5/blob/master/lib/models/courseModel.dart"
    click CategoriesModel "https://github.com/rama-anwar/task5/blob/master/lib/models/categoriesModel.dart"
    click Helper "https://github.com/rama-anwar/task5/blob/master/lib/helperFunctions.dart"
    click AddFav "https://github.com/rama-anwar/task5/blob/master/lib/helperFunctions.dart/add_to_favorites.dart"
    click RemFav "https://github.com/rama-anwar/task5/blob/master/lib/helperFunctions.dart/remove_from_favorites.dart"
    click InFav "https://github.com/rama-anwar/task5/blob/master/lib/helperFunctions.dart/inFavorites.dart"
    click GetCatByCourse "https://github.com/rama-anwar/task5/blob/master/lib/helperFunctions.dart/get_category_by_course.dart"
    click GetCoursesByCat "https://github.com/rama-anwar/task5/blob/master/lib/helperFunctions.dart/get_courses_by_category.dart"
    click GetFiltered "https://github.com/rama-anwar/task5/blob/master/lib/helperFunctions.dart/get_filtered_courses.dart"
    click StorePage "https://github.com/rama-anwar/task5/blob/master/lib/screens/storePage.dart"
    click FavPage "https://github.com/rama-anwar/task5/blob/master/lib/screens/favoritesPage.dart"
    click CourseCard "https://github.com/rama-anwar/task5/blob/master/lib/widgets/courseCard.dart"
    click FavCard "https://github.com/rama-anwar/task5/blob/master/lib/widgets/favoriteCourseCard.dart"
    click CourseImage "https://github.com/rama-anwar/task5/blob/master/lib/widgets/courseImage.dart"
    click SearchBar "https://github.com/rama-anwar/task5/blob/master/lib/widgets/searchBar.dart"
    click CategoriesRow "https://github.com/rama-anwar/task5/blob/master/lib/widgets/categoriesRow.dart"
    click CoursesList "https://github.com/rama-anwar/task5/blob/master/lib/widgets/coursesListBuilder.dart"
    click FavList "https://github.com/rama-anwar/task5/blob/master/lib/widgets/favCourseListBuilder.dart"
    click FavIcon "https://github.com/rama-anwar/task5/blob/master/lib/widgets/favoriteIcon.dart"
    click ArrowBtn "https://github.com/rama-anwar/task5/blob/master/lib/widgets/arrowIconBtn.dart"
    click CircularBG "https://github.com/rama-anwar/task5/blob/master/lib/widgets/circularBackground.dart"
    click Footer "https://github.com/rama-anwar/task5/blob/master/lib/widgets/footer.dart"
    click Header "https://github.com/rama-anwar/task5/blob/master/lib/widgets/header.dart"
    click PopularCat "https://github.com/rama-anwar/task5/blob/master/lib/widgets/popularCategory.dart"
    click CategoryWidget "https://github.com/rama-anwar/task5/blob/master/lib/widgets/category.dart"
    click AssetsCourses "https://github.com/rama-anwar/task5/tree/master/assets/courses/"
    click AssetsIcons "https://github.com/rama-anwar/task5/tree/master/assets/icons/"
    click AssetsBottomLogos "https://github.com/rama-anwar/task5/tree/master/assets/bottom logos/"
    click AssetsNormalLogos "https://github.com/rama-anwar/task5/tree/master/assets/normal logos/"
    click Pubspec "https://github.com/rama-anwar/task5/blob/master/pubspec.yaml"
    click Gradle "https://github.com/rama-anwar/task5/blob/master/android/app/build.gradle.kts"
    click XcodeIOS "https://github.com/rama-anwar/task5/blob/master/ios/Runner.xcodeproj"
    click IndexHTML "https://github.com/rama-anwar/task5/blob/master/web/index.html"
    click CMakeLinux "https://github.com/rama-anwar/task5/blob/master/linux/CMakeLists.txt"
    click XcodeMac "https://github.com/rama-anwar/task5/blob/master/macos/Runner.xcodeproj"
    click CMakeWin "https://github.com/rama-anwar/task5/blob/master/windows/CMakeLists.txt"
    click Analysis "https://github.com/rama-anwar/task5/blob/master/analysis_options.yaml"
    click Gitignore "https://github.com/rama-anwar/task5/blob/master/.gitignore"
    click Readme "https://github.com/rama-anwar/task5/blob/master/README.md"

    %% Styles
    classDef platform fill:#cccccc,stroke:#333,stroke-width:1px
    classDef engine fill:#333333,stroke:#000,stroke-width:1px,color:#fff
    classDef framework fill:#add8e6,stroke:#000,stroke-width:1px
    classDef app fill:#90ee90,stroke:#006400,stroke-width:1px
    classDef assets fill:#fffacd,stroke:#999,stroke-width:1px
    classDef config fill:#ffcccb,stroke:#900,stroke-width:1px
```
