# yangsaiyan/dsid_mobile_application_reactnative architecture

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

## Overview

##### Project Type and Purpose
- This is a cross-platform mobile app built on Expo (React Native + TypeScript)
- Uses file-based routing (`app` folder) and React Navigation (bottom tabs, stack)
- Focused purely on client-side UI/UX, camera/QR features, user profiles, theming

##### File Structure
Top-level layout:
- `app/` – file-based routes, layouts, navigation setup
- `components/` – reusable UI components, subdivided by feature (profile, qr, student_verification) and by generic UI
- `assets/` – images and fonts
- `constants/`, `utils/` – shared values and config
- `scripts/` – dev utilities (e.g. reset-project)
- Config files (`app.config.js`, `tsconfig.json`, `eas.json`) and package manifests

##### README
- Confirms Expo CLI workflow, file-based routing
- No back end in repo (pure-client)
- Encourages using Expo Go, emulators, dev builds

##### Main System Components
A. App Shell & Routing
- Entry point → `_layout.tsx` + `AppNavigator.tsx` → `BottomTabNavigator.tsx`
B. Screens (Features)
- HomeScreen, LoginScreen, ProfileScreen, QRScreen
C. UI Component Library
- Generic components (`Collapsible`, `ThemedText`, `ParallaxScrollView`, etc.)
- Feature-specific components (ProfileCard, QRGenerator, QRScanner, StudentVerification)
D. Cross-cutting Utilities
- Theme hooks (`useColorScheme`, `useThemeColor`)
E. Assets Layer
- Fonts, images (static resources)
F. External / Native Services
- Expo modules (Camera, SecureStore, Linking, Haptics)
- QR code library APIs (Scanner / Generator)
- Optional network API endpoints (if your app will call a server)

##### Relationships & Data Flows
- User taps tab → Navigation layer routes to Screen component
- Screen invokes feature components → UI components
- UI components call hooks/utilities for theming and config
- Feature components (e.g. `QRScanner`) invoke native Expo APIs (Camera)
- Any network call flows: Screen → utils/config → fetch → remote API

##### Architectural Patterns
- Feature-based modular structure
- Unidirectional data flow: navigator → screen → component → service
- Separation of concerns between Presentation (components), Routing (navigation), and Utilities

##### Essential Details to Capture
- Entry point → layout → navigator → screen hierarchy
- Reusable vs. feature components
- Theming and configuration layer
- Native device & Expo services

## Diagram (Mermaid)

