# ureca-corp/si-dallant-wallet-app architecture

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

- Interactive diagram: https://gitdiagram.com/ureca-corp/si-dallant-wallet-app
- Repository: https://github.com/ureca-corp/si-dallant-wallet-app

## Overview

##### Project type and purpose
- This is a multi-platform (Android/iOS) mobile wallet application built with Flutter named “si_dallant_wallet_app.”
- It uses Firebase as its backend for authentication and data storage (see firebase.json, android/app/google-services.json, ios/Runner/GoogleService-Info.plist, and lib/firebase_options.dart).
- The app’s core features (per file names) include user authentication, balance display (“mydallant”), transaction results, charting, and token swap/exchange.

##### File structure
- Top-level Flutter modules:
- android/ – native Android project (Gradle build files, manifest, resources)
- ios/ – native iOS Xcode workspace (Info.plist, AppDelegate.swift, assets, pods)
- lib/ – Dart source code
- assets/ – fonts and video resources
- firebase.json, pubspec.yaml – configuration, dependencies
- Within lib/:
- main.dart – app entry point and routing
- firebase_options.dart – Firebase initialization
- controller/ – state-management classes (auth_controller.dart, result_dl.dart)
- command/ – data-access layer (dallant_insert.dart, read_firebase.dart)
- screens/ – UI pages (login, signup, mainpage, charts, alerts, wallet views)
- Notice the MVC-style separation: Screens (View) → Controllers (Controller) → Commands (Model/Service).

