# likemindscommunity/likeminds-feed-flutter architecture

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

- Interactive diagram: https://gitdiagram.com/likemindscommunity/likeminds-feed-flutter
- Repository: https://github.com/likemindscommunity/likeminds-feed-flutter

## Overview

##### Main Components
- Flutter SDK Core – This is the heart of the project that drives feed functionality.
- UI Package (located in packages/ui) – Contains all the UI widgets, models, and styling for feed items, posts, comments, notifications, and related social elements.
- Integration Package (located in packages/integration) – Holds the business logic, Bloc implementations, services, state management, converters, and utility functions. This package handles things like analytics, comment handling, media services (e.g., Amazon S3 service), deep links, and more.
- Example Apps – The “example” and “example_video_feed” directories include sample applications (with Android, iOS, web platforms) that demonstrate the usage of the SDK. These examples validate the integration between the UI and integration packages.
- Build & Configuration Files – Files such as pubspec.yaml, melos.yaml, and platform-specific configurations show how the project is structured for multi-platform support and package management.

##### Understand the Architectural Patterns
- Bloc Pattern – Notice the extensive use of “bloc” directories throughout integration (e.g., analytics, comment, compose, feedroom, moderation, post, etc.). This project strongly depends on the Bloc pattern for state management and business logic separation.
- Modular/Monorepo Architecture – With separate packages for integration and UI, as well as examples, the design emphasizes modularity. This allows teams to work on independent components that integrate smoothly.
- MVC/MVVM-Like Separation – While not a classic MVC, you see a separation between UI (views and widgets) and business logic (Blocs, services, converters).

##### Summarizing the Implementation
– The division between the UI package (packages/ui) and the Integration package (packages/integration) inside the monorepo.
– The entry-point Example apps that show how to assemble these packages into a working application.
– The submodules inside Integration, particularly the Bloc-based architecture handling various features (feed, comment, compose, moderation, etc.).
– The interconnections with external services like Firebase and AWS, as well as the central role of asset management.
– The use of well-organized folders for models, converters, configurations, and utilities that support both UI and business logic.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Feed SDK"
        %% UI Layer
        subgraph "UI Layer"
            UIP["UI Package – Feed Widgets"]:::ui
            UI_LIB["UI Lib (Widgets/Models)"]:::ui
            UI_ASSETS["UI Assets (Icons/Images)"]:::ui
            UIP --> UI_LIB
            UIP --> UI_ASSETS
        end

        %% Integration Layer
        subgraph "Integration Layer"
            INT["Integration Package"]:::integration
            CORE["Flutter SDK Core"]:::integration
            INT --> CORE

            subgraph "Bloc Modules"
                AB["Analytics Bloc"]:::bloc
                CB["Comment Bloc"]:::bloc
                COMPB["Compose Bloc"]:::bloc
                FB["Feedroom Bloc"]:::bloc
                MB["Moderation Bloc"]:::bloc
                NB["Notification Bloc"]:::bloc
            end
            CORE --> AB
            CORE --> CB
            CORE --> COMPB
            CORE --> FB
            CORE --> MB
            CORE --> NB

            CONV["Converters"]:::util
            UTIL["Utility Functions"]:::util

            subgraph "External Services"
                S3["Amazon S3 Service"]:::external
                MS["Media Service"]:::external
            end

            %% Connections within Integration Layer
            AB --> CONV
            AB --> UTIL
            CB --> CONV
            CB --> UTIL
            COMPB --> CONV
            COMPB --> UTIL

            AB --> S3
            AB --> MS

            CONV --> UI_LIB
            UTIL --> UI_LIB

            %% UI triggering Integration (via Bloc Events)
            UI_LIB --> AB
            UI_LIB --> CB
            UI_LIB --> COMPB
        end

        %% Example Applications
        subgraph "Example Applications"
            EX["Example App"]:::example
            EXVF["Example Video Feed App"]:::example
            EX --> UIP
            EXVF --> UIP
        end
    end

    %% Click Events
    click CORE "https://github.com/likemindscommunity/likeminds-feed-flutter/blob/master/packages/integration/lib/likeminds_feed_core.dart"
    click UIP "https://github.com/likemindscommunity/likeminds-feed-flutter/tree/master/packages/ui"
    click INT "https://github.com/likemindscommunity/likeminds-feed-flutter/tree/master/packages/integration"
    click UI_LIB "https://github.com/likemindscommunity/likeminds-feed-flutter/tree/master/packages/ui/lib/src"
    click UI_ASSETS "https://github.com/likemindscommunity/likeminds-feed-flutter/tree/master/packages/ui/assets"
    click AB "https://github.com/likemindscommunity/likeminds-feed-flutter/tree/master/packages/integration/lib/src/bloc"
    click CONV "https://github.com/likemindscommunity/likeminds-feed-flutter/tree/master/packages/integration/lib/src/convertors"
    click UTIL "https://github.com/likemindscommunity/likeminds-feed-flutter/tree/master/packages/integration/lib/src/utils"
    click S3 "https://github.com/likemindscommunity/likeminds-feed-flutter/blob/master/packages/integration/lib/src/services/lm_amazon_s3_service.dart"
    click MS "https://github.com/likemindscommunity/likeminds-feed-flutter/blob/master/packages/integration/lib/src/services/media_service.dart"
    click EX "https://github.com/likemindscommunity/likeminds-feed-flutter/tree/master/example"
    click EXVF "https://github.com/likemindscommunity/likeminds-feed-flutter/tree/master/example_video_feed"

    %% Styles
    classDef ui fill:#A6E1FA,stroke:#333,stroke-width:2px;
    classDef integration fill:#F9E79F,stroke:#333,stroke-width:2px;
    classDef bloc fill:#F5B7B1,stroke:#333,stroke-width:2px;
    classDef util fill:#D2B4DE,stroke:#333,stroke-width:2px;
    classDef external fill:#D5F5E3,stroke:#333,stroke-width:2px;
    classDef example fill:#FAD7A0,stroke:#333,stroke-width:2px;
```
