# leetaogoooo/rssaid architecture

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

- Interactive diagram: https://gitdiagram.com/leetaogoooo/rssaid
- Repository: https://github.com/leetaogoooo/rssaid

## Overview

##### Main Components
- Flutter Application Core (lib folder):
- The “lib” directory houses the bulk of your application logic. Inside, you find:
- UI components under lib/views (e.g., home, settings, rules, and reusable view components)
- Business logic and state management (spread across lib/common, lib/radar, and lib/models). Notice the “lib/radar” folder that includes RSS parsing, rules, strategies, and source parsing functions.
- Internationalization resources in lib/l10n (ARB files) for multilingual support.
- Theme and shared preferences management for storing basic app configurations.
- Platform-specific Layers:
- Android: Contains Android-specific code, resource files, and configuration (AndroidManifest.xml, Gradle scripts).
- macOS: Includes a macOS folder with Xcode project files, Swift code (AppDelegate.swift, MainFlutterWindow.swift), and related configuration.
- Assets & Resources:
- The assets folder holds images.
- Changelogs and localization files support versioning and language options.
- CI/CD & Deployment Tools:
- The fastlane directory indicates scripts for automating builds and deployments.
- GitHub workflows (.github/workflows) manage continuous integration.
- Testing: There's a test directory indicating unit or widget tests (e.g., for source parsing under test/radar).

##### Relationships and Interactions
- The Flutter engine overlay sits at the center, processing inputs between the UI (lib/views) and the business logic.
- UI components interact with controllers or state management logic (possibly utilizing patterns like MVVM or Clean Architecture) to trigger business logic implemented in “lib/radar” and “lib/models”.
- The business logic communicates with the RSSHub server by constructing URLs and calling RSSHub endpoints (via HTTP or similar requests), influenced by user actions, subscription modifications, or rule processing.
- Shared preferences and configuration services connect to persistence layers—they store user settings and history.
- Platform-specific layers (Android, macOS, Web) provide the necessary wrappers around the Flutter application to interface with device-specific APIs, and they interact indirectly with the core app logic.
- Fastlane and CI/CD configurations ensure consistent building, testing, and releasing across platforms.

##### Architectural Patterns & Design Principles
- Separation of concerns by isolating UI, business logic, and data (model) layers.
- Use modular organization, as evidenced by dedicated directories for views, models, and strategies (part of RSS feed rules handling).
- Incorporate internationalization and theming as separate, configurable modules.

##### Relevant Technologies, Frameworks, or Libraries
- Flutter framework for the multi-platform UI.
- Dart programming language for all application logic (lib directory and tests).
- Gradle, Xcode, and Fastlane for platform-specific builds and deployment.
- CI/CD using GitHub Actions workflows.
- Standard version control (git) supported by .gitattributes and .gitignore.

