# build-umass/aarti-app architecture

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

- Interactive diagram: https://gitdiagram.com/build-umass/aarti-app
- Repository: https://github.com/build-umass/aarti-app

## Overview

##### Main Components

A. Client-Side Layer (Mobile Application)
- Present this as the top-level container
- Divide into these major subsystems:

1. Navigation & Routing
- Tab-based navigation structure
- File-based routing system
- To the various screens/pages

2. Core Features
- Main screens: Chatbot, Profile, Quizzes, Resources
- Settings as a separate route

3. UI Components Layer
- Custom components (Collapsible, ThemedText, etc.)
- Theme system
- Navigation components

4. State & Hooks Layer
- Theme handling
- Custom hooks

**┌─────────────────────────────────────────────────────┐**
- Mobile Application                  │
- ┤
- Navigation Layer (File-based Routing)               │
- ┬────────────┬────────────┬─────────────┤
- Chatbot   │  Profile   │  Quizzes   │  Resources  │
- ┴────────────┴────────────┴─────────────┤
- Component Layer                                     │
- ┤
- Hooks & State Management                            │
- ┘

##### Important Elements to Highlight

a. File-based Routing System
- How the app/(tabs) structure maps to navigation
- Relationship between _layout.tsx and child routes

b. Theme System
- Demonstrate how useColorScheme connects to ThemedText and ThemedView

c. Component Architecture
- Hierarchy of reusable components
- How components interact with the theming system

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Mobile["Mobile Application"]
        direction TB
        
        subgraph Nav["Navigation Layer"]
            direction TB
            TabNav["Tab Navigation System"]:::nav
            TabIcon["Tab Bar Icon"]:::nav
            RootLayout["Root Layout"]:::nav
            ErrorHandler["Error Handling"]:::error
        end

        subgraph Screens["Core Screens"]
            direction TB
            Chatbot["Chatbot Screen"]:::screen
            Profile["Profile Screen"]:::screen
            Quizzes["Quizzes Screen"]:::screen
            Resources["Resources Screen"]:::screen
            Settings["Settings Screen"]:::screen
        end

        subgraph UI["UI Components"]
            direction TB
            ThemedText["Themed Text"]:::ui
            ThemedView["Themed View"]:::ui
            Collapsible["Collapsible"]:::ui
            ExtLink["External Link"]:::ui
            HelloWave["Hello Wave"]:::ui
            Parallax["Parallax ScrollView"]:::ui
        end

        subgraph State["State & Theme Management"]
            direction TB
            ColorScheme["Color Scheme Hook"]:::state
            ColorSchemeWeb["Color Scheme Web Hook"]:::state
            ThemeColor["Theme Color Hook"]:::state
            Colors["Colors Constants"]:::state
        end

        subgraph Test["Testing Layer"]
            direction TB
            ThemedTextTest["Themed Text Tests"]:::test
        end
    end

    %% Connections
    TabNav --> Chatbot & Profile & Quizzes & Resources
    TabNav --> TabIcon
    RootLayout --> TabNav
    
    ColorScheme --> ThemedText & ThemedView
    Colors --> ThemeColor
    ThemeColor --> ThemedText & ThemedView

    %% Click Events
    click TabNav "https://github.com/build-umass/aarti-app/blob/main/app/(tabs)/_layout.tsx"
    click TabIcon "https://github.com/build-umass/aarti-app/blob/main/components/navigation/TabBarIcon.tsx"
    click Chatbot "https://github.com/build-umass/aarti-app/blob/main/app/(tabs)/chatbot.tsx"
    click Profile "https://github.com/build-umass/aarti-app/blob/main/app/(tabs)/profile.tsx"
    click Quizzes "https://github.com/build-umass/aarti-app/blob/main/app/(tabs)/quizzes.tsx"
    click Resources "https://github.com/build-umass/aarti-app/blob/main/app/(tabs)/resources.tsx"
    click Settings "https://github.com/build-umass/aarti-app/blob/main/app/settings/index.tsx"
    click ThemedText "https://github.com/build-umass/aarti-app/blob/main/components/ThemedText.tsx"
    click ThemedView "https://github.com/build-umass/aarti-app/blob/main/components/ThemedView.tsx"
    click Colors "https://github.com/build-umass/aarti-app/blob/main/constants/Colors.ts"
    click Collapsible "https://github.com/build-umass/aarti-app/blob/main/components/Collapsible.tsx"
    click ExtLink "https://github.com/build-umass/aarti-app/blob/main/components/ExternalLink.tsx"
    click HelloWave "https://github.com/build-umass/aarti-app/blob/main/components/HelloWave.tsx"
    click Parallax "https://github.com/build-umass/aarti-app/blob/main/components/ParallaxScrollView.tsx"
    click ColorScheme "https://github.com/build-umass/aarti-app/blob/main/hooks/useColorScheme.ts"
    click ColorSchemeWeb "https://github.com/build-umass/aarti-app/blob/main/hooks/useColorScheme.web.ts"
    click ThemeColor "https://github.com/build-umass/aarti-app/blob/main/hooks/useThemeColor.ts"
    click ThemedTextTest "https://github.com/build-umass/aarti-app/blob/main/components/__tests__/ThemedText-test.tsx"
    click RootLayout "https://github.com/build-umass/aarti-app/blob/main/app/_layout.tsx"
    click ErrorHandler "https://github.com/build-umass/aarti-app/blob/main/app/+not-found.tsx"

    %% Styling
    classDef nav fill:#2196F3,stroke:#1976D2,color:white
    classDef screen fill:#4CAF50,stroke:#388E3C,color:white
    classDef ui fill:#FFC107,stroke:#FFA000,color:black
    classDef state fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef test fill:#FF5722,stroke:#E64A19,color:white
    classDef error fill:#F44336,stroke:#D32F2F,color:white
```
