# bhaveshdesale/signx architecture

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

- Interactive diagram: https://gitdiagram.com/bhaveshdesale/signx
- Repository: https://github.com/bhaveshdesale/signx

## Overview

#### Purpose and Runtime
This is a native Android sign-language application, built with Gradle/Kotlin and likely Jetpack Compose. It combines authentication, navigation, camera capture, on-device hand-landmark detection, and a remote sign-language API. The Android app entry configuration is `app/src/main/AndroidManifest.xml`; application/activity startup code is in `app/src/main/java/com/example/signx/App.java` and `app/src/main/java/com/example/signx/MainActivity.kt`.

#### Application Composition and Navigation
`MainActivity.kt` hosts the application UI and initializes the Compose-oriented screen flow. `app/src/main/java/com/example/signx/navigation/NavGraph.kt` is the primary route boundary between auth, home, and camera experiences. There are two UI organization areas: feature-facing screens under `presentation/` and additional themed UI screens under `ui/theme/Ui/`; this indicates navigation or migration boundaries that should be reconciled before broad UI changes.

#### Authentication Feature
Authentication is modeled as a presentation state machine:
- `app/src/main/java/com/example/signx/presentation/auth/AuthViewModel.kt`
- `app/src/main/java/com/example/signx/presentation/auth/AuthUiState.kt`
- `app/src/main/java/com/example/signx/presentation/auth/LoginScreen.kt`
- `app/src/main/java/com/example/signx/presentation/auth/RegisterScreen.kt`
- `app/src/main/java/com/example/signx/presentation/auth/HomeScreen.kt`

Screens render state and dispatch user actions to `AuthViewModel`; successful auth likely gates access to home/camera routes. Firebase configuration is present at `app/google-services.json` and `app/src/main/java/com/example/signx/google-services.json`, making Google/Firebase services a material integration, though the exact Firebase product use is not visible from the tree.

#### Camera-to-Landmarks Pipeline
The camera feature is the core real-time processing path:
- `app/src/main/java/com/example/signx/presentation/camera/CameraScreen.kt`
- `app/src/main/java/com/example/signx/presentation/camera/CameraViewModel.kt`
- `app/src/main/java/com/example/signx/presentation/camera/CameraAnalyzer.kt`
- `app/src/main/java/com/example/signx/presentation/camera/HandLandmarkDetector.kt`

`CameraScreen` owns camera-facing UI and lifecycle integration. Frames flow through `CameraAnalyzer` into `HandLandmarkDetector`, which uses the packaged model `app/src/assets/models/hand_landmarker.task`. `CameraViewModel` is the state/control boundary between asynchronous camera inference and rendered recognition UI. Bitmap/frame conversion utilities are isolated in `app/src/main/java/com/example/signx/utils/BitmapUtils.kt`.

#### Sign-Language Data and Remote Boundary
The data layer separates API access from repository-facing consumption:
- `app/src/main/java/com/example/signx/data/api/SignLanguageApiService.kt`
- `app/src/main/java/com/example/signx/data/repository/SignLanguageRepository.kt`
- `app/src/main/java/com/example/signx/data/model/SignLanguageRepository.kt`

The API service is the external network boundary; repository classes should shield view models and camera logic from request/response details. The duplicated `SignLanguageRepository` name across `data/model` and `data/repository` is architecturally ambiguous and should be inspected before extending the data contract. Connectivity checks belong at `app/src/main/java/com/example/signx/utils/NetworkUtils.kt`, rather than in UI or analyzer code.

#### Principal End-to-End Flow
1. Android launches activity/application startup.
2. Navigation selects auth or main application routes.
3. Auth screens update `AuthViewModel` state and transition to home.
4. The user enters camera mode; camera frames are analyzed locally using the bundled hand-landmarker model.
5. Landmark/inference results update `CameraViewModel` and camera UI.
6. Where interpretation or sign-language content requires network access, feature code crosses through the repository and API-service boundary.

#### Build, Assets, and Platform Boundaries
The single app module is defined by `app/build.gradle.kts`; root dependency/version orchestration is in `build.gradle.kts` and `gradle/libs.versions.toml`. Android resources and permissions-facing platform configuration live in `app/src/main/res/` and `app/src/main/AndroidManifest.xml`. The app’s key non-code dependencies are the local ML task model and Firebase/Google service configuration; remote API details are encapsulated by `SignLanguageApiService.kt`.

