# sebqa/padeltid architecture

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

- Interactive diagram: https://gitdiagram.com/sebqa/padeltid
- Repository: https://github.com/sebqa/padeltid

## Overview

##### Project Type and Purpose
- The project is a Flutter mobile (and cross-platform) application that provides a user interface via the lib folder (with platform-specific subdirectories in android, ios, linux, macos, and windows).
- It uses several serverless functions (organized in the functions directory) to handle API calls (e.g., getClubs, getCourts, sendNotification, etc.) beyond the two mentioned in the instructions.
- The CI/CD pipeline defined in the .github/workflows directory deploys all backend (serverless) functions and static assets for the web version.
- Firebase is integrated (evidenced by firebase.json and firebase_options.dart) to support authentication, notifications, or real-time data.

##### File Structure Insights
- Frontend: The lib folder contains the bulk of the Flutter/Dart code along with UI screens, widgets, navigation, and service logic for making API calls. There are also platform-specific folders for android, ios, macos, etc. The assets directory holds images and localization JSON files.
- Backend: The functions directory contains multiple subdirectories, each representing a serverless function with its own lambda_function.py and requirements.txt. These functions serve as API endpoints.
- CI/CD: The .github/workflows directory contains YAML files to deploy both the lambda functions and deploy GitHub pages, showcasing automation that pushes serverless code into production.
- Configuration: Files like firebase.json, pubspec.yaml, and others indicate dependencies and project configurations.

##### Elements
– Flutter Frontend (with divisions for UI, service layer, and platform-specific implementations)
– Firebase Services (authentication, notifications, etc.)
– Data flow from the Flutter app to the backend functions.
– CI/CD pipeline triggering deployments into the backend environment.
– Interaction between the app and Firebase services.

##### Additional Details to Emphasize
- To include not only getClubs and getCourts but also note that the Flutter core code makes API calls to multiple endpoints.
- Automation of backend deployments via CI/CD pipelines (deploy-lambdas.yml and deploy_github_page.yml).
- Clearly delineate the boundaries between mobile app functionalities and serverless backend responsibilities.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Flutter Frontend"
        UI["UI & Presentation (lib)"]:::frontend
        API["API/Service (lib/services)"]:::frontend
        subgraph "Platform-Specific Implementations"
            Android["Android"]:::frontend
            IOS["iOS"]:::frontend
            Linux["Linux"]:::frontend
            MacOS["macOS"]:::frontend
            Windows["Windows"]:::frontend
        end
    end

    subgraph "Serverless Backend Functions"
        F1["getClubs"]:::backend
        F2["getCourts"]:::backend
        F3["getDocumentById"]:::backend
        F4["getPadelTid"]:::backend
        F5["getSubscribed"]:::backend
        F6["getWeather"]:::backend
        F7["manageTokens"]:::backend
        F8["sendNotification"]:::backend
        F9["subTopic"]:::backend
    end

    subgraph "CI/CD Pipeline"
        CICD["GitHub Workflows (.github/workflows)"]:::cicd
    end

    subgraph "Firebase Services"
        FirebaseConfig["Firebase Config"]:::external
        FirebaseOptions["Firebase Options"]:::external
    end

    %% Relationships
    UI -->|"triggers"| API
    API -->|"calls"| F1
    API -->|"calls"| F2
    API -->|"calls"| F3
    API -->|"calls"| F4
    API -->|"calls"| F5
    API -->|"calls"| F6
    API -->|"calls"| F7
    API -->|"calls"| F8
    API -->|"calls"| F9

    CICD -->|"deploys"| F1
    CICD -->|"deploys"| F2
    CICD -->|"deploys"| F3
    CICD -->|"deploys"| F4
    CICD -->|"deploys"| F5
    CICD -->|"deploys"| F6
    CICD -->|"deploys"| F7
    CICD -->|"deploys"| F8
    CICD -->|"deploys"| F9

    API -->|"integrates"| FirebaseConfig
    UI -->|"auth&notify"| FirebaseOptions
    F8 -->|"uses"| FirebaseOptions

    %% Platform-specific connections (illustrative)
    UI --- Android
    UI --- IOS
    UI --- Linux
    UI --- MacOS
    UI --- Windows

    %% Click Events
    click UI "https://github.com/sebqa/padeltid/tree/master/lib"
    click API "https://github.com/sebqa/padeltid/tree/master/lib/services"
    click Android "https://github.com/sebqa/padeltid/tree/master/android"
    click IOS "https://github.com/sebqa/padeltid/tree/master/ios"
    click Linux "https://github.com/sebqa/padeltid/tree/master/linux"
    click MacOS "https://github.com/sebqa/padeltid/tree/master/macos"
    click Windows "https://github.com/sebqa/padeltid/tree/master/windows"
    click F1 "https://github.com/sebqa/padeltid/tree/master/functions/getClubs"
    click F2 "https://github.com/sebqa/padeltid/tree/master/functions/getCourts"
    click F3 "https://github.com/sebqa/padeltid/tree/master/functions/getDocumentById"
    click F4 "https://github.com/sebqa/padeltid/tree/master/functions/getPadelTid"
    click F5 "https://github.com/sebqa/padeltid/tree/master/functions/getSubscribed"
    click F6 "https://github.com/sebqa/padeltid/tree/master/functions/getWeather"
    click F7 "https://github.com/sebqa/padeltid/tree/master/functions/manageTokens"
    click F8 "https://github.com/sebqa/padeltid/tree/master/functions/sendNotification"
    click F9 "https://github.com/sebqa/padeltid/tree/master/functions/subTopic"
    click CICD "https://github.com/sebqa/padeltid/tree/master/.github/workflows"
    click FirebaseConfig "https://github.com/sebqa/padeltid/blob/master/firebase.json"
    click FirebaseOptions "https://github.com/sebqa/padeltid/blob/master/lib/firebase_options.dart"

    %% Styles
    classDef frontend fill:#add8e6,stroke:#000,stroke-width:2px;
    classDef backend fill:#90ee90,stroke:#000,stroke-width:2px;
    classDef cicd fill:#ffff99,stroke:#000,stroke-width:2px;
    classDef external fill:#ffcc99,stroke:#000,stroke-width:2px;
```
