# aryabandhu/chargeq architecture

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

- Interactive diagram: https://gitdiagram.com/aryabandhu/chargeq
- Repository: https://github.com/aryabandhu/chargeq

## Overview

##### Project type and purpose
- This is a cross-platform mobile application built with Expo (React Native).
- The JavaScript “app” directory holds file-based routes (screens): index.jsx, bookings.jsx, profile.jsx, scanqr.jsx, wallet.jsx.
- The “android” folder is the native-code scaffold produced by Expo prebuild (Kotlin/Gradle).

##### File structure
Top-level:
- package.json, tsconfig.json → Node.js/TypeScript config
- app.json → Expo configuration
- app/ → React Native screens (file-based routing)
- assets/ → fonts & images usage at runtime
- android/ → native Android project (Gradle, Kotlin)
- (No explicit ios/ folder, managed by Expo under the hood)

##### Key technologies & build steps
- Expo CLI & Metro bundler (JS packaging)
- React Native JS runtime + JavaScriptCore (on device)
- Native modules via the React Native bridge (e.g., Camera, QR scanner)
- Android build: Gradle → APK/AAB; Kotlin code (MainActivity.kt, MainApplication.kt)

##### Main components
A. Developer Environment
– Node.js/NPM, Expo CLI, Metro Bundler
B. Source Code & Assets
– JS entry point (app/index.jsx)
– File-based router (screens in “app/”)
– Assets (images, fonts)
C. Build & Packaging
– Metro Bundler → JS bundle (.jsbundle)
– Expo native modules packaging
– Android Gradle build pipeline
D. Target Runtimes
– Android device/emulator (JavaScriptCore + Native Modules)
– (Optionally iOS simulator/device via Expo)
E. External Services (placeholder)
– REST/GraphQL backend
– 3rd-party SDKs (e.g., authentication, analytics)
F. Native Modules / Hardware
– Camera & QR Scanner bridge
– Secure storage / AsyncStorage
– Device sensors/APIs

##### Relationships & Data Flows
– Developer → Expo CLI → Metro Bundler → Produces JS bundle
– JS bundle + Native modules packaged by Gradle → Installed on device
– On device: UI screens ↔(React Native Bridge)↔ Native modules & hardware
– JS screens ↔(fetch/XHR)↔ External backend services

