# mibrahimdev/flow architecture

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

- Interactive diagram: https://gitdiagram.com/mibrahimdev/flow
- Repository: https://github.com/mibrahimdev/flow

## Overview

##### Project Type & Purpose
- The project is a single Android application built using Jetpack Compose.
- It focuses on time tracking with distinct UI screens (Home, Report, and Timer) and appears to serve both as a functional app and an experimental playground for learning Compose.
- The presence of fastlane files indicates CI/CD and automated deployment aspects.

##### Main Components
a. Android Application (App Module)
- Primary application module (“app”) along with Gradle build scripts (build.gradle.kts, settings.gradle, gradlew, etc.).
- Configuration files such as AndroidManifests and proguard-rules which are part of the application’s lifecycle and build process.

b. Presentation Layer (UI)
- MainActivity as the entry point.
- Break out the UI components based on their packages:
– "flow/ui" for shared UI logic (Common, Navigation)
– "flow/ui/screens" divided into sub-packages like home, report, and timer.
– Theme and styling components in the "flow/ui/theme" package.
- Screen components:
– HomeScreen (for the Home view)
– Report-related screens (including BezierChart, Report, etc.)
– Task Timer screens (TaskTimer, CircularCountDown)

c. Navigation & Routing
- Incorporate the Navigation component (from Navigation.kt) which manages transitions between different screens.

d. Data Layer / Fake Data
- Since there is a “fake” package containing TestData, indicate that there is a stub/mock layer mimicking or providing sample data during development.

e. Testing
- Instrumentation Tests: Show the "androidTest" package that maintains UI/integration tests (e.g., AppNavigationTest, ExampleInstrumentedTest).
- Unit Tests: Include the "test" package showing unit tests (e.g., ExampleUnitTest, Playground).

f. CI/CD and Deployment
- Fastlane component to illustrate the automation pipeline for build, deployment, and screenshot capturing.

g. Resources

##### Relationships & Interactions
- Link the UI components with their corresponding theme and style components to denote dependency.
- Interaction between the UI and its data layer (even if the current implementation uses fake data) to indicate where real data might be injected.
- Test packages as distinct components that “hook into” the main application logic for both unit tests and instrumentation tests.
- Fastlane as an external CI/CD service interacting with the repository to build and deploy the application.

##### Key Architectural Patterns & Technologies
- Use of the modular structure typical of Android apps—separating concerns (UI, navigation, data management, theming).
- Usage of Jetpack Compose for the UI, which might involve composable functions and navigation components.
- Integration of Gradle and fastlane for build automation and deployment.
- Demonstrate testing as a cross-cutting concern, with clear separation between unit tests and instrumentation tests.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Android Application Core
    subgraph "Android Application Core"
        AAM["Android App Module"]:::appModule
        MA["MainActivity"]:::appModule
        AR["Resources"]:::resources
        AAM -->|"launches"| MA
        AAM -->|"includes"| AR
    end

    %% Presentation Layer
    subgraph "Presentation Layer"
        UI["Shared UI Logic"]:::uiComponent
        HS["HomeScreen"]:::uiComponent
        RS["Report Screens"]:::uiComponent
        TS["Task Timer Screens"]:::uiComponent
        TH["Theme & Styling"]:::uiComponent
        UI -->|"drives"| HS
        UI -->|"drives"| RS
        UI -->|"drives"| TS
        HS -->|"styledBy"| TH
        RS -->|"styledBy"| TH
        TS -->|"styledBy"| TH
    end

    %% Navigation Logic
    NL["Navigation Logic"]:::uiComponent
    MA -->|"navigates"| NL
    NL -->|"to_HomeScreen"| HS
    NL -->|"to_ReportScreens"| RS
    NL -->|"to_TaskTimerScreens"| TS

    %% Data Layer
    FD["Fake Data"]:::data
    UI -->|"providesData"| FD

    %% Testing
    subgraph "Testing"
        IT["Instrumentation Tests"]:::testing
        UT["Unit Tests"]:::testing
    end
    IT -->|"tests"| AAM
    UT -->|"tests"| AAM

    %% CI/CD and Deployment
    FL["Fastlane CI/CD"]:::cicd
    FL -->|"deploys"| AAM

    %% Click Events
    click AAM "https://github.com/mibrahimdev/flow/tree/master/app"
    click MA "https://github.com/mibrahimdev/flow/blob/master/app/src/main/java/io/github/mohamedisoliman/flow/MainActivity.kt"
    click UI "https://github.com/mibrahimdev/flow/tree/master/app/src/main/java/io/github/mohamedisoliman/flow/ui"
    click HS "https://github.com/mibrahimdev/flow/blob/master/app/src/main/java/io/github/mohamedisoliman/flow/ui/screens/home/HomeScreen.kt"
    click RS "https://github.com/mibrahimdev/flow/tree/master/app/src/main/java/io/github/mohamedisoliman/flow/ui/screens/report"
    click TS "https://github.com/mibrahimdev/flow/tree/master/app/src/main/java/io/github/mohamedisoliman/flow/ui/screens/timer"
    click TH "https://github.com/mibrahimdev/flow/tree/master/app/src/main/java/io/github/mohamedisoliman/flow/ui/theme"
    click NL "https://github.com/mibrahimdev/flow/blob/master/app/src/main/java/io/github/mohamedisoliman/flow/ui/Navigation.kt"
    click FD "https://github.com/mibrahimdev/flow/blob/master/app/src/main/java/io/github/mohamedisoliman/flow/fake/TestData.kt"
    click IT "https://github.com/mibrahimdev/flow/tree/master/app/src/androidTest/java/io/github/mohamedisoliman/flow"
    click UT "https://github.com/mibrahimdev/flow/tree/master/app/src/test/java/io/github/mohamedisoliman/flow"
    click FL "https://github.com/mibrahimdev/flow/tree/master/fastlane"
    click AR "https://github.com/mibrahimdev/flow/tree/master/app/src/main/res"

    %% Styles
    classDef appModule fill:#AED6F1,stroke:#1F618D,stroke-width:2px;
    classDef uiComponent fill:#ABEBC6,stroke:#28B463,stroke-width:2px;
    classDef data fill:#D2B4DE,stroke:#884EA0,stroke-width:2px;
    classDef testing fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef cicd fill:#F5B7B1,stroke:#CB4335,stroke-width:2px;
    classDef resources fill:#FAD7A0,stroke:#D35400,stroke-width:2px;
```