```mermaid
graph TD
    %% Routing Layer
    subgraph "Routing" 
        Layout["_layout.tsx"]:::nav
        AppNav["AppNavigator.tsx"]:::nav
        BottomTab["BottomTabNavigator.tsx"]:::nav
    end

    %% Screens
    subgraph "Screens"
        Home["HomeScreen.tsx"]:::ui
        Login["LoginScreen.tsx"]:::ui
        ProfileScr["ProfileScreen.tsx"]:::ui
        QRScr["QRScreen.tsx"]:::ui
    end

    %% UI Component Library
    subgraph "UI Components"
        Collapsible["Collapsible.tsx"]:::ui
        ThemedText["ThemedText.tsx"]:::ui
        Parallax["ParallaxScrollView.tsx"]:::ui
        ExternalLink["ExternalLink.tsx"]:::ui
        HapticTab["HapticTab.tsx"]:::ui
        HelloWave["HelloWave.tsx"]:::ui
        ThemedView["ThemedView.tsx"]:::ui
        subgraph "UI Folder"
            IconSymbol["IconSymbol.tsx"]:::ui
            TabBarBG["TabBarBackground.tsx"]:::ui
        end
    end

    %% Feature-Specific Components
    subgraph "Feature Components"
        ProfileCard["ProfileCard.tsx"]:::ui
        QRGen["QRGenerator.tsx"]:::ui
        QRScan["QRScanner.tsx"]:::ui
        StudentVerif["StudentVerification.tsx"]:::ui
    end

    %% Utilities / Config
    subgraph "Utilities / Config"
        UseColor["useColorScheme.ts"]:::util
        UseThemeColor["useThemeColor.ts"]:::util
        ColorsConst["Colors.ts"]:::util
        AppConfig["config.ts"]:::util
        SharedConst["constants.ts"]:::util
    end

    %% Assets
    subgraph "Assets"
        Fonts(("Fonts")):::asset
        Images(("Images")):::asset
    end

    %% External / Native Services
    subgraph "External Services"
        Camera(("Expo Camera")):::ext
        SecureStore(("Expo SecureStore")):::ext
        Linking(("Expo Linking")):::ext
        Haptics(("Expo Haptics")):::ext
        QRCodeAPI(("QR Code Library")):::ext
    end

    %% Connections: Routing
    Layout --> AppNav
    AppNav --> BottomTab
    BottomTab -->|tab| Home
    BottomTab -->|tab| Login
    BottomTab -->|tab| ProfileScr
    BottomTab -->|tab| QRScr

    %% Screens to Feature Components
    Home --> HelloWave
    Home --> Parallax
    QRScr --> QRGen
    QRScr --> QRScan
    ProfileScr --> ProfileCard
    ProfileScr --> StudentVerif

    %% UI Components use Utilities
    Collapsible --> UseThemeColor
    ThemedText --> UseThemeColor
    ThemedView --> UseThemeColor
    Parallax --> UseColor
    ExternalLink --> AppConfig
    HapticTab --> Haptics
    HelloWave --> SharedConst

    %% Feature Components to UI and Native
    QRScan --> Camera
    QRScan --> QRCodeAPI
    ProfileCard --> ThemedView

    %% Screens to Utilities/Config
    Home --> ColorsConst
    Login --> AppConfig
    ProfileScr --> ColorsConst
    QRScr --> AppConfig

    %% UI Components reference Assets
    ThemedView --> Fonts
    IconSymbol --> Images
    TabBarBG --> Images

    %% Click Events
    click Layout "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/app/_layout.tsx"
    click AppNav "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/app/navigation/AppNavigator.tsx"
    click BottomTab "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/app/navigation/BottomTabNavigator.tsx"
    click Home "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/app/screens/HomeScreen.tsx"
    click Login "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/app/screens/LoginScreen.tsx"
    click ProfileScr "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/app/screens/ProfileScreen.tsx"
    click QRScr "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/app/screens/QRScreen.tsx"
    click Collapsible "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/components/Collapsible.tsx"
    click ThemedText "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/components/ThemedText.tsx"
    click Parallax "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/components/ParallaxScrollView.tsx"
    click ExternalLink "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/components/ExternalLink.tsx"
    click HapticTab "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/components/HapticTab.tsx"
    click HelloWave "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/components/HelloWave.tsx"
    click ThemedView "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/components/ThemedView.tsx"
    click IconSymbol "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/components/ui/IconSymbol.tsx"
    click TabBarBG "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/components/ui/TabBarBackground.tsx"
    click ProfileCard "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/components/profile/ProfileCard.tsx"
    click QRGen "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/components/qr_generator/QRGenerator.tsx"
    click QRScan "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/components/qr_scan/QRScanner.tsx"
    click StudentVerif "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/components/student_verification/StudentVerification.tsx"
    click UseColor "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/hooks/useColorScheme.ts"
    click UseThemeColor "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/hooks/useThemeColor.ts"
    click ColorsConst "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/constants/Colors.ts"
    click AppConfig "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/utils/config.ts"
    click SharedConst "https://github.com/yangsaiyan/dsid_mobile_application_reactnative/blob/master/utils/constants.ts"

    %% Styles
    classDef nav fill:#b2f5bf,stroke:#4caf50,stroke-width:1px
    classDef ui fill:#bfdbfe,stroke:#3b82f6,stroke-width:1px
    classDef util fill:#fde68a,stroke:#d97706,stroke-width:1px
    classDef ext fill:#fed7aa,stroke:#f97316,stroke-width:1px
    classDef asset fill:#e5e7eb,stroke:#9ca3af,stroke-width:1px
```
