# vishalkasa23/hellodot architecture

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

- Interactive diagram: https://gitdiagram.com/vishalkasa23/hellodot
- Repository: https://github.com/vishalkasa23/hellodot

## Overview

##### Project type and purpose
- From the file tree and minimal README, HelloDot is a cross-platform mobile application built with React Native.
- It targets iOS and Android (presence of `ios/`, `android/`), uses Metro bundler, and implements React Native’s new architecture (TurboModules, JSI, C++ components).
- The JS code under `src/` implements UI screens, navigation (Drawer), form validation, and API calls (`src/api/auth-api.js`) to remote authentication endpoints.

##### File structure
- Top-level:
- `android/` – Android Studio project, Gradle config, native Java modules, JNI C++ code for TurboModules.
- `ios/` – Xcode project, CocoaPods (`Podfile`), Obj-C/Swift entrypoint, unit tests.
- `src/` – Pure JS: components, screens, assets, API layer, helpers, theming, drawer navigation.
- Config files: `babel.config.js`, `metro.config.js`, linter/prettier, `.buckconfig`, Ruby/Gemfile (for iOS CocoaPods).
- Entrypoints: `index.js`, `App.js`, `package.json` – defines scripts & dependencies.

##### README for additional insights
- The README only gives the project name; no embedded architecture details. All insights come from the file tree.

a. Main components:
- JavaScript Layer (React Native app):
– UI Screens (Login, Register, Dashboard, etc.)
– Navigation Layer (Drawer)
– Business Logic & Validation Helpers
– API Client (`auth-api.js`)
- Metro Bundler & JS Engine (e.g., Hermes)
- React Native Bridge & JSI Host
- Native Layer:
– Android (Java) & iOS (Obj-C/Swift) App entrypoints
– TurboModules & C++ Components Registry (JNI/CMake)
- External Services:
– Authentication REST API (external server)
- Device OS & Hardware

b. Relationships & Interactions:
1. Developer invokes metro bundler (local machine) → bundles JS.
2. `index.js` / `App.js` loads bundle into JS engine (Hermes) on device or emulator.
3. JS code invokes React Native Bridge / JSI to call native modules (e.g., custom C++ TurboModules).
4. UI rendering requests flow from JS to the native UI Manager → platform widgets (Android Views or iOS UIView).
5. JS API client issues HTTP(S) requests over network to external Auth API → processes responses.
6. Native modules (Flipper on debug build) communicate back to debugging tools.

c. Architectural Patterns & Principles:
- Modular JS code: separation between UI, navigation, API, and validation
- React Native New Architecture: JSI + TurboModules for high-performance native integration
- Platform abstraction: a single JS codebase with platform-specific native overrides
- Unidirectional data flow: from JS → native → UI, and from network → JS state

d. Key Technologies, Frameworks & Libraries:
- React Native (CLI-managed)
- Metro bundler
- Hermes JS engine (or V8, dependent on config)
- TurboModules & JSI (C++ & JNI for Android, Obj-C++ for iOS)
- Android Gradle & Xcode build systems
- Babel, ESLint, Prettier
- CocoaPods (iOS)

