# hoosammr/helloaiworld architecture

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

- Interactive diagram: https://gitdiagram.com/hoosammr/helloaiworld
- Repository: https://github.com/hoosammr/helloaiworld

## Overview

AI Hello World is a small Android Compose demonstration of a hand-weighted neuron choosing contrasting text for a user-selected RGB background. The user adjusts color sliders; the screen forwards values to the ViewModel, which asks the repository for a prediction and exposes updated state for rendering. The repository delegates to the neuron, which normalizes channels and returns sigmoid confidence. The README documents Hilt wiring; sampled code confirms the providers, but no external service or persistent store is present.

Main entry points: [`app/src/main/java/com/meray/aihelloworld/presentation/ColorViewModel.kt`](https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/presentation/ColorViewModel.kt) (Color ViewModel), [`app/src/main/java/com/meray/aihelloworld/data/repository/ColorRepositoryImpl.kt`](https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/data/repository/ColorRepositoryImpl.kt) (Repository implementation), [`app/src/main/java/com/meray/aihelloworld/presentation/ColorScreen.kt`](https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/presentation/ColorScreen.kt) (Color screen), [`app/src/main/java/com/meray/aihelloworld/MainActivity.kt`](https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/MainActivity.kt) (MainActivity)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Android app"]
  node_activity["MainActivity<br/>[MainActivity.kt]"]
  node_theme["Compose theme<br/>[Theme.kt]"]
  node_di["Hilt providers<br/>[AppModule.kt]"]
end

subgraph group_presentation["Color experience"]
  node_screen["Color screen<br/>[ColorScreen.kt]"]
  node_viewmodel["Color ViewModel<br/>[ColorViewModel.kt]"]
end

subgraph group_prediction["Prediction core"]
  node_repository["Repository contract<br/>[ColorRepository.kt]"]
  node_repoimpl["Repository implementation"]
  node_neuron["Color neuron<br/>[ColorNeuron.kt]"]
end

node_user(("User"))

node_user -->|"adjusts sliders"| node_screen
node_activity -->|"applies theme"| node_theme
node_activity -->|"shows screen"| node_screen
node_screen -->|"sends RGB"| node_viewmodel
node_viewmodel -->|"requests prediction"| node_repository
node_repoimpl -->|"implements"| node_repository
node_repoimpl -->|"calls predict"| node_neuron
node_viewmodel -->|"invokes contract"| node_repoimpl
node_viewmodel -->|"publishes UI state"| node_screen
node_di -->|"provides repository"| node_repoimpl
node_di -->|"provides neuron"| node_neuron

click node_activity "https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/MainActivity.kt"
click node_theme "https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/ui/theme/Theme.kt"
click node_screen "https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/presentation/ColorScreen.kt"
click node_viewmodel "https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/presentation/ColorViewModel.kt"
click node_repository "https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/domain/repository/ColorRepository.kt"
click node_repoimpl "https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/data/repository/ColorRepositoryImpl.kt"
click node_neuron "https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/domain/ColorNeuron.kt"
click node_di "https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/di/AppModule.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_activity,node_theme,node_di,node_user toneBlue
class node_screen,node_viewmodel toneAmber
class node_repository,node_repoimpl,node_neuron toneMint
```

## Components

### Android app

- [MainActivity](https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/MainActivity.kt): `app/src/main/java/com/meray/aihelloworld/MainActivity.kt`
- [Compose theme](https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/ui/theme/Theme.kt): `app/src/main/java/com/meray/aihelloworld/ui/theme/Theme.kt`
- [Hilt providers](https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/di/AppModule.kt): `app/src/main/java/com/meray/aihelloworld/di/AppModule.kt`

### Color experience

- [Color screen](https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/presentation/ColorScreen.kt): `app/src/main/java/com/meray/aihelloworld/presentation/ColorScreen.kt`
- [Color ViewModel](https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/presentation/ColorViewModel.kt): `app/src/main/java/com/meray/aihelloworld/presentation/ColorViewModel.kt`

### Prediction core

- [Repository contract](https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/domain/repository/ColorRepository.kt): `app/src/main/java/com/meray/aihelloworld/domain/repository/ColorRepository.kt`
- [Repository implementation](https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/data/repository/ColorRepositoryImpl.kt): `app/src/main/java/com/meray/aihelloworld/data/repository/ColorRepositoryImpl.kt`
- [Color neuron](https://github.com/hoosammr/helloaiworld/blob/main/app/src/main/java/com/meray/aihelloworld/domain/ColorNeuron.kt): `app/src/main/java/com/meray/aihelloworld/domain/ColorNeuron.kt`

### Other components

- **User**

## Connections

- User → Color screen: adjusts sliders
- MainActivity → Compose theme: applies theme
- MainActivity → Color screen: shows screen
- Color screen → Color ViewModel: sends RGB
- Color ViewModel → Repository contract: requests prediction
- Repository implementation → Repository contract: implements
- Repository implementation → Color neuron: calls predict
- Color ViewModel → Repository implementation: invokes contract
- Color ViewModel → Color screen: publishes UI state
- Hilt providers → Repository implementation: provides repository
- Hilt providers → Color neuron: provides neuron
