# harshitshukla-github/react_native_introduction architecture

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

- Interactive diagram: https://gitdiagram.com/harshitshukla-github/react_native_introduction
- Repository: https://github.com/harshitshukla-github/react_native_introduction

## Overview

##### Project Type and Purpose
- This is a React Native “Introduction” mobile application scaffolded with Expo.
- It’s a client-only, beginner-friendly demo showcasing core RN components, navigation (using the new Expo Router), styling, theming, and basic file-based routing.

##### File-Structure Analysis
- Top-level “introduction” directory contains:
- app.json & app/ – Expo Router’s entry and file-based routes
- assets/ – images and font files
- components/ – reusable UI building blocks and their tests
- scripts/ – helper scripts (e.g., project reset)
- package.json & tsconfig.json – dependency and TypeScript configs
- The presence of app/(tabs)/ and +not-found.tsx points to Expo Router’s nested-layout/tab navigation.

##### Key README Insights
- Confirms it’s an “introduction to React Native,” focusing on setup, core components, navigation, and styling.
- No backend or external data-service sections; purely frontend.

a. Main Components
- Mobile App Runtime (Expo Go or standalone)
- Metro Bundler / JavaScript Engine
- Screen & Routing Layer (app/ folder)
- UI Component Library (components/)
- Theming & Business Logic (hooks/, constants/)
- Asset Layer (assets/fonts, assets/images)
- Build & Config (package.json, tsconfig.json, app.json)
- External Dependencies (React Native core modules, Expo SDK, React Navigation)
b. Relationships & Data Flow
- User interacts with Screens → Screen components import UI Components
- UI Components consume Hooks & Constants for theming/styling
- Screens trigger navigation events (tabs, stack) via Expo Router
- Metro Bundler packages code + assets → JavaScript Engine on device
- app.json configures runtime behavior; package.json drives dependencies
c. Architectural Patterns
- Component-based separation (atomic UI modules vs. screens)
- File-based routing (Expo Router’s convention over configuration)
- Theming via custom hooks (useColorScheme, useThemeColor) and constants
- Test-driven component validation (Jest snapshots under components/__tests__)
d. Relevant Technologies
- React Native + Expo SDK (mobile runtime)
- Expo Router (file-system routing & nested layouts)
- TypeScript (static types via tsconfig.json)
- Metro Bundler (bundles TSX/JS and assets)
- Jest (component testing)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Build & Config Layer
    subgraph "Build & Configuration"
        direction TB
        PackageJSON["package.json"]:::config
        PackageLock["package-lock.json"]:::config
        TSConfig["tsconfig.json"]:::config
        AppJSON["app.json"]:::config
        ResetScript["reset-project.js"]:::config
    end

    %% Asset Layer
    subgraph "Asset Layer"
        direction TB
        Fonts["Fonts"]:::asset
        Images["Images"]:::asset
    end

    %% Theming & Business Logic Layer
    subgraph "Theming & Business Logic"
        direction TB
        Colors["Colors.ts"]:::logic
        UseColorScheme["useColorScheme.ts"]:::logic
        UseColorSchemeWeb["useColorScheme.web.ts"]:::logic
        UseThemeColor["useThemeColor.ts"]:::logic
    end

    %% UI Component Library
    subgraph "UI Component Library"
        direction TB
        Collapsible["Collapsible.tsx"]:::ui
        ExternalLink["ExternalLink.tsx"]:::ui
        HapticTab["HapticTab.tsx"]:::ui
        HelloWave["HelloWave.tsx"]:::ui
        ParallaxScrollView["ParallaxScrollView.tsx"]:::ui
        ThemedText["ThemedText.tsx"]:::ui
        ThemedView["ThemedView.tsx"]:::ui
        UIPrimitives["UI Primitives"]:::ui
        Tests["Component Tests"]:::ui
    end

    %% Presentation Layer: Routing & Screens
    subgraph "Screen & Routing Layer (app/)"
        direction TB
        RootLayout["_layout.tsx"]:::ui
        NotFound["+not-found.tsx"]:::ui
        subgraph "Tabs Layout"
            direction TB
            TabsLayout["_layout.tsx"]:::ui
            HomeTab["index.tsx: Home Screen"]:::ui
            ExploreTab["explore.tsx: Explore Screen"]:::ui
        end
    end

    %% Runtime & Bundling
    subgraph "Build & Runtime"
        direction TB
        Metro["Metro Bundler"]:::runtime
        JSEngine["JavaScript Engine"]:::runtime
        ExpoRuntime["Expo Go / Standalone"]:::runtime
        ExternalAPIs["Expo & RN APIs"]:::external
    end

    %% User Interaction
    User["User"]:::external

    %% Connections
    User -->|"interacts"| HomeTab
    User -->|"interacts"| ExploreTab
    HomeTab -->|"imports"| Collapsible
    HomeTab -->|"imports"| ThemedText
    ExploreTab -->|"imports"| ParallaxScrollView
    NotFound -->|"imports"| ThemedView

    Collapsible -->|"uses"| UseThemeColor
    ExternalLink -->|"uses"| UseColorScheme
    HapticTab -->|"uses"| UseThemeColor
    HelloWave -->|"uses"| Colors
    ParallaxScrollView -->|"uses"| UseColorSchemeWeb
    ThemedText -->|"uses"| Colors
    ThemedView -->|"uses"| Colors

    RootLayout -->|"renders"| TabsLayout
    TabsLayout -->|"navigates"| HomeTab
    TabsLayout -->|"navigates"| ExploreTab
    RootLayout -->|"handles"| NotFound

    HomeTab -->|"fetches asset"| Images
    ExploreTab -->|"fetches asset"| Fonts

    PackageJSON -->|"defines deps"| Metro
    TSConfig -->|"configures"| Metro
    AppJSON -->|"configures runtime"| ExpoRuntime
    ResetScript -->|"executes"| Metro

    Metro -->|"bundles code"| JSEngine
    JSEngine -->|"executes"| HomeTab
    JSEngine -->|"executes"| ExploreTab
    JSEngine -->|"executes"| RootLayout

    ExternalAPIs -->|"accessed by"| UseThemeColor
    ExternalAPIs -->|"accessed by"| UseColorScheme

    %% Click Events
    click AppJSON "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/app.json"
    click RootLayout "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/app/_layout.tsx"
    click NotFound "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/app/+not-found.tsx"
    click TabsLayout "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/app/(tabs)/_layout.tsx"
    click HomeTab "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/app/(tabs)/index.tsx"
    click ExploreTab "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/app/(tabs)/explore.tsx"
    click Collapsible "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/components/Collapsible.tsx"
    click ExternalLink "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/components/ExternalLink.tsx"
    click HapticTab "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/components/HapticTab.tsx"
    click HelloWave "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/components/HelloWave.tsx"
    click ParallaxScrollView "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/components/ParallaxScrollView.tsx"
    click ThemedText "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/components/ThemedText.tsx"
    click ThemedView "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/components/ThemedView.tsx"
    click UIPrimitives "https://github.com/harshitshukla-github/react_native_introduction/tree/main/introduction/components/ui"
    click Tests "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/components/__tests__/ThemedText-test.tsx"
    click Colors "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/constants/Colors.ts"
    click UseColorScheme "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/hooks/useColorScheme.ts"
    click UseColorSchemeWeb "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/hooks/useColorScheme.web.ts"
    click UseThemeColor "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/hooks/useThemeColor.ts"
    click Fonts "https://github.com/harshitshukla-github/react_native_introduction/tree/main/introduction/assets/fonts"
    click Images "https://github.com/harshitshukla-github/react_native_introduction/tree/main/introduction/assets/images"
    click PackageJSON "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/package.json"
    click PackageLock "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/package-lock.json"
    click TSConfig "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/tsconfig.json"
    click ResetScript "https://github.com/harshitshukla-github/react_native_introduction/blob/main/introduction/scripts/reset-project.js"

    %% Styles
    classDef ui fill:#cfe2f3,stroke:#0366d6,stroke-width:1px
    classDef logic fill:#d9ead3,stroke:#6aa84f,stroke-width:1px
    classDef asset fill:#f9cb9c,stroke:#e69138,stroke-width:1px
    classDef config fill:#d9d2e9,stroke:#8e7cc3,stroke-width:1px
    classDef runtime fill:#cccccc,stroke:#666666,stroke-width:1px
    classDef external fill:#ececec,stroke:#aaaaaa,stroke-width:1px
```