##### README for additional insights
- No deeper architectural hints beyond Flutter + Firebase.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User
    User["User"]:::external

    %% Flutter Entry & Config
    subgraph "App Bootstrap & Configuration"
        direction TB
        Main["main.dart"]:::entry
        FirebaseOpts["firebase_options.dart"]:::config
        FirebaseJSON["firebase.json"]:::config
        AndroidJSON["android/app/google-services.json"]:::config
        IOSPlist["ios/Runner/GoogleService-Info.plist"]:::config
    end

    %% UI Layer
    subgraph "Flutter UI Layer (lib/screens)" 
        direction TB
        AlertPage["alert_page.dart"]:::ui
        ChartPage["chart.dart"]:::ui
        DLChart["dl_chart.dart"]:::ui
        Login["login.dart"]:::ui
        Signup["signup.dart"]:::ui
        Welcome["welcome.dart"]:::ui
        MainPage["mainpage.dart"]:::ui
        MyDallant["mydallant.dart"]:::ui
        RewardConfirm["reward_confirm.dart"]:::ui
        SwapExchange["swap_exchange.dart"]:::ui
    end

    %% Controllers Layer
    subgraph "State-Management Layer (lib/controller)"
        direction TB
        AuthCtrl["auth_controller.dart"]:::controllers
        ResultCtrl["result_dl.dart"]:::controllers
    end

    %% Commands Layer
    subgraph "Data-Access Layer (lib/command)"
        direction TB
        DallantInsert["dallant_insert.dart"]:::commands
        ReadFirebase["read_firebase.dart"]:::commands
    end

    %% Firebase Services
    subgraph "Firebase Cloud Services"
        direction TB
        AuthService["Firebase Auth"]:::firebase
        FirestoreDB["Cloud Firestore"]:::firebase
    end

    %% Native Hosts
    subgraph "Native Platform Modules"
        direction TB
        AndroidHost["android/"]:::native
        IOSHost["ios/"]:::native
    end

    %% Connections
    User -->|"taps UI"| Login
    User --> Welcome

    Main -->|boots app| UIStart["Flutter Engine"]:::native

    UIStart -->|loads screens| AlertPage
    UIStart --> ChartPage
    UIStart --> DLChart
    UIStart --> Login
    UIStart --> Signup
    UIStart --> Welcome
    UIStart --> MainPage
    UIStart --> MyDallant
    UIStart --> RewardConfirm
    UIStart --> SwapExchange

    AlertPage -->|calls| AuthCtrl
    ChartPage --> AuthCtrl
    DLChart --> AuthCtrl
    Login --> AuthCtrl
    Signup --> AuthCtrl
    Welcome --> AuthCtrl
    MainPage --> AuthCtrl
    MyDallant --> AuthCtrl
    RewardConfirm --> ResultCtrl
    SwapExchange --> AuthCtrl

    AuthCtrl -->|invokes| DallantInsert
    AuthCtrl -->|invokes| ReadFirebase
    ResultCtrl -->|invokes| ReadFirebase

    DallantInsert -->|writes| AuthService
    DallantInsert -->|writes| FirestoreDB
    ReadFirebase -->|reads| FirestoreDB

    AndroidHost -->|renders via| UIStart
    IOSHost -->|renders via| UIStart

    Main --> FirebaseOpts
    Main --> FirebaseJSON
    Main --> AndroidJSON
    Main --> IOSPlist

    %% Click Events
    click AlertPage "https://github.com/ureca-corp/si-dallant-wallet-app/blob/main/lib/screens/alert_page.dart"
    click ChartPage "https://github.com/ureca-corp/si-dallant-wallet-app/blob/main/lib/screens/chart.dart"
    click DLChart "https://github.com/ureca-corp/si-dallant-wallet-app/blob/main/lib/screens/dl_chart.dart"
    click Login "https://github.com/ureca-corp/si-dallant-wallet-app/blob/main/lib/screens/login.dart"
    click Signup "https://github.com/ureca-corp/si-dallant-wallet-app/blob/main/lib/screens/signup.dart"
    click Welcome "https://github.com/ureca-corp/si-dallant-wallet-app/blob/main/lib/screens/welcome.dart"
    click MainPage "https://github.com/ureca-corp/si-dallant-wallet-app/blob/main/lib/screens/mainpage.dart"
    click MyDallant "https://github.com/ureca-corp/si-dallant-wallet-app/blob/main/lib/screens/mydallant.dart"
    click RewardConfirm "https://github.com/ureca-corp/si-dallant-wallet-app/blob/main/lib/screens/reward_confirm.dart"
    click SwapExchange "https://github.com/ureca-corp/si-dallant-wallet-app/blob/main/lib/screens/swap_exchange.dart"
    click AuthCtrl "https://github.com/ureca-corp/si-dallant-wallet-app/blob/main/lib/controller/auth_controller.dart"
    click ResultCtrl "https://github.com/ureca-corp/si-dallant-wallet-app/blob/main/lib/controller/result_dl.dart"
    click DallantInsert "https://github.com/ureca-corp/si-dallant-wallet-app/blob/main/lib/command/dallant_insert.dart"
    click ReadFirebase "https://github.com/ureca-corp/si-dallant-wallet-app/blob/main/lib/command/read_firebase.dart"
    click FirebaseOpts "https://github.com/ureca-corp/si-dallant-wallet-app/blob/main/lib/firebase_options.dart"
    click FirebaseJSON "https://github.com/ureca-corp/si-dallant-wallet-app/blob/main/firebase.json"
    click AndroidJSON "https://github.com/ureca-corp/si-dallant-wallet-app/blob/main/android/app/google-services.json"
    click IOSPlist "https://github.com/ureca-corp/si-dallant-wallet-app/blob/main/ios/Runner/GoogleService-Info.plist"
    click Main "https://github.com/ureca-corp/si-dallant-wallet-app/blob/main/lib/main.dart"
    click AndroidHost "https://github.com/ureca-corp/si-dallant-wallet-app/tree/main/android/"
    click IOSHost "https://github.com/ureca-corp/si-dallant-wallet-app/tree/main/ios/"

    %% Styles
    classDef external fill:#f0f0f0,stroke:#333;
    classDef ui fill:#cce5ff,stroke:#004085;
    classDef controllers fill:#d4edda,stroke:#155724;
    classDef commands fill:#fff3cd,stroke:#856404;
    classDef firebase fill:#ffe5b4,stroke:#cd7f32;
    classDef native fill:#e2e3e5,stroke:#6c757d;
    classDef config fill:#d1ecf1,stroke:#0c5460;
    classDef entry fill:#f5c6cb,stroke:#721c24;
```
