# riadhriadh/expo-tracking architecture

> Architecture diagram of the GitHub repository riadhriadh/expo-tracking, 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/riadhriadh/expo-tracking
- Repository: https://github.com/riadhriadh/expo-tracking

## Overview

##### Core Components
- App Entry Point:
- App.js, which is the initial bootstrap file.
- App.json file that contains configuration settings for Expo.
- Routing / Navigation Layer:
- “app” directory that employs file-based routing.
- Inside the “app” folder, components like _layout.tsx (for overall layout) and +not-found.tsx (for error handling) are used.
- Within “app/(tabs)/” you have specific screens (e.g., explore.tsx, index.tsx) and a dedicated _layout.tsx for tab-based UI.
- UI Components:
- “components” folder with reusable components such as Collapsible, ExternalLink, HapticTab, and specialized UI components in “components/ui” (like IconSymbol and TabBarBackground).
- Assets:
- “assets” directory that holds fonts and images.
- Hooks and Utilities:
- Configuration and Scripts:
- Mention the presence of configuration files (tsconfig.json, package.json) and utility scripts (scripts/reset-project.js).

##### Relationships and Data Flow
- Within each routed screen, indicate interactions with shared UI components (from “components” and “components/ui”) that build the visual interface.
- Finally, denote that the Assets folder supports these components by supplying fonts and images.

##### Architectural Patterns and Design Principles
- Separation of Concerns:
- The project cleanly separates routing (in the “app” directory), UI presentation (in “components”), theming/utilities (in “hooks” and “constants”), and assets.
- File-Based Routing:
- The “app” directory follows a file-based routing architecture, which simplifies navigation logic by mapping file names and structure to routes.
- Reusability and Modularity:
- The components directory is built with reusability in mind, and tests (as seen in “components/__tests__”) further support this modular design.

## Diagram (Mermaid)