##### Critical Details to Capture
- The separation of concerns between JS and native layers.
- The bidirectional nature of the React Native bridge / JSI host.
- The role of TurboModules (native C++ components) under the new architecture.
- The external API dependency and network flow.
- Platform-specific build & debug tooling (Gradle, CocoaPods, Flipper).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build-time Components
    subgraph "Build Tools" 
        direction TB
        Metro["Metro Bundler"]:::build
        Babel["Babel Config"]:::build
        Gradle["Android Gradle"]:::build
        CocoaPods["iOS CocoaPods"]:::build
    end

    %% JavaScript Layer
    subgraph "JavaScript Layer" 
        direction TB
        EntryIndex["index.js"]:::js
        EntryApp["App.js"]:::js
        JSBundle["JS Bundle"]:::js-runtime
        subgraph Screens
            direction TB
            Login["LoginScreen.js"]:::js
            Register["RegisterScreen.js"]:::js
            Dashboard["Dashboard.js"]:::js
            ResetPassword["ResetPasswordScreen.js"]:::js
            AuthLoading["AuthLoadingScreen.js"]:::js
            Start["StartScreen.js"]:::js
            ScreensIndex["src/screens/index.js"]:::js
        end
        subgraph Navigation
            DrawerMain["Drawer.js"]:::js
            SideDrawer["SideDrawer.js"]:::js
        end
        subgraph Components
            BackButton["BackButton.js"]:::js
            Background["Background.js"]:::js
            Button["Button.js"]:::js
            Header["Header.js"]:::js
            Logo["Logo.js"]:::js
            Paragraph["Paragraph.js"]:::js
            TextInput["TextInput.js"]:::js
            Toast["Toast.js"]:::js
        end
        subgraph Helpers
            EmailVal["emailValidator.js"]:::js
            NameVal["nameValidator.js"]:::js
            PasswordVal["passwordValidator.js"]:::js
        end
        APIClient["auth-api.js"]:::js
        Theme["theme.js"]:::js
        EntryIndex --> EntryApp --> JSBundle
        JSBundle --> Screens
        JSBundle --> Navigation
        JSBundle --> Components
        JSBundle --> Helpers
        JSBundle --> APIClient
        JSBundle --> Theme
    end

    %% Runtime Components
    subgraph "Runtime Layer"
        direction TB
        Engine["JS Engine (Hermes)"]:::js-runtime
        Bridge["React Native Bridge/JSI"]:::bridge
    end

    %% Android Native Layer
    subgraph "Android Native" 
        direction TB
        MainActivity["MainActivity.java"]:::native
        MainApplication["MainApplication.java"]:::native
        RNHost["MainApplicationReactNativeHost.java"]:::native
        ComponentsRegistry["MainComponentsRegistry.java"]:::native
        TurboModuleDelegate["MainApplicationTurboModuleManagerDelegate.java"]:::native
        subgraph "C++ TurboModules (JNI)"
            direction TB
            CMake["CMakeLists.txt"]:::native
            ProvCpp["MainApplicationModuleProvider.cpp/.h"]:::native
            TurboCpp["MainApplicationTurboModuleManagerDelegate.cpp/.h"]:::native
            RegCpp["MainComponentsRegistry.cpp/.h"]:::native
            OnLoad["OnLoad.cpp"]:::native
        end
    end

    %% iOS Native Layer
    subgraph "iOS Native"
        direction TB
        AppDelegateH["AppDelegate.h"]:::native
        AppDelegateMM["AppDelegate.mm"]:::native
        MainM["main.m"]:::native
        subgraph "Xcode & Pods"
            direction TB
            XcodeProj["HelloDot.xcodeproj"]:::native
            XcodeWorkspace["HelloDot.xcworkspace"]:::native
            Podfile["Podfile"]:::native
            PodLock["Podfile.lock"]:::native
        end
        subgraph "iOS Tests"
            HelloTests["HelloDotTests.m"]:::native
            InfoPlist["Info.plist"]:::native
        end
    end

    %% External Service
    AuthAPI["Auth API Service\n(HTTPS)"]:::external

    %% Connections
    Metro --> JSBundle
    Babel --> EntryIndex
    Gradle --> MainActivity
    CocoaPods --> AppDelegateMM

    JSBundle --> Engine
    Engine --> Bridge
    Bridge --> MainActivity
    Bridge --> AppDelegateMM

    APIClient -->|HTTPS| AuthAPI -->|response| APIClient

    MainActivity -->|UI Manager| OSAndroid["Android OS Widgets"]:::native
    AppDelegateMM -->|UI Manager| iOSWidgets["iOS UIViews"]:::native

    %% Click Events
    click EntryIndex "https://github.com/vishalkasa23/hellodot/blob/main/index.js"
    click EntryApp "https://github.com/vishalkasa23/hellodot/blob/main/App.js"
    click Login "https://github.com/vishalkasa23/hellodot/blob/main/src/screens/LoginScreen.js"
    click Register "https://github.com/vishalkasa23/hellodot/blob/main/src/screens/RegisterScreen.js"
    click Dashboard "https://github.com/vishalkasa23/hellodot/blob/main/src/screens/Dashboard.js"
    click ResetPassword "https://github.com/vishalkasa23/hellodot/blob/main/src/screens/ResetPasswordScreen.js"
    click AuthLoading "https://github.com/vishalkasa23/hellodot/blob/main/src/screens/AuthLoadingScreen.js"
    click Start "https://github.com/vishalkasa23/hellodot/blob/main/src/screens/StartScreen.js"
    click ScreensIndex "https://github.com/vishalkasa23/hellodot/blob/main/src/screens/index.js"
    click DrawerMain "https://github.com/vishalkasa23/hellodot/blob/main/src/Drawer/Drawer.js"
    click SideDrawer "https://github.com/vishalkasa23/hellodot/blob/main/src/Drawer/SideDrawer.js"
    click BackButton "https://github.com/vishalkasa23/hellodot/blob/main/src/components/BackButton.js"
    click Background "https://github.com/vishalkasa23/hellodot/blob/main/src/components/Background.js"
    click Button "https://github.com/vishalkasa23/hellodot/blob/main/src/components/Button.js"
    click Header "https://github.com/vishalkasa23/hellodot/blob/main/src/components/Header.js"
    click Logo "https://github.com/vishalkasa23/hellodot/blob/main/src/components/Logo.js"
    click Paragraph "https://github.com/vishalkasa23/hellodot/blob/main/src/components/Paragraph.js"
    click TextInput "https://github.com/vishalkasa23/hellodot/blob/main/src/components/TextInput.js"
    click Toast "https://github.com/vishalkasa23/hellodot/blob/main/src/components/Toast.js"
    click EmailVal "https://github.com/vishalkasa23/hellodot/blob/main/src/helpers/emailValidator.js"
    click NameVal "https://github.com/vishalkasa23/hellodot/blob/main/src/helpers/nameValidator.js"
    click PasswordVal "https://github.com/vishalkasa23/hellodot/blob/main/src/helpers/passwordValidator.js"
    click APIClient "https://github.com/vishalkasa23/hellodot/blob/main/src/api/auth-api.js"
    click Theme "https://github.com/vishalkasa23/hellodot/blob/main/src/core/theme.js"
    click Metro "https://github.com/vishalkasa23/hellodot/blob/main/metro.config.js"
    click Babel "https://github.com/vishalkasa23/hellodot/blob/main/babel.config.js"
    click MainActivity "https://github.com/vishalkasa23/hellodot/blob/main/android/app/src/main/java/com/hellodot/MainActivity.java"
    click MainApplication "https://github.com/vishalkasa23/hellodot/blob/main/android/app/src/main/java/com/hellodot/MainApplication.java"
    click RNHost "https://github.com/vishalkasa23/hellodot/blob/main/android/app/src/main/java/com/hellodot/newarchitecture/MainApplicationReactNativeHost.java"
    click ComponentsRegistry "https://github.com/vishalkasa23/hellodot/blob/main/android/app/src/main/java/com/hellodot/newarchitecture/components/MainComponentsRegistry.java"
    click TurboModuleDelegate "https://github.com/vishalkasa23/hellodot/blob/main/android/app/src/main/java/com/hellodot/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java"
    click CMake "https://github.com/vishalkasa23/hellodot/blob/main/android/app/src/main/jni/CMakeLists.txt"
    click ProvCpp "https://github.com/vishalkasa23/hellodot/blob/main/android/app/src/main/jni/MainApplicationModuleProvider.cpp"
    click TurboCpp "https://github.com/vishalkasa23/hellodot/blob/main/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp"
    click RegCpp "https://github.com/vishalkasa23/hellodot/blob/main/android/app/src/main/jni/MainComponentsRegistry.cpp"
    click OnLoad "https://github.com/vishalkasa23/hellodot/blob/main/android/app/src/main/jni/OnLoad.cpp"
    click AppDelegateH "https://github.com/vishalkasa23/hellodot/blob/main/ios/HelloDot/AppDelegate.h"
    click AppDelegateMM "https://github.com/vishalkasa23/hellodot/blob/main/ios/HelloDot/AppDelegate.mm"
    click MainM "https://github.com/vishalkasa23/hellodot/blob/main/ios/HelloDot/main.m"
    click XcodeProj "https://github.com/vishalkasa23/hellodot/tree/main/ios/HelloDot.xcodeproj/"
    click XcodeWorkspace "https://github.com/vishalkasa23/hellodot/tree/main/ios/HelloDot.xcworkspace/"
    click Podfile "https://github.com/vishalkasa23/hellodot/tree/main/ios/Podfile"
    click PodLock "https://github.com/vishalkasa23/hellodot/blob/main/ios/Podfile.lock"
    click HelloTests "https://github.com/vishalkasa23/hellodot/blob/main/ios/HelloDotTests/HelloDotTests.m"
    click InfoPlist "https://github.com/vishalkasa23/hellodot/blob/main/ios/HelloDotTests/Info.plist"

    %% Styles
    classDef js fill:#cce5ff,stroke:#3399ff,stroke-width:1px;
    classDef js-runtime fill:#99ccff,stroke:#3366cc,stroke-width:1px,stroke-dasharray: 5 5;
    classDef bridge fill:#ffcc99,stroke:#ff9933,stroke-width:1px;
    classDef native fill:#ccffcc,stroke:#33cc33,stroke-width:1px;
    classDef external fill:#ffe5b4,stroke:#ff9900,stroke-width:1px;
    classDef build fill:#e6e6e6,stroke:#999999,stroke-width:1px;
```
