# mw491/next-pushup architecture

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

- Interactive diagram: https://gitdiagram.com/mw491/next-pushup
- Repository: https://github.com/mw491/next-pushup

## Overview

##### Main Components
- Mobile App Shell: Represented by the “app” directory containing the primary layout files (e.g., _layout.tsx) and individual screens under “app/(tabs)” like add.tsx, history.tsx, settings.tsx, and index.tsx.
- Reusable UI Components: Highlight the “components” directory containing UI elements such as Card, Stat, StatNumber, TabBarComponent, and TodayPushups.
- Testing Suite: Incorporate the “__tests__” folder outlining unit tests targeting various UI components and utilities.
- Deployment & Configuration: Note the build and deployment configuration files such as “app.json”, “eas.json”, and the “.eas” workflows directory with deployment scripts (deploy-to-production.yml).
- Utility Functions: Mark the “storageUtils.ts” that handles storage or other logic separate from UI rendering.

##### Relationships and Interactions
- Testing and Quality Assurance: Connect the tested components (from the “components” and parts of “app”) to the “__tests__” folder, showing how unit tests validate behavior.

##### Architectural Patterns and Design Principles
- Modular Architecture: The separation of concerns is evident since UI components, screens, and utilities are kept in distinct directories. Emphasize on how the component reusability and modularity simplify maintenance, testing, and scalability.
- Configuration-Driven Builds: The presence of configuration files (app.json, eas.json) and related deployment workflows underscores a design that supports continuous integration/deployment workflows.

- That deployment workflows (like EAS workflows) and CI/CD aspects are included, showing the “build” process and the eventual production deployment route.

- Drill down into the components: Show how each screen (from the “app/(tabs)” folder) leverages components from “components”, and which utility files and assets support them.
- On the side, graphically represent the build and deploy pipeline from source (with configuration and test files) through EAS deployments.

Happy diagramming!

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "User Interface & Navigation"
        A("Mobile App Shell"):::ui
        B("App Layout"):::ui
        C("Tabs Layout"):::ui
        D("Home Screen"):::ui
        E("Add Screen"):::ui
        F("History Screen"):::ui
        G("Settings Screen"):::ui
    end

    subgraph "Reusable Components & Utilities"
        subgraph "UI Components"
            H("Card"):::component
            I("Stat"):::component
            J("StatNumber"):::component
            K("TabBarComponent"):::component
            L("TodayPushups"):::component
        end
        subgraph "Utility Functions"
            M("Storage Utils"):::utility
        end
    end

    subgraph "Asset Management"
        N("Assets"):::asset
        O("Colours"):::asset
    end

    subgraph "Deployment & Configuration"
        P("App Config"):::deployment
        Q("EAS Config"):::deployment
        R("EAS Workflows"):::deployment
        S("Root Configs"):::deployment
    end

    subgraph "Testing"
        T("Tests"):::testing
    end

    %% Connections within User Interface & Navigation
    A -->|"layout"| B
    A -->|"routes"| C
    C -->|"screen"| D
    C -->|"screen"| E
    C -->|"screen"| F
    C -->|"screen"| G

    %% Connections to Reusable Components & Utilities
    A -->|"usesComponents"| H
    A -->|"usesComponents"| I
    A -->|"usesComponents"| J
    A -->|"usesComponents"| K
    A -->|"usesComponents"| L
    A -->|"usesUtilities"| M

    %% Connections to Asset Management
    A -->|"usesAssets"| N
    A -->|"usesColors"| O

    %% Connections to Deployment & Configuration
    A -->|"build"| P
    A -->|"build"| Q
    A -->|"build"| R
    A -->|"build"| S

    %% Connections to Testing
    H -->|"testedBy"| T
    I -->|"testedBy"| T
    J -->|"testedBy"| T
    K -->|"testedBy"| T
    L -->|"testedBy"| T
    M -->|"testedBy"| T

    %% Additional navigational cues from screens to components
    D -->|"navigatesTo"| H
    E -->|"navigatesTo"| K
    F -->|"navigatesTo"| J
    G -->|"navigatesTo"| I

    %% Click Events for Mobile App Shell
    click A "https://github.com/mw491/next-pushup/tree/main/app/"
    click B "https://github.com/mw491/next-pushup/blob/main/app/_layout.tsx"
    click C "https://github.com/mw491/next-pushup/blob/main/app/(tabs)/_layout.tsx"
    click D "https://github.com/mw491/next-pushup/blob/main/app/(tabs)/index.tsx"
    click E "https://github.com/mw491/next-pushup/blob/main/app/(tabs)/add.tsx"
    click F "https://github.com/mw491/next-pushup/blob/main/app/(tabs)/history.tsx"
    click G "https://github.com/mw491/next-pushup/blob/main/app/(tabs)/settings.tsx"

    %% Click Events for Reusable UI Components and Utility Functions
    click H "https://github.com/mw491/next-pushup/blob/main/components/Card.tsx"
    click I "https://github.com/mw491/next-pushup/blob/main/components/Stat.tsx"
    click J "https://github.com/mw491/next-pushup/blob/main/components/StatNumber.tsx"
    click K "https://github.com/mw491/next-pushup/blob/main/components/TabBarComponent.tsx"
    click L "https://github.com/mw491/next-pushup/blob/main/components/TodayPushups.tsx"
    click M "https://github.com/mw491/next-pushup/blob/main/storageUtils.ts"

    %% Click Events for Asset Management
    click N "https://github.com/mw491/next-pushup/tree/main/assets/"
    click O "https://github.com/mw491/next-pushup/blob/main/colours.ts"

    %% Click Events for Deployment & Configuration
    click P "https://github.com/mw491/next-pushup/blob/main/app.json"
    click Q "https://github.com/mw491/next-pushup/blob/main/eas.json"
    click R "https://github.com/mw491/next-pushup/blob/main/.eas/workflows/deploy-to-production.yml"
    click S "https://github.com/mw491/next-pushup/blob/main/package.json"

    %% Click Event for Testing Suite
    click T "https://github.com/mw491/next-pushup/tree/main/__tests__"

    %% Styles
    classDef ui fill:#D7BDE2,stroke:#5D6D7E,stroke-width:2px;
    classDef component fill:#82E0AA,stroke:#27AE60,stroke-width:2px;
    classDef asset fill:#F9E79F,stroke:#F1C40F,stroke-width:2px;
    classDef deployment fill:#F5B7B1,stroke:#E74C3C,stroke-width:2px;
    classDef testing fill:#D2B4DE,stroke:#8E44AD,stroke-width:2px;
    classDef utility fill:#AED6F1,stroke:#2980B9,stroke-width:2px;
```