##### Components to Highlight
- Flutter Application Core:
- UI Components (lib/views)
- Business Logic (lib/radar, lib/models, and strategies)
- Shared Resources (lib/common, lib/l10n, lib/theme.dart)
- External Integrations:
- RSSHub server interaction (the complementary backend service that provides RSS feed information)
- Platform Wrappers:
- Android (android/)
- macOS (macos/)
- Web (web/)
- Build and Deployment:
- CI/CD Pipeline (GitHub workflows and fastlane scripts)
- Testing Framework (test/ directory)
- Auxiliary Assets:
- Assets (assets/)
- Localization and configuration files (l10n.yaml, pubspec.yaml)

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Flutter Application Core"
        AppCore("App Entry"):::core
        subgraph "UI Layer"
            UI("UI Components"):::ui
        end
        subgraph "Business Logic Layer"
            Radar("RSS & Rules Engine"):::logic
            Models("Data Models"):::logic
        end
        subgraph "Shared Resources"
            Common("Common Utils"):::shared
            Theme("Theme"):::shared
            Localization("Localization"):::shared
        end
    end

    subgraph "External Integrations"
        RSSHub("RSSHub API"):::external
    end

    subgraph "Platform-specific Wrappers"
        Android("Android Wrapper"):::platform
        macOS("macOS Wrapper"):::platform
        Web("Web Wrapper"):::platform
    end

    subgraph "Build, Testing & Deployment"
        subgraph "CI/CD Pipeline"
            Fastlane("Fastlane"):::ci
            GitHub("GitHub Actions"):::ci
        end
        Test("Testing Framework"):::test
    end

    subgraph "Auxiliary Assets"
        Assets("Image Assets"):::assets
        Changelogs("Changelogs"):::assets
        ConfigFiles("App Config Files"):::assets
    end

    %% Connections within Flutter Core
    AppCore -->|"loads"| UI
    AppCore -->|"loads"| Radar
    AppCore -->|"loads"| Common
    AppCore -->|"loads"| Theme
    AppCore -->|"loads"| Localization

    %% UI interactions
    UI -->|"triggers"| Radar
    UI -->|"uses"| Theme
    UI -->|"uses"| Localization

    %% Business logic interactions
    Radar -->|"calls"| RSSHub
    Radar -->|"updates"| Models
    Common -->|"configures"| Models

    %% Platform Wrappers interactions
    Android -->|"wraps"| AppCore
    macOS -->|"wraps"| AppCore
    Web -->|"wraps"| AppCore

    %% CI/CD and Testing interactions
    Fastlane -->|"automates"| AppCore
    GitHub -->|"automates"| AppCore
    Test -->|"verifies"| AppCore
    Test -->|"verifies"| Radar
    Test -->|"verifies"| UI

    %% Assets and Configuration
    Assets -->|"supplies"| UI
    ConfigFiles -->|"supplies"| Common

    %% Click Events
    click AppCore "https://github.com/leetaogoooo/rssaid/blob/main/lib/main.dart"
    click UI "https://github.com/leetaogoooo/rssaid/tree/main/lib/views"
    click Radar "https://github.com/leetaogoooo/rssaid/tree/main/lib/radar"
    click Models "https://github.com/leetaogoooo/rssaid/tree/main/lib/models"
    click Common "https://github.com/leetaogoooo/rssaid/tree/main/lib/common"
    click Theme "https://github.com/leetaogoooo/rssaid/blob/main/lib/theme.dart"
    click Localization "https://github.com/leetaogoooo/rssaid/tree/main/lib/l10n"
    click RSSHub "https://github.com/leetaogoooo/rssaid/blob/main/lib/radar/rsshub.dart"
    click Android "https://github.com/leetaogoooo/rssaid/tree/main/android/"
    click macOS "https://github.com/leetaogoooo/rssaid/tree/main/macos/"
    click Web "https://github.com/leetaogoooo/rssaid/tree/main/web/"
    click Fastlane "https://github.com/leetaogoooo/rssaid/tree/main/fastlane/"
    click GitHub "https://github.com/leetaogoooo/rssaid/tree/main/.github/workflows"
    click Test "https://github.com/leetaogoooo/rssaid/tree/main/test/"
    click Assets "https://github.com/leetaogoooo/rssaid/tree/main/assets/"
    click Changelogs "https://github.com/leetaogoooo/rssaid/tree/main/changelogs/"
    click ConfigFiles "https://github.com/leetaogoooo/rssaid/blob/main/l10n.yaml"

    %% Styles
    classDef core fill:#f9c,stroke:#333,stroke-width:2px;
    classDef ui fill:#bbf,stroke:#333,stroke-width:2px;
    classDef logic fill:#bfb,stroke:#333,stroke-width:2px;
    classDef shared fill:#ffb,stroke:#333,stroke-width:2px;
    classDef external fill:#faa,stroke:#333,stroke-width:2px;
    classDef platform fill:#aff,stroke:#333,stroke-width:2px;
    classDef ci fill:#dfd,stroke:#333,stroke-width:2px;
    classDef test fill:#fdd,stroke:#333,stroke-width:2px;
    classDef assets fill:#ffd,stroke:#333,stroke-width:2px;
```
