# nurekeshka/stock-market-mobile architecture

> Architecture diagram of the GitHub repository nurekeshka/stock-market-mobile, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nurekeshka/stock-market-mobile
- Repository: https://github.com/nurekeshka/stock-market-mobile

## Overview

##### Project type and purpose
- This is a cross-platform mobile/desktop/web application built with Flutter (Dart) for managing and viewing stock data.
- It follows a layered, “clean architecture” approach: core, data, domain, presentation.

##### File structure
- Top-level “android”, “ios”, “linux”, “macos”, “windows”, “web” folders: each contains platform-specific runner code generated by Flutter.
- “lib/” houses the main Flutter app code, subdivided into:
- core/ (constants, services, theming, utils)
- data/ (datasources, repositories, models)
- domain/ (entities, repository interfaces, use cases)
- presentation/ (BLoC state‐management, pages, widgets)
- Configuration: pubspec.yaml, analysis_options.yaml, platform-specific build files.

##### README for additional insights
- It calls out core folders and responsibilities, plus future features.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Platform Runners & Engine
    subgraph "Platform & Engine"
        direction TB
        FlutterEngine["Flutter Engine"]:::core
        Android["Android Runner"]:::core
        iOS["iOS Runner"]:::core
        WebRunner["Web Runner"]:::core
        LinuxRunner["Linux Runner"]:::core
        macOSRunner["macOS Runner"]:::core
        WindowsRunner["Windows Runner"]:::core
    end

    %% Core Layer
    subgraph "Core Layer"
        direction TB
        NavigationService["NavigationService"]:::core
        StorageService["StorageService"]:::core
        ThemeService["ThemeService"]:::core
        Constants["Constants"]:::core
        Utilities["Utilities"]:::core
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        APIConnector["APIConnector"]:::data
        RepoImpl["StockRepositoryImpl"]:::data
        Models["Data Models"]:::data
    end

    %% Domain Layer
    subgraph "Domain Layer"
        direction TB
        UseCases["Use Cases"]:::domain
        Entities["Entities"]:::domain
        RepoInterfaces["Repository Interfaces"]:::domain
        DTOs["DTOs"]:::domain
    end

    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        Blocs["TabsBloc"]:::presentation
        Events["TabsEvent"]:::presentation
        States["TabsState"]:::presentation
        Pages["Pages"]:::presentation
        Widgets["Widgets"]:::presentation
    end

    %% External Systems
    subgraph "External Systems"
        direction TB
        RESTAPI["Stock Market REST API"]:::external
        LocalDB["Local Persistence (Hive)"]:::external
        Plugins["Platform Plugins"]:::external
    end

    %% Connections
    AndroidRunner -->|hosts| FlutterEngine
    iOSRunner -->|hosts| FlutterEngine
    WebRunner -->|hosts| FlutterEngine
    LinuxRunner -->|hosts| FlutterEngine
    macOSRunner -->|hosts| FlutterEngine
    WindowsRunner -->|hosts| FlutterEngine

    FlutterEngine -->|provides runtime| NavigationService
    FlutterEngine -->|provides runtime| StorageService
    FlutterEngine -->|provides runtime| ThemeService

    %% Core to Data
    StorageService -->|uses| LocalDB
    APIConnector -->|uses HTTP| RESTAPI

    %% Data to Domain
    RepoImpl -->|implements| RepoInterfaces
    APIConnector -->|returns JSON Models| Models
    Models -->|mapped to| Entities

    %% Domain to Presentation
    UseCases -->|use| RepoInterfaces
    Blocs -->|calls| UseCases
    Pages -->|dispatch events to| Blocs
    Widgets -->|display data from| Blocs

    %% External Plugins
    Plugins -->|integrated via| FlutterEngine

    %% Click Events
    click TabsBloc "https://github.com/nurekeshka/stock-market-mobile/blob/main/lib/presentation/blocs/tabs_bloc.dart"
    click Events "https://github.com/nurekeshka/stock-market-mobile/blob/main/lib/presentation/blocs/events/tabs_event.dart"
    click States "https://github.com/nurekeshka/stock-market-mobile/blob/main/lib/presentation/blocs/states/tabs_state.dart"
    click Pages "https://github.com/nurekeshka/stock-market-mobile/tree/main/lib/presentation/pages"
    click Widgets "https://github.com/nurekeshka/stock-market-mobile/tree/main/lib/presentation/widgets"
    click Entities "https://github.com/nurekeshka/stock-market-mobile/blob/main/lib/domain/entities/stock_entity.dart"
    click RepoInterfaces "https://github.com/nurekeshka/stock-market-mobile/tree/main/lib/domain/repositories"
    click DTOs "https://github.com/nurekeshka/stock-market-mobile/blob/main/lib/domain/dtos/sign_in_dto.dart"
    click DTOs "https://github.com/nurekeshka/stock-market-mobile/blob/main/lib/domain/dtos/jwt_response_dto.dart"
    click APIConnector "https://github.com/nurekeshka/stock-market-mobile/blob/main/lib/data/datasources/api_connector.dart"
    click Models "https://github.com/nurekeshka/stock-market-mobile/tree/main/lib/data/models"
    click RepoImpl "https://github.com/nurekeshka/stock-market-mobile/tree/main/lib/data/repositories"
    click NavigationService "https://github.com/nurekeshka/stock-market-mobile/blob/main/lib/core/services/navigation_service.dart"
    click StorageService "https://github.com/nurekeshka/stock-market-mobile/blob/main/lib/core/services/storage_service.dart"
    click ThemeService "https://github.com/nurekeshka/stock-market-mobile/blob/main/lib/core/services/theme_service.dart"
    click Constants "https://github.com/nurekeshka/stock-market-mobile/tree/main/lib/core/constants"
    click Utilities "https://github.com/nurekeshka/stock-market-mobile/tree/main/lib/core/utils"
    click AndroidRunner "https://github.com/nurekeshka/stock-market-mobile/blob/main/android/app/src/main/kotlin/com/example/stock_market_mobile/MainActivity.kt"
    click iOSRunner "https://github.com/nurekeshka/stock-market-mobile/blob/main/ios/Runner/AppDelegate.swift"
    click WebRunner "https://github.com/nurekeshka/stock-market-mobile/blob/main/web/index.html"
    click LinuxRunner "https://github.com/nurekeshka/stock-market-mobile/blob/main/linux/runner/main.cc"
    click macOSRunner "https://github.com/nurekeshka/stock-market-mobile/blob/main/macos/Runner/AppDelegate.swift"
    click WindowsRunner "https://github.com/nurekeshka/stock-market-mobile/blob/main/windows/runner/main.cpp"
    click FlutterEngine "https://github.com/nurekeshka/stock-market-mobile/blob/main/docs/diagrams.drawio"

    %% Styles
    classDef presentation fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef domain fill:#90EE90,stroke:#333,stroke-width:1px
    classDef data fill:#FFDAB9,stroke:#333,stroke-width:1px
    classDef core fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef external fill:#FFFFFF,stroke-dasharray: 5 5,stroke:#333,stroke-width:1px
```
