# devshubham1998/newrnhrapp architecture

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

- Interactive diagram: https://gitdiagram.com/devshubham1998/newrnhrapp
- Repository: https://github.com/devshubham1998/newrnhrapp

## Overview

##### Project type and purpose
- This is a cross-platform mobile application built with React Native (TypeScript/JavaScript) and bundled with Metro.
- It has no built-in backend in this repo; instead it consumes external HTTP APIs, uses Firebase Cloud Messaging (FCM) and provides local notifications, manages state with Redux, and renders native UIs on Android and iOS.

##### File structure
- Top-level:
- android/ and ios/ folders: native wrappers, platform-specific entry points, Gradle/Xcode projects, resource assets
- src/: all JavaScript/TypeScript code, organized into:
- components/ (UI building blocks)
- screens/ (feature pages: Login, Registration, Home, Survey)
- services/ (API clients, environment & config)
- notifications/ (FCMService, LocalNotificationService)
- store/ (Redux slices, rootReducer, store setup)
- helpers/, utils/, config.js
- App.tsx and index.js as the JS application entry
- Metro, Babel, ESLint, Prettier, Jest configs, package.json, tsconfig.json
- Patterns:
- Component-based UI
- Redux for application state (store, slices)
- Services layer abstracting HTTP calls (apis.ts, getApis.ts)
- Native bridges for push notifications and other platform features

