# aurumco/riyales architecture

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

- Interactive diagram: https://gitdiagram.com/aurumco/riyales
- Repository: https://github.com/aurumco/riyales

## Overview

##### Project Type and Purpose
- This is a full-stack, cross-platform Flutter application (“Riyales”) used to display real-time financial data (currencies, crypto, gold, stocks). The frontend is a single Flutter codebase compiled for Android, iOS, Web, Linux, macOS, and Windows. The backend (external to this repo) is a Python service that aggregates real-time data from third-party financial APIs.

##### File Structure Analysis
- Top-level “android/”, “ios/”, “linux/”, “macos/”, “windows/”, “web/” directories contain the platform‐specific embedder code and configuration.
- “lib/” holds the Dart application logic, divided into:
– config (app_config, constants)
– generated (localizations)
– l10n (ARB files) and localization utilities
– models (data structures: Asset, Alert, Terms)
– providers (state managers via Provider, grouped by feature & data source)
– services (API service, connectivity, analytics, device info, action handling)
– ui (presentation layer: screens, widgets, theme)
– utils (helpers, extensions)
- GitHub Actions workflows for building APK and Web artifacts in “.github/workflows/”.

##### Key README Insights
- Flutter frontend (Dart)
- Python backend serving as data aggregator/proxy
- Real-time third-party financial data APIs
- Smooth UI/UX, light & dark themes
- Under active development, CI set up for mobile/web builds

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Flutter Engine & Embedders
    subgraph "Flutter Engine & Embedders"
        direction TB
        Android["Android Embedder"]:::external
        iOS["iOS Embedder"]:::external
        WebEmbed["Web Embedder"]:::external
        LinuxEmbed["Linux Embedder"]:::external
        MacOSEmbed["macOS Embedder"]:::external
        WindowsEmbed["Windows Embedder"]:::external
    end

    %% Flutter Client Core
    subgraph "Flutter Client (Core)" 
        direction TB
        Config["Configuration & Constants"]:::config
        Models["Domain Models"]:::providers
        Localization["Localization"]:::config
        Providers["State Management (Providers)"]:::providers
        Services["Service Layer"]:::services
        UI["Presentation Layer (Screens & Widgets)"]:::ui
        Assets["Assets Store"]:::assets
    end

    %% External Systems
    PythonBackend["Python Backend"]:::external
    ThirdParty["Third-Party Financial APIs"]:::external

    %% CI/CD Pipeline
    CICD["CI/CD Pipeline"]:::cicd

    %% Embedders to Client
    Android -->|"embeds"| UI
    iOS -->|"embeds"| UI
    WebEmbed -->|"embeds"| UI
    LinuxEmbed -->|"embeds"| UI
    MacOSEmbed -->|"embeds"| UI
    WindowsEmbed -->|"embeds"| UI

    %% Data Flow within Client
    UI -->|"user interaction"| Providers
    Providers -->|"calls api"| Services
    Services -->|"HTTP REST"| PythonBackend
    PythonBackend -->|"fetches data"| ThirdParty
    ThirdParty -->|"returns data"| PythonBackend
    PythonBackend -->|"responds JSON"| Services
    Services -->|"updates state"| Providers
    Providers -->|"notifies UI"| UI

    %% CI/CD builds
    CICD -->|"builds for platforms"| Android
    CICD -->|"builds for platforms"| iOS
    CICD -->|"builds for platforms"| WebEmbed
    CICD -->|"builds for platforms"| LinuxEmbed
    CICD -->|"builds for platforms"| MacOSEmbed
    CICD -->|"builds for platforms"| WindowsEmbed

    %% Click Events
    click Config "https://github.com/aurumco/riyales/tree/main/lib/config/"
    click Models "https://github.com/aurumco/riyales/tree/main/lib/models/"
    click Localization "https://github.com/aurumco/riyales/tree/main/lib/l10n/"
    click Providers "https://github.com/aurumco/riyales/tree/main/lib/providers/"
    click Services "https://github.com/aurumco/riyales/tree/main/lib/services/"
    click UI "https://github.com/aurumco/riyales/tree/main/lib/ui/"
    click Assets "https://github.com/aurumco/riyales/tree/main/assets/"
    click Android "https://github.com/aurumco/riyales/blob/main/android/app/src/main/kotlin/ir/ryls/MainActivity.kt"
    click Android "https://github.com/aurumco/riyales/blob/main/android/app/build.gradle.kts"
    click Android "https://github.com/aurumco/riyales/blob/main/android/settings.gradle.kts"
    click iOS "https://github.com/aurumco/riyales/blob/main/ios/Runner/AppDelegate.swift"
    click iOS "https://github.com/aurumco/riyales/tree/main/ios/Runner.xcodeproj/"
    click WebEmbed "https://github.com/aurumco/riyales/blob/main/web/index.html"
    click WebEmbed "https://github.com/aurumco/riyales/blob/main/web/manifest.json"
    click WebEmbed "https://github.com/aurumco/riyales/blob/main/web/robots.txt"
    click WebEmbed "https://github.com/aurumco/riyales/blob/main/web/sitemap.xml"
    click LinuxEmbed "https://github.com/aurumco/riyales/blob/main/linux/main.cc"
    click LinuxEmbed "https://github.com/aurumco/riyales/blob/main/linux/CMakeLists.txt"
    click LinuxEmbed "https://github.com/aurumco/riyales/blob/main/linux/flutter/generated_plugin_registrant.cc"
    click MacOSEmbed "https://github.com/aurumco/riyales/blob/main/macos/Runner/AppDelegate.swift"
    click MacOSEmbed "https://github.com/aurumco/riyales/tree/main/macos/Runner.xcodeproj/"
    click WindowsEmbed "https://github.com/aurumco/riyales/blob/main/windows/runner/main.cpp"
    click WindowsEmbed "https://github.com/aurumco/riyales/blob/main/windows/CMakeLists.txt"
    click CICD "https://github.com/aurumco/riyales/blob/main/.github/workflows/build-apk.yml"
    click CICD "https://github.com/aurumco/riyales/blob/main/.github/workflows/build-web.yml"

    %% Classes
    classDef ui fill:#a2d2ff,stroke:#333;
    classDef providers fill:#b7e4c7,stroke:#333;
    classDef services fill:#ffb703,stroke:#333;
    classDef external fill:#cccccc,stroke:#333,stroke-dasharray: 5 5;
    classDef cicd fill:#9d4edd,stroke:#333,stroke-dasharray: 5 5;
    classDef config fill:#ffd6a5,stroke:#333;
    classDef assets fill:#fcf6bd,stroke:#333;
```