##### Architectural patterns & principles
– File-based routing organizes screens as individual components
– Separation of concerns:
- Presentation layer (React components in “app/”)
- Asset management (“assets/”)
- Native bridge modules (expo packages, Android code)
– Modularization: group related screens, assets, native code

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer Environment
    subgraph "Developer Environment"
        pkg["package.json"]:::dev
        tsconfig["tsconfig.json"]:::dev
        expo["Expo CLI / Metro Bundler"]:::dev
        appjson["app.json"]:::dev
    end

    %% JS Layer
    subgraph "JS Layer" 
        subgraph "File-based Router & Screens"
            index["app/index.jsx"]:::js
            layout["app/_layout.jsx"]:::js
            bookings["app/bookings.jsx"]:::js
            profile["app/profile.jsx"]:::js
            scanqr["app/scanqr.jsx"]:::js
            wallet["app/wallet.jsx"]:::js
        end
        assetLoader["Asset Loader"]:::js
        jsbundle["JS Bundle"]:::js
    end

    %% Assets
    subgraph "Assets"
        fonts["assets/fonts/"]:::js
        images["assets/images/"]:::js
    end

    %% Native Layer (Android)
    subgraph "Native Layer (Android)"
        subgraph "Gradle Build Pipeline"
            bg1["android/app/build.gradle"]:::native
            bg2["android/build.gradle"]:::native
            settings["android/settings.gradle"]:::native
            wrapper["android/gradle/wrapper/gradle-wrapper.properties"]:::native
            gradlew1["android/gradlew"]:::native
            gradlew2["android/gradlew.bat"]:::native
        end
        subgraph "Kotlin Entry Points & Bridge"
            mainAct["MainActivity.kt"]:::native
            mainApp["MainApplication.kt"]:::native
        end
        subgraph "Android Resources"
            drawables["android/app/src/main/res/drawable*/"]:::native
            mipmaps["android/app/src/main/res/mipmap*/"]:::native
            vals1["android/app/src/main/res/values/colors.xml"]:::native
            vals2["android/app/src/main/res/values/strings.xml"]:::native
            vals3["android/app/src/main/res/values/styles.xml"]:::native
        end
        subgraph "Android Manifests"
            manifest["android/app/src/main/AndroidManifest.xml"]:::native
            manifestDbg["android/app/src/debug/AndroidManifest.xml"]:::native
        end
        apk["APK/AAB"]:::native
    end

    %% Device Hardware & Runtime
    subgraph "Device Hardware & JS Runtime"
        jscore["JavaScriptCore Engine"]:::native
        camera["Camera / QR Scanner"]:::native
        storage["Secure Storage / AsyncStorage"]:::native
    end

    %% External Services
    subgraph "External Services (Cloud)"
        rest["REST API"]:::ext
        sdk["Auth / Analytics SDK"]:::ext
    end

    %% Connections
    pkg -->|"defines scripts & deps"| expo
    tsconfig -->|"TypeScript config"| expo
    appjson -->|"Expo config"| expo
    expo -->|"bundles via Metro"| jsbundle
    expo -->|"triggers Android build"| bg1
    fonts -->|"included by Metro"| jsbundle
    images -->|"included by Metro"| jsbundle
    jsbundle -->|"runs on"| jscore
    index --> assetLoader
    layout --> assetLoader
    bookings --> assetLoader
    profile --> assetLoader
    scanqr --> assetLoader
    wallet --> assetLoader
    assetLoader --> jsbundle
    jsbundle -->|"React Native bridge"| mainApp
    mainApp --> mainAct
    mainAct --> camera
    mainAct --> storage
    bg1 --> apk
    bg2 --> apk
    settings --> apk
    wrapper --> apk
    gradlew1 --> apk
    gradlew2 --> apk
    apk --> jscore
    jscore --> camera
    jscore --> storage
    jsbundle -->|"fetch/axios"| rest
    jsbundle -->|"fetch/axios"| sdk

    %% Click Events
    click pkg "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/package.json"
    click tsconfig "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/tsconfig.json"
    click appjson "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/app.json"
    click index "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/app/index.jsx"
    click layout "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/app/_layout.jsx"
    click bookings "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/app/bookings.jsx"
    click profile "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/app/profile.jsx"
    click scanqr "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/app/scanqr.jsx"
    click wallet "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/app/wallet.jsx"
    click fonts "https://github.com/aryabandhu/chargeq/tree/new-feature-branch/assets/fonts/"
    click images "https://github.com/aryabandhu/chargeq/tree/new-feature-branch/assets/images/"
    click bg1 "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/android/app/build.gradle"
    click bg2 "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/android/build.gradle"
    click settings "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/android/settings.gradle"
    click wrapper "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/android/gradle/wrapper/gradle-wrapper.properties"
    click gradlew1 "https://github.com/aryabandhu/chargeq/tree/new-feature-branch/android/gradlew"
    click gradlew2 "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/android/gradlew.bat"
    click mainAct "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/android/app/src/main/java/com/anonymous/myapp/MainActivity.kt"
    click mainApp "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/android/app/src/main/java/com/anonymous/myapp/MainApplication.kt"
    click drawables "https://github.com/aryabandhu/chargeq/tree/new-feature-branch/android/app/src/main/res/drawable*/"
    click mipmaps "https://github.com/aryabandhu/chargeq/tree/new-feature-branch/android/app/src/main/res/mipmap*/"
    click vals1 "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/android/app/src/main/res/values/colors.xml"
    click vals2 "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/android/app/src/main/res/values/strings.xml"
    click vals3 "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/android/app/src/main/res/values/styles.xml"
    click manifest "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/android/app/src/main/AndroidManifest.xml"
    click manifestDbg "https://github.com/aryabandhu/chargeq/blob/new-feature-branch/android/app/src/debug/AndroidManifest.xml"

    %% Styles
    classDef dev fill:#f0f8ff,stroke:#4682b4,stroke-width:2px
    classDef js fill:#e0f7fa,stroke:#00796b,stroke-width:2px
    classDef native fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
    classDef ext fill:#fff3e0,stroke:#f57c00,stroke-width:2px
```
