# ajamit17/labwise architecture

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

- Interactive diagram: https://gitdiagram.com/ajamit17/labwise
- Repository: https://github.com/ajamit17/labwise

## Overview

##### Major Components
- Mobile Frontend: LabWise is built as a React Native mobile app using Expo Router. The main areas include:
- Tab Navigation (found in the app/(tabs) folder) which provides the primary navigation among screens.
- Core Screens: Home/Attendance (index.tsx), Experiment Listing (two.tsx and others), Attendance screens (“attendence” folder), and Experiment Details (app/experiment/[id].tsx).
- UI Components: Reusable components like the ExperimentCard (components folder) make up the building blocks of the UI.
- Context and State: The ThemeContext (in context folder) supports dark/light theme toggling and ensures consistent styling.
- Assets: This includes images, fonts, and other static files used throughout the app.

##### Relationships and Data Flow
- Data Interaction: Highlight how information is passed from the constants/utilities to the screens and how ThemeContext influences component styling.
- Node is clearly labeled with its role (e.g., “Home Screen”, “Experiment Details”, “Attendance Stats”).

##### Architecture Patterns
- Modular Architecture: Emphasize how the app is modularized into different folders for routing and functionality (e.g., separate directories for experiments and attendance).
- Separation of Concerns: Illustrate how navigation, UI rendering, state management, and static asset management are distinct components.
- File System Based Routing: Indicate that the physical file structure in the “app” directory drives the navigation hierarchy.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Main Node
    Main["LabWise Mobile App Architecture"]:::main

    %% Navigation Layer Subgraph
    subgraph "Navigation Layer"
        TabNav["Tab Navigator"]:::navigation
    end

    %% Screen Components Subgraph
    subgraph "Screen Components"
        HomeScreen["Home/Attendance Screen"]:::screen
        ExpList["Experiment Listing Screen"]:::screen
        AddTab1["Additional Tab Screen 1"]:::screen
        AddTab2["Additional Tab Screen 2"]:::screen
        ExpDetails["Experiment Details Screen"]:::screen
        AttendanceModule["Attendance Module Screens"]:::screen
    end

    %% UI Components Subgraph
    subgraph "UI Components"
        ExpCard["ExperimentCard"]:::ui
    end

    %% State Management Subgraph
    subgraph "State Management"
        ThemeCtx["ThemeContext"]:::state
    end

    %% Supporting Modules Subgraph
    subgraph "Supporting Modules"
        Colors["Colors"]:::support
        Timetable["Timetable"]:::support
        Utilities["Utilities"]:::support
    end

    %% Assets Subgraph
    subgraph "Assets"
        Assets["Assets"]:::assets
    end

    %% Connections from Main Architecture
    Main -->|"drives"| TabNav
    Main -->|"renders"| HomeScreen
    Main -->|"renders"| ExpList
    Main -->|"renders"| AddTab1
    Main -->|"renders"| AddTab2
    Main -->|"navigates to"| ExpDetails
    Main -->|"navigates to"| AttendanceModule
    Main -->|"uses"| ExpCard
    Main -->|"controlled by"| ThemeCtx
    Main -->|"supplied by"| Colors
    Main -->|"supplied by"| Timetable
    Main -->|"assisted by"| Utilities
    Main -->|"loads"| Assets

    %% Navigation Flow: Tab Navigator to Screens
    TabNav -->|"navigates to"| HomeScreen
    TabNav -->|"navigates to"| ExpList
    TabNav -->|"navigates to"| AddTab1
    TabNav -->|"navigates to"| AddTab2

    %% Screen Components depend on UI Components and State Management
    HomeScreen -->|"renders"| ExpCard
    ExpList -->|"renders"| ExpCard
    ExpDetails -->|"renders"| ExpCard
    AttendanceModule -->|"integrates with"| ExpCard

    %% State management influences screens
    ThemeCtx -->|"applies theme to"| HomeScreen
    ThemeCtx -->|"applies theme to"| ExpList
    ThemeCtx -->|"applies theme to"| AddTab1
    ThemeCtx -->|"applies theme to"| AddTab2
    ThemeCtx -->|"applies theme to"| ExpDetails
    ThemeCtx -->|"applies theme to"| AttendanceModule

    %% Supporting Modules provide data to screens
    Colors -->|"provides colors to"| HomeScreen
    Colors -->|"provides colors to"| ExpList
    Timetable -->|"provides data to"| ExpList
    Utilities -->|"supports"| HomeScreen
    Utilities -->|"supports"| ExpList
    Utilities -->|"supports"| ExpDetails

    %% Assets supply static resources
    Assets -->|"supplies images/fonts to"| ExpCard
    Assets -->|"supplies assets to"| HomeScreen
    Assets -->|"supplies assets to"| ExpList
    Assets -->|"supplies assets to"| ExpDetails

    %% Click Events
    click TabNav "https://github.com/ajamit17/labwise/blob/main/app/(tabs)/_layout.tsx"
    click HomeScreen "https://github.com/ajamit17/labwise/blob/main/app/(tabs)/index.tsx"
    click ExpList "https://github.com/ajamit17/labwise/blob/main/app/(tabs)/two.tsx"
    click AddTab1 "https://github.com/ajamit17/labwise/blob/main/app/(tabs)/three.tsx"
    click AddTab2 "https://github.com/ajamit17/labwise/blob/main/app/(tabs)/four.tsx"
    click AttendanceModule "https://github.com/ajamit17/labwise/tree/main/app/attendence"
    click ExpDetails "https://github.com/ajamit17/labwise/blob/main/app/experiment/[id].tsx"
    click ExpCard "https://github.com/ajamit17/labwise/blob/main/components/ExperimentCard.tsx"
    click ThemeCtx "https://github.com/ajamit17/labwise/blob/main/context/ThemeContext.tsx"
    click Colors "https://github.com/ajamit17/labwise/blob/main/constants/Colors.ts"
    click Timetable "https://github.com/ajamit17/labwise/blob/main/constants/timetable.ts"
    click Utilities "https://github.com/ajamit17/labwise/blob/main/utils/storage.ts"
    click Assets "https://github.com/ajamit17/labwise/tree/main/assets"

    %% Styles
    classDef main fill:#F4A261,stroke:#E76F51,stroke-width:2px;
    classDef navigation fill:#457B9D,stroke:#1D3557,stroke-width:2px,color:#fff;
    classDef screen fill:#A8DADC,stroke:#457B9D,stroke-width:2px;
    classDef ui fill:#F1FAEE,stroke:#A8DADC,stroke-width:2px;
    classDef state fill:#FFB830,stroke:#E85D04,stroke-width:2px;
    classDef support fill:#E63946,stroke:#A4161A,stroke-width:2px,color:#fff;
    classDef assets fill:#2A9D8F,stroke:#1B4332,stroke-width:2px,color:#fff;
```