```mermaid
flowchart TD

  %% App Entry
  subgraph "App Entry"
    A("App Entry Point: App.js"):::entry
    B("Configuration File: app.json"):::entry
  end

  %% Routing / Navigation Layer
  subgraph "Routing / Navigation"
    R("File-based Routing (app folder)"):::routing
    R1("Overall Layout (_layout.tsx)"):::layout
    R2("Error Screen (+not-found.tsx)"):::layout
    RT("Tabbed Layout (_layout.tsx)"):::layout
    RE("Explore Screen (explore.tsx)"):::screen
    RI("Home Screen (index.tsx)"):::screen
  end

  %% UI Components
  subgraph "UI Components"
    U("Reusable Components (components)"):::ui
    U1("Collapsible"):::ui
    U2("ExternalLink"):::ui
    U3("HapticTab"):::ui
    U4("HelloWave"):::ui
    U5("ParallaxScrollView"):::ui
    U6("ThemedText"):::ui
    U7("ThemedView"):::ui
    subgraph "UI Components - Platform Specific"
      U8("IconSymbol"):::ui
      U9("TabBarBackground"):::ui
    end
  end

  %% Assets
  subgraph "Assets"
    AS("Fonts & Images"):::assets
  end

  %% Hooks and Utilities
  subgraph "Hooks & Utilities"
    HU("Theming & Utility Logic"):::hooks
    HU1("useColorScheme"):::hooks
    HU2("useColorScheme.web"):::hooks
    HU3("useThemeColor"):::hooks
    HU4("Colors Constant"):::hooks
  end

  %% Configuration and Scripts
  subgraph "Configuration & Scripts"
    C1("package.json"):::config
    C2("tsconfig.json"):::config
    C3("reset-project.js"):::config
  end

  %% Connections / Data Flow
  A -->|"initializesExpo"| B
  B -->|"bootsExpoRuntime"| R
  
  R -->|"applies layout"| R1
  R -->|"handles errors"| R2
  R -->|"applies tab layout"| RT
  RT -->|"navigates to"| RE
  RT -->|"navigates to"| RI

  %% Screens use UI components
  R1 -->|"composes UI"| U
  RE -->|"renders UI"| U
  RI -->|"renders UI"| U
  
  %% UI components rely on hooks & utilities and assets
  U -->|"uses theming"| HU
  U -->|"loads assets"| AS
  
  %% Hooks provide theming constants
  HU -->|"supplies colors"| HU4

  %% Configuration affects initialization
  C1 -->|"defines modules"| A
  C2 -->|"configures TS"| A
  C3 -->|"utility script"| A

  %% Click events
  click A "https://github.com/riadhriadh/expo-tracking/blob/master/App.js"
  click B "https://github.com/riadhriadh/expo-tracking/blob/master/app.json"
  click R "https://github.com/riadhriadh/expo-tracking/tree/master/app"
  click R1 "https://github.com/riadhriadh/expo-tracking/blob/master/app/_layout.tsx"
  click R2 "https://github.com/riadhriadh/expo-tracking/blob/master/app/+not-found.tsx"
  click RT "https://github.com/riadhriadh/expo-tracking/blob/master/app/(tabs)/_layout.tsx"
  click RE "https://github.com/riadhriadh/expo-tracking/blob/master/app/(tabs)/explore.tsx"
  click RI "https://github.com/riadhriadh/expo-tracking/blob/master/app/(tabs)/index.tsx"
  click U1 "https://github.com/riadhriadh/expo-tracking/blob/master/components/Collapsible.tsx"
  click U2 "https://github.com/riadhriadh/expo-tracking/blob/master/components/ExternalLink.tsx"
  click U3 "https://github.com/riadhriadh/expo-tracking/blob/master/components/HapticTab.tsx"
  click U4 "https://github.com/riadhriadh/expo-tracking/blob/master/components/HelloWave.tsx"
  click U5 "https://github.com/riadhriadh/expo-tracking/blob/master/components/ParallaxScrollView.tsx"
  click U6 "https://github.com/riadhriadh/expo-tracking/blob/master/components/ThemedText.tsx"
  click U7 "https://github.com/riadhriadh/expo-tracking/blob/master/components/ThemedView.tsx"
  click U8 "https://github.com/riadhriadh/expo-tracking/blob/master/components/ui/IconSymbol.tsx"
  click U9 "https://github.com/riadhriadh/expo-tracking/blob/master/components/ui/TabBarBackground.tsx"
  click AS "https://github.com/riadhriadh/expo-tracking/tree/master/assets"
  click HU1 "https://github.com/riadhriadh/expo-tracking/blob/master/hooks/useColorScheme.ts"
  click HU2 "https://github.com/riadhriadh/expo-tracking/blob/master/hooks/useColorScheme.web.ts"
  click HU3 "https://github.com/riadhriadh/expo-tracking/blob/master/hooks/useThemeColor.ts"
  click HU4 "https://github.com/riadhriadh/expo-tracking/blob/master/constants/Colors.ts"
  click C1 "https://github.com/riadhriadh/expo-tracking/blob/master/package.json"
  click C2 "https://github.com/riadhriadh/expo-tracking/blob/master/tsconfig.json"
  click C3 "https://github.com/riadhriadh/expo-tracking/blob/master/scripts/reset-project.js"

  %% Styles
  classDef entry fill:#ffcccc,stroke:#aa0000,stroke-width:2px;
  classDef routing fill:#ccffcc,stroke:#00aa00,stroke-width:2px;
  classDef layout fill:#ffffcc,stroke:#aaaa00,stroke-width:2px;
  classDef screen fill:#ffff99,stroke:#888800,stroke-width:2px;
  classDef ui fill:#cce5ff,stroke:#003366,stroke-width:2px;
  classDef assets fill:#e6ccff,stroke:#6600aa,stroke-width:2px;
  classDef hooks fill:#ffe6cc,stroke:#cc6600,stroke-width:2px;
  classDef config fill:#d9d9d9,stroke:#666666,stroke-width:2px;
```