Main entry points: [`app/src/main/java/com/example/signx/navigation/NavGraph.kt`](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/navigation/NavGraph.kt) (Route graph), [`app/src/main/java/com/example/signx/presentation/auth/AuthViewModel.kt`](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/presentation/auth/AuthViewModel.kt) (Auth state controller), [`app/src/main/java/com/example/signx/presentation/camera/CameraScreen.kt`](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/presentation/camera/CameraScreen.kt) (Camera screen), [`app/src/main/java/com/example/signx/presentation/camera/CameraViewModel.kt`](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/presentation/camera/CameraViewModel.kt) (Camera state controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Android platform"]
  node_manifest["App manifest<br/>Android config"]
  node_app_startup["Application startup<br/>[App.java]"]
  node_firebase_config["Firebase configuration<br/>Google services"]
end

subgraph group_ui["UI and navigation"]
  node_main_activity["Main activity<br/>Compose host<br/>[MainActivity.kt]"]
  node_nav_graph["Route graph<br/>Navigation<br/>[NavGraph.kt]"]
end

subgraph group_auth["Authentication"]
  node_auth_screens["Auth and home screens<br/>Compose screens<br/>[LoginScreen.kt]"]
  node_auth_viewmodel["Auth state controller<br/>ViewModel<br/>[AuthViewModel.kt]"]
  node_auth_ui_state["Auth UI state<br/>State model<br/>[AuthUiState.kt]"]
end

subgraph group_camera["Camera inference"]
  node_camera_screen["Camera screen<br/>Compose screen<br/>[CameraScreen.kt]"]
  node_camera_viewmodel["Camera state controller<br/>ViewModel<br/>[CameraViewModel.kt]"]
  node_camera_analyzer["Frame analyzer<br/>Camera pipeline<br/>[CameraAnalyzer.kt]"]
  node_bitmap_utils["Frame conversion<br/>Image utility<br/>[BitmapUtils.kt]"]
  node_hand_detector["Hand landmark detector<br/>On-device ML"]
  node_hand_model["Hand landmarker model<br/>ML task asset"]
end

subgraph group_data["Sign-language data"]
  node_sign_repository["Sign-language repository"]
  node_api_service{{"Sign-language API<br/>Remote API client"}}
  node_network_utils["Connectivity checks<br/>Network utility<br/>[NetworkUtils.kt]"]
  node_duplicate_repository["Ambiguous repository model<br/>Data model"]
end

node_manifest -->|"launches"| node_app_startup
node_app_startup -->|"starts"| node_main_activity
node_main_activity -->|"hosts"| node_nav_graph
node_nav_graph -->|"routes to"| node_auth_screens
node_auth_screens -->|"dispatches actions"| node_auth_viewmodel
node_auth_viewmodel -->|"updates"| node_auth_ui_state
node_auth_ui_state -->|"renders"| node_auth_screens
node_auth_viewmodel -->|"auth success transitions"| node_nav_graph
node_firebase_config -.->|"supports integration"| node_auth_viewmodel
node_nav_graph -->|"routes to"| node_camera_screen
node_camera_screen -->|"renders and controls"| node_camera_viewmodel
node_camera_screen -->|"supplies frames"| node_camera_analyzer
node_camera_analyzer -->|"converts frames"| node_bitmap_utils
node_camera_analyzer -->|"analyzes frames"| node_hand_detector
node_hand_model -->|"loaded by"| node_hand_detector
node_hand_detector -->|"landmark results"| node_camera_viewmodel
node_camera_viewmodel -->|"recognition state"| node_camera_screen
node_camera_viewmodel -.->|"requests interpretation"| node_sign_repository
node_sign_repository -->|"checks connectivity"| node_network_utils
node_sign_repository -->|"uses"| node_api_service
node_duplicate_repository -.->|"name ambiguity"| node_sign_repository

click node_manifest "https://github.com/bhaveshdesale/signx/blob/main/app/src/main/AndroidManifest.xml"
click node_app_startup "https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/App.java"
click node_main_activity "https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/MainActivity.kt"
click node_nav_graph "https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/navigation/NavGraph.kt"
click node_auth_screens "https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/presentation/auth/LoginScreen.kt"
click node_auth_viewmodel "https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/presentation/auth/AuthViewModel.kt"
click node_auth_ui_state "https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/presentation/auth/AuthUiState.kt"
click node_firebase_config "https://github.com/bhaveshdesale/signx/blob/main/app/google-services.json"
click node_camera_screen "https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/presentation/camera/CameraScreen.kt"
click node_camera_viewmodel "https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/presentation/camera/CameraViewModel.kt"
click node_camera_analyzer "https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/presentation/camera/CameraAnalyzer.kt"
click node_bitmap_utils "https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/utils/BitmapUtils.kt"
click node_hand_detector "https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/presentation/camera/HandLandmarkDetector.kt"
click node_hand_model "https://github.com/bhaveshdesale/signx/blob/main/app/src/assets/models/hand_landmarker.task"
click node_sign_repository "https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/data/repository/SignLanguageRepository.kt"
click node_api_service "https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/data/api/SignLanguageApiService.kt"
click node_network_utils "https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/utils/NetworkUtils.kt"
click node_duplicate_repository "https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/data/model/SignLanguageRepository.kt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_manifest,node_app_startup,node_firebase_config toneBlue
class node_main_activity,node_nav_graph toneAmber
class node_auth_screens,node_auth_viewmodel,node_auth_ui_state toneMint
class node_camera_screen,node_camera_viewmodel,node_camera_analyzer,node_bitmap_utils,node_hand_detector,node_hand_model toneRose
class node_sign_repository,node_api_service,node_network_utils,node_duplicate_repository toneIndigo
```

## Components

### Android platform

- [App manifest](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/AndroidManifest.xml): Android config · Declares app platform integration and permissions. · `app/src/main/AndroidManifest.xml`
- [Application startup](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/App.java): Application · `app/src/main/java/com/example/signx/App.java`
- [Firebase configuration](https://github.com/bhaveshdesale/signx/blob/main/app/google-services.json): Google services · Configured external Google/Firebase integration. · `app/google-services.json`

### UI and navigation

- [Main activity](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/MainActivity.kt): Compose host · `app/src/main/java/com/example/signx/MainActivity.kt`
- [Route graph](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/navigation/NavGraph.kt): Navigation · Routes between auth, home, and camera experiences. · `app/src/main/java/com/example/signx/navigation/NavGraph.kt`

### Authentication

- [Auth and home screens](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/presentation/auth/LoginScreen.kt): Compose screens · `app/src/main/java/com/example/signx/presentation/auth/LoginScreen.kt`
- [Auth state controller](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/presentation/auth/AuthViewModel.kt): ViewModel · `app/src/main/java/com/example/signx/presentation/auth/AuthViewModel.kt`
- [Auth UI state](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/presentation/auth/AuthUiState.kt): State model · `app/src/main/java/com/example/signx/presentation/auth/AuthUiState.kt`

### Camera inference

- [Camera screen](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/presentation/camera/CameraScreen.kt): Compose screen · Owns camera UI and lifecycle integration. · `app/src/main/java/com/example/signx/presentation/camera/CameraScreen.kt`
- [Camera state controller](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/presentation/camera/CameraViewModel.kt): ViewModel · Bridges asynchronous inference and rendered recognition UI. · `app/src/main/java/com/example/signx/presentation/camera/CameraViewModel.kt`
- [Frame analyzer](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/presentation/camera/CameraAnalyzer.kt): Camera pipeline · `app/src/main/java/com/example/signx/presentation/camera/CameraAnalyzer.kt`
- [Frame conversion](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/utils/BitmapUtils.kt): Image utility · `app/src/main/java/com/example/signx/utils/BitmapUtils.kt`
- [Hand landmark detector](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/presentation/camera/HandLandmarkDetector.kt): On-device ML · `app/src/main/java/com/example/signx/presentation/camera/HandLandmarkDetector.kt`
- [Hand landmarker model](https://github.com/bhaveshdesale/signx/blob/main/app/src/assets/models/hand_landmarker.task): ML task asset · `app/src/assets/models/hand_landmarker.task`

### Sign-language data

- [Sign-language repository](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/data/repository/SignLanguageRepository.kt): Repository · Shields feature code from API request and response details. · `app/src/main/java/com/example/signx/data/repository/SignLanguageRepository.kt`
- [Sign-language API](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/data/api/SignLanguageApiService.kt): Remote API client · External network boundary. · `app/src/main/java/com/example/signx/data/api/SignLanguageApiService.kt`
- [Connectivity checks](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/utils/NetworkUtils.kt): Network utility · `app/src/main/java/com/example/signx/utils/NetworkUtils.kt`
- [Ambiguous repository model](https://github.com/bhaveshdesale/signx/blob/main/app/src/main/java/com/example/signx/data/model/SignLanguageRepository.kt): Data model · Duplicate repository name should be resolved before extending the data contract. · `app/src/main/java/com/example/signx/data/model/SignLanguageRepository.kt`

## Connections

- App manifest → Application startup: launches
- Application startup → Main activity: starts
- Main activity → Route graph: hosts
- Route graph → Auth and home screens: routes to
- Auth and home screens → Auth state controller: dispatches actions
- Auth state controller → Auth UI state: updates
- Auth UI state → Auth and home screens: renders
- Auth state controller → Route graph: auth success transitions
- Firebase configuration → Auth state controller: supports integration
- Route graph → Camera screen: routes to
- Camera screen → Camera state controller: renders and controls
- Camera screen → Frame analyzer: supplies frames
- Frame analyzer → Frame conversion: converts frames
- Frame analyzer → Hand landmark detector: analyzes frames
- Hand landmarker model → Hand landmark detector: loaded by
- Hand landmark detector → Camera state controller: landmark results
- Camera state controller → Camera screen: recognition state
- Camera state controller → Sign-language repository: requests interpretation
- Sign-language repository → Connectivity checks: checks connectivity
- Sign-language repository → Sign-language API: uses
- Ambiguous repository model → Sign-language repository: name ambiguity