##### README for additional insights
- Confirms the use of React Native community CLI
- Standard Metro bundler and platform launch instructions

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Development Server
    subgraph "Development"
        Metro["Metro Bundler (Dev Server)"]:::js
    end

    %% React Native JS Engine
    subgraph "React Native JS Engine"
        Index["index.js"]:::js
        App["App.tsx"]:::js
        subgraph "UI Layer"
            Components["UI Components"]:::js
            Screens["Screens (Login, Registration, Home, Survey)"]:::js
        end
        subgraph "State Management"
            Store["Redux Store"]:::data
            RootReducer["rootReducer.tsx"]:::js
            Slices["Redux Slices"]:::js
        end
        subgraph "Services Layer"
            ApiUrls["apiUrls.ts"]:::js
            Apis["apis.ts"]:::js
            GetApis["getApis.ts"]:::js
            AuthRequest["LoginRequest.tsx"]:::js
            EnvConfig["environment.ts"]:::js
            ApiConfig["apiConfig.ts"]:::js
        end
        subgraph "Notification Services"
            FCMService["FCMService.ts"]:::js
            LocalNotif["LocalNotificationService.ts"]:::js
        end
        Helpers["Helpers"]:::js
        Utils["Utils"]:::js
    end

    %% Native Modules
    subgraph "Android Native"
        MainActivity["MainActivity.java"]:::native
        MainApplication["MainApplication.java"]:::native
        FlipperDebug["ReactNativeFlipper (debug)"]:::native
        FlipperRelease["ReactNativeFlipper (release)"]:::native
    end

    subgraph "iOS Native"
        AppDelegate["AppDelegate.h/.mm"]:::native
        MainIOS["main.m"]:::native
        InfoPlist["Info.plist"]:::native
        FCMConfig["GoogleService-Info.plist"]:::native
        CocoaPods["Podfile & Podfile.lock"]:::native
    end

    %% External Services
    subgraph "External Services"
        RESTAPI["REST API Endpoints"]:::external
        FCM["Firebase Cloud Messaging"]:::external
    end

    %% Data Flow
    Metro -->|serves JS bundle| Index
    Index --> App
    App --> Components
    App --> Screens
    Components -->|dispatch action| Store
    Screens -->|dispatch action| Store
    Store -->|reads rootReducer| RootReducer
    RootReducer --> Slices
    Store -->|triggers| Apis
    Store -->|triggers| GetApis
    Store -->|triggers| AuthRequest
    Apis -->|uses| ApiUrls
    Apis -->|uses| ApiConfig
    GetApis -->|uses| EnvConfig
    AuthRequest -->|calls| Apis
    Apis -->|calls| RESTAPI
    RESTAPI -->|response| Store
    Store -->|updates UI| Components
    Store -->|updates UI| Screens

    FCM -->|push| FCMService
    FCMService -->|dispatch| Store
    FCMService -->|triggers| LocalNotif
    LocalNotif -->|shows| Components

    %% Bridging between JS and Native
    App -->|bridging| MainActivity
    App -->|bridging| MainApplication
    App -->|bridging| FlipperDebug
    App -->|bridging| FlipperRelease
    App -->|bridging| AppDelegate
    App -->|bridging| MainIOS
    App -->|bridging| InfoPlist
    App -->|bridging| FCMConfig
    App -->|uses| CocoaPods

    %% Utils and Helpers
    App --> Helpers
    App --> Utils

    %% Click Events
    click Metro "https://github.com/devshubham1998/newrnhrapp/blob/main/metro.config.js"
    click Index "https://github.com/devshubham1998/newrnhrapp/blob/main/index.js"
    click App "https://github.com/devshubham1998/newrnhrapp/blob/main/App.tsx"
    click Components "https://github.com/devshubham1998/newrnhrapp/tree/main/src/components/"
    click Components "https://github.com/devshubham1998/newrnhrapp/tree/main/src/components/common/"
    click Screens "https://github.com/devshubham1998/newrnhrapp/tree/main/src/screens/"
    click Store "https://github.com/devshubham1998/newrnhrapp/blob/main/src/store/store.tsx"
    click RootReducer "https://github.com/devshubham1998/newrnhrapp/blob/main/src/store/rootReducer.tsx"
    click Slices "https://github.com/devshubham1998/newrnhrapp/tree/main/src/store/slices/"
    click ApiUrls "https://github.com/devshubham1998/newrnhrapp/blob/main/src/services/apiUrls.ts"
    click Apis "https://github.com/devshubham1998/newrnhrapp/blob/main/src/services/apis.ts"
    click GetApis "https://github.com/devshubham1998/newrnhrapp/blob/main/src/services/getApis.ts"
    click AuthRequest "https://github.com/devshubham1998/newrnhrapp/blob/main/src/services/AuthRequest/LoginRequest.tsx"
    click EnvConfig "https://github.com/devshubham1998/newrnhrapp/blob/main/src/services/environment.ts"
    click ApiConfig "https://github.com/devshubham1998/newrnhrapp/blob/main/src/services/config/apiConfig.ts"
    click FCMService "https://github.com/devshubham1998/newrnhrapp/blob/main/src/notifications/FCMService.ts"
    click LocalNotif "https://github.com/devshubham1998/newrnhrapp/blob/main/src/notifications/LocalNotificationService.ts"
    click Helpers "https://github.com/devshubham1998/newrnhrapp/tree/main/src/helpers/"
    click Utils "https://github.com/devshubham1998/newrnhrapp/tree/main/src/utils/"
    click MainActivity "https://github.com/devshubham1998/newrnhrapp/blob/main/android/app/src/main/java/com/newrnhrapp/MainActivity.java"
    click MainApplication "https://github.com/devshubham1998/newrnhrapp/blob/main/android/app/src/main/java/com/newrnhrapp/MainApplication.java"
    click FlipperDebug "https://github.com/devshubham1998/newrnhrapp/blob/main/android/app/src/debug/java/com/newrnhrapp/ReactNativeFlipper.java"
    click FlipperRelease "https://github.com/devshubham1998/newrnhrapp/blob/main/android/app/src/release/java/com/newrnhrapp/ReactNativeFlipper.java"
    click AppDelegate "https://github.com/devshubham1998/newrnhrapp/blob/main/ios/NEWRNHRAPP/AppDelegate.h"
    click AppDelegate "https://github.com/devshubham1998/newrnhrapp/blob/main/ios/NEWRNHRAPP/AppDelegate.mm"
    click MainIOS "https://github.com/devshubham1998/newrnhrapp/blob/main/ios/NEWRNHRAPP/main.m"
    click InfoPlist "https://github.com/devshubham1998/newrnhrapp/blob/main/ios/NEWRNHRAPP/Info.plist"
    click FCMConfig "https://github.com/devshubham1998/newrnhrapp/blob/main/ios/GoogleService-Info.plist"
    click CocoaPods "https://github.com/devshubham1998/newrnhrapp/tree/main/ios/Podfile"
    click CocoaPods "https://github.com/devshubham1998/newrnhrapp/blob/main/ios/Podfile.lock"

    %% Styles
    classDef js fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef native fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef external fill:#FFFFE0,stroke:#333,stroke-width:1px
    classDef data fill:#90EE90,stroke:#333,stroke-width:1px
```
