# leohmoraes/compartilha architecture

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

- Interactive diagram: https://gitdiagram.com/leohmoraes/compartilha
- Repository: https://github.com/leohmoraes/compartilha

## Overview

##### Project type and purpose
- This is a cross-platform mobile & web application built with Flutter.
- It implements the “Partilha pra mim” feature: personal financial planning, shared bill-splitting, reminders, plus optional AI-driven assistance (BMG’s Duda).
- The README also highlights GraphQL as the API layer and Firebase (hosting/config) for web deployment.

##### File structure
- Top-level:
- android/ & ios/ – native wrappers for mobile targets
- lib/main.dart – Flutter entrypoint, contains UI & business logic
- web/ – assets & index.html for web hosting
- .firebaserc & firebase.json – configuration for Firebase Hosting (web) & possibly Cloud Functions
- .github/workflows/dart.yml – CI pipeline for build/test/deploy
- pubspec.yaml lists Flutter SDK and GraphQL client dependencies.
- assets/, fonts/ – static resources.
- test/ – widget test harness.

##### README for architectural cues
- Mentions GraphQL for client-server communication.
- References Duda (external AI service) and Firebase integration.
- No in-repo backend – the app consumes external APIs.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% CI/CD Layer
    subgraph "CI/CD Pipeline" 
        direction TB
        GH["GitHub Actions"]:::cicd
        GH -->|run tests & build| Build["Build Artifacts"]:::cicd
        click GH "https://github.com/leohmoraes/compartilha/blob/master/.github/workflows/dart.yml"
    end

    %% Deployment Layer
    subgraph "Deployment Targets"
        direction TB
        Build -->|deploy| Android["Android App"]:::ui
        Build -->|deploy| iOS["iOS App"]:::ui
        Build -->|deploy| Web["Web App (PWA)"]:::ui
        click Android "https://github.com/leohmoraes/compartilha/tree/master/android/"
        click Android "https://github.com/leohmoraes/compartilha/blob/master/android/app/src/main/kotlin/com/example/compartilha/MainActivity.kt"
        click iOS "https://github.com/leohmoraes/compartilha/tree/master/ios/"
        click iOS "https://github.com/leohmoraes/compartilha/tree/master/ios/Runner"
        click Web "https://github.com/leohmoraes/compartilha/tree/master/web/"
        click Web "https://github.com/leohmoraes/compartilha/blob/master/web/index.html"
        click Web "https://github.com/leohmoraes/compartilha/blob/master/web/manifest.json"
    end

    %% Hosting
    subgraph "Firebase Hosting" 
        direction TB
        FH["Firebase Hosting & Config"]:::cloud
        click FH "https://github.com/leohmoraes/compartilha/blob/master/firebase.json"
        click FH "https://github.com/leohmoraes/compartilha/blob/master/.firebaserc"
        Web -->|"HTTPS"| FH
    end

    %% Application Runtime
    subgraph "Runtime Application" 
        direction TB
        App["Flutter App"]:::ui
        click App "https://github.com/leohmoraes/compartilha/blob/master/lib/main.dart"
        App -->|"GraphQL over HTTPS"| API["BMG GraphQL API"]:::external
        App -->|"FCM/REST"| FirebaseSvc["Firebase Services"]:::cloud
    end

    %% Infrastructure Backend
    subgraph "External Services"
        direction TB
        API -->|"SQL/NoSQL"| CoreDB["Core Banking DBs"]:::external
        API -->|"REST/GraphQL"| Duda["Duda AI Service"]:::external
    end

    %% Dependencies & Tests
    subgraph "Project Configuration & Tests"
        direction TB
        Pubspec["pubspec.yaml"]:::cloud
        Assets["assets/ & fonts/"]:::cloud
        Tests["widget_test.dart"]:::cloud
        click Pubspec "https://github.com/leohmoraes/compartilha/blob/master/pubspec.yaml"
        click Assets "https://github.com/leohmoraes/compartilha/tree/master/assets/"
        click Assets "https://github.com/leohmoraes/compartilha/tree/master/fonts/"
        click Tests "https://github.com/leohmoraes/compartilha/blob/master/test/widget_test.dart"
    end

    %% Flows
    Developer["Developer"]:::external -->|push code| GH
    Android -->|distributed via| PlayStore["Google Play Store"]:::external
    iOS -->|distributed via| AppStore["Apple App Store"]:::external

    %% Styles
    classDef ui fill:#D0E8FF,stroke:#0366d6;
    classDef cicd fill:#FFEDD5,stroke:#fb923c;
    classDef cloud fill:#D1FAE5,stroke:#10b981;
    classDef external fill:#F3E8FF,stroke:#a855f7;
```
