# hackieron/bahai architecture

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

- Interactive diagram: https://gitdiagram.com/hackieron/bahai
- Repository: https://github.com/hackieron/bahai

## Overview

This repository combines a household-oriented mobile app with a small Laravel API. The mobile workflow is tab-based access to home, bills, chores, and groceries; the sampled UI also includes a scene-based home experience and shared theme. The API’s demonstrated workflow is request entry, route dispatch to a health endpoint, and a health response. The listed domain screens are present, but their implementations were not sampled, and no mobile-to-API connection is evidenced. Arrows are limited to shown references or explicitly marked unverified.

Main entry points: [`api/app/Http/Controllers/Api/V1/HealthController.php`](https://github.com/hackieron/bahai/blob/main/api/app/Http/Controllers/Api/V1/HealthController.php) (Health endpoint), [`mobile/src/components/SceneScreen.tsx`](https://github.com/hackieron/bahai/blob/main/mobile/src/components/SceneScreen.tsx) (Scene screen), [`api/public/index.php`](https://github.com/hackieron/bahai/blob/main/api/public/index.php) (HTTP entry), [`api/bootstrap/app.php`](https://github.com/hackieron/bahai/blob/main/api/bootstrap/app.php) (Laravel bootstrap)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_mobile_root["App shell<br/>[_layout.tsx]"]
  node_tab_nav["Tab navigation<br/>[_layout.tsx]"]
  node_home_tab["Home screen<br/>[index.tsx]"]
  node_bills["Bills screen<br/>[bills.tsx]"]
  node_chores["Chores screen<br/>[chores.tsx]"]
  node_groceries["Groceries screen<br/>[groceries.tsx]"]
  node_home_demo["Home demo<br/>[HomeDemo.tsx]"]
  node_query["Query helper<br/>[query.ts]"]
  node_secure_store["Secure storage<br/>[secure-store.ts]"]
end

subgraph group_scene["Scene interface"]
  node_scene_screen["Scene screen<br/>[SceneScreen.tsx]"]
  node_scene_view["Scene renderer<br/>[Scene.tsx]"]
  node_scene_context["Scene sizing context<br/>[SceneContext.ts]"]
  node_scene_object["Scene object<br/>[SceneObject.tsx]"]
  node_lamp["Lamp object<br/>[Lamp.tsx]"]
end

subgraph group_theme["Shared styling"]
  node_app_text["App text<br/>[AppText.tsx]"]
  node_tab_bar["Custom tab bar<br/>[TabBar.tsx]"]
  node_theme_provider["Theme provider<br/>[ThemeProvider.tsx]"]
  node_theme_tokens["Theme tokens<br/>[tokens.ts]"]
end

subgraph group_api["Laravel API"]
  node_http_entry["HTTP entry<br/>[index.php]"]
  node_laravel_boot["Laravel bootstrap<br/>[app.php]"]
  node_api_routes["API routes<br/>[api.php]"]
  node_health_controller["Health endpoint"]
  node_base_controller["Base controller<br/>[Controller.php]"]
  node_health_resource["Health response<br/>[HealthResource.php]"]
  node_service_provider["Rate limiting"]
  node_provider_registry["Provider registry<br/>[providers.php]"]
  node_user_model[("User model<br/>[User.php]")]
  node_user_factory["User factory<br/>[UserFactory.php]"]
end

node_resident(("Household user"))
node_api_request(("API caller"))

node_resident -.->|"uses tabs"| node_tab_nav
node_resident -.->|"sends request"| node_http_entry
node_home_demo -.->|"may present"| node_scene_screen
node_scene_screen -->|"renders"| node_app_text
node_scene_view -->|"reads sizing"| node_scene_context
node_lamp -->|"uses object"| node_scene_object
node_tab_bar -->|"renders"| node_app_text
node_theme_provider -->|"uses tokens"| node_theme_tokens
node_http_entry -->|"bootstraps"| node_laravel_boot
node_laravel_boot -->|"registers routes"| node_api_routes
node_api_routes -->|"routes to"| node_health_controller
node_health_controller -->|"extends"| node_base_controller
node_health_controller -->|"returns"| node_health_resource
node_provider_registry -->|"registers"| node_service_provider
node_user_factory -->|"creates"| node_user_model

click node_mobile_root "https://github.com/hackieron/bahai/blob/main/mobile/src/app/_layout.tsx"
click node_tab_nav "https://github.com/hackieron/bahai/blob/main/mobile/src/app/(tabs)/_layout.tsx"
click node_home_tab "https://github.com/hackieron/bahai/blob/main/mobile/src/app/(tabs)/index.tsx"
click node_bills "https://github.com/hackieron/bahai/blob/main/mobile/src/app/(tabs)/bills.tsx"
click node_chores "https://github.com/hackieron/bahai/blob/main/mobile/src/app/(tabs)/chores.tsx"
click node_groceries "https://github.com/hackieron/bahai/blob/main/mobile/src/app/(tabs)/groceries.tsx"
click node_home_demo "https://github.com/hackieron/bahai/blob/main/mobile/src/features/home/HomeDemo.tsx"
click node_query "https://github.com/hackieron/bahai/blob/main/mobile/src/lib/query.ts"
click node_secure_store "https://github.com/hackieron/bahai/blob/main/mobile/src/lib/secure-store.ts"
click node_scene_screen "https://github.com/hackieron/bahai/blob/main/mobile/src/components/SceneScreen.tsx"
click node_scene_view "https://github.com/hackieron/bahai/blob/main/mobile/src/scene/Scene.tsx"
click node_scene_context "https://github.com/hackieron/bahai/blob/main/mobile/src/scene/SceneContext.ts"
click node_scene_object "https://github.com/hackieron/bahai/blob/main/mobile/src/scene/SceneObject.tsx"
click node_lamp "https://github.com/hackieron/bahai/blob/main/mobile/src/scene/objects/Lamp.tsx"
click node_app_text "https://github.com/hackieron/bahai/blob/main/mobile/src/components/AppText.tsx"
click node_tab_bar "https://github.com/hackieron/bahai/blob/main/mobile/src/components/TabBar.tsx"
click node_theme_provider "https://github.com/hackieron/bahai/blob/main/mobile/src/theme/ThemeProvider.tsx"
click node_theme_tokens "https://github.com/hackieron/bahai/blob/main/mobile/src/theme/tokens.ts"
click node_http_entry "https://github.com/hackieron/bahai/blob/main/api/public/index.php"
click node_laravel_boot "https://github.com/hackieron/bahai/blob/main/api/bootstrap/app.php"
click node_api_routes "https://github.com/hackieron/bahai/blob/main/api/routes/api.php"
click node_health_controller "https://github.com/hackieron/bahai/blob/main/api/app/Http/Controllers/Api/V1/HealthController.php"
click node_base_controller "https://github.com/hackieron/bahai/blob/main/api/app/Http/Controllers/Controller.php"
click node_health_resource "https://github.com/hackieron/bahai/blob/main/api/app/Http/Resources/HealthResource.php"
click node_service_provider "https://github.com/hackieron/bahai/blob/main/api/app/Providers/AppServiceProvider.php"
click node_provider_registry "https://github.com/hackieron/bahai/blob/main/api/bootstrap/providers.php"
click node_user_model "https://github.com/hackieron/bahai/blob/main/api/app/Models/User.php"
click node_user_factory "https://github.com/hackieron/bahai/blob/main/api/database/factories/UserFactory.php"

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_mobile_root,node_tab_nav,node_home_tab,node_bills,node_chores,node_groceries,node_home_demo,node_query,node_secure_store,node_resident toneBlue
class node_scene_screen,node_scene_view,node_scene_context,node_scene_object,node_lamp toneAmber
class node_app_text,node_tab_bar,node_theme_provider,node_theme_tokens,node_api_request toneMint
class node_http_entry,node_laravel_boot,node_api_routes,node_health_controller,node_base_controller,node_health_resource,node_service_provider,node_provider_registry,node_user_model,node_user_factory toneRose
```

## Components

### Mobile app

- [App shell](https://github.com/hackieron/bahai/blob/main/mobile/src/app/_layout.tsx): `mobile/src/app/_layout.tsx`
- [Tab navigation](https://github.com/hackieron/bahai/blob/main/mobile/src/app/(tabs)/_layout.tsx): `mobile/src/app/(tabs)/_layout.tsx`
- [Home screen](https://github.com/hackieron/bahai/blob/main/mobile/src/app/(tabs)/index.tsx): `mobile/src/app/(tabs)/index.tsx`
- [Bills screen](https://github.com/hackieron/bahai/blob/main/mobile/src/app/(tabs)/bills.tsx): `mobile/src/app/(tabs)/bills.tsx`
- [Chores screen](https://github.com/hackieron/bahai/blob/main/mobile/src/app/(tabs)/chores.tsx): `mobile/src/app/(tabs)/chores.tsx`
- [Groceries screen](https://github.com/hackieron/bahai/blob/main/mobile/src/app/(tabs)/groceries.tsx): `mobile/src/app/(tabs)/groceries.tsx`
- [Home demo](https://github.com/hackieron/bahai/blob/main/mobile/src/features/home/HomeDemo.tsx): `mobile/src/features/home/HomeDemo.tsx`
- [Query helper](https://github.com/hackieron/bahai/blob/main/mobile/src/lib/query.ts): `mobile/src/lib/query.ts`
- [Secure storage](https://github.com/hackieron/bahai/blob/main/mobile/src/lib/secure-store.ts): `mobile/src/lib/secure-store.ts`

### Scene interface

- [Scene screen](https://github.com/hackieron/bahai/blob/main/mobile/src/components/SceneScreen.tsx): `mobile/src/components/SceneScreen.tsx`
- [Scene renderer](https://github.com/hackieron/bahai/blob/main/mobile/src/scene/Scene.tsx): `mobile/src/scene/Scene.tsx`
- [Scene sizing context](https://github.com/hackieron/bahai/blob/main/mobile/src/scene/SceneContext.ts): `mobile/src/scene/SceneContext.ts`
- [Scene object](https://github.com/hackieron/bahai/blob/main/mobile/src/scene/SceneObject.tsx): `mobile/src/scene/SceneObject.tsx`
- [Lamp object](https://github.com/hackieron/bahai/blob/main/mobile/src/scene/objects/Lamp.tsx): `mobile/src/scene/objects/Lamp.tsx`

### Shared styling

- [App text](https://github.com/hackieron/bahai/blob/main/mobile/src/components/AppText.tsx): `mobile/src/components/AppText.tsx`
- [Custom tab bar](https://github.com/hackieron/bahai/blob/main/mobile/src/components/TabBar.tsx): `mobile/src/components/TabBar.tsx`
- [Theme provider](https://github.com/hackieron/bahai/blob/main/mobile/src/theme/ThemeProvider.tsx): `mobile/src/theme/ThemeProvider.tsx`
- [Theme tokens](https://github.com/hackieron/bahai/blob/main/mobile/src/theme/tokens.ts): `mobile/src/theme/tokens.ts`

### Laravel API

- [HTTP entry](https://github.com/hackieron/bahai/blob/main/api/public/index.php): `api/public/index.php`
- [Laravel bootstrap](https://github.com/hackieron/bahai/blob/main/api/bootstrap/app.php): `api/bootstrap/app.php`
- [API routes](https://github.com/hackieron/bahai/blob/main/api/routes/api.php): `api/routes/api.php`
- [Health endpoint](https://github.com/hackieron/bahai/blob/main/api/app/Http/Controllers/Api/V1/HealthController.php): `api/app/Http/Controllers/Api/V1/HealthController.php`
- [Base controller](https://github.com/hackieron/bahai/blob/main/api/app/Http/Controllers/Controller.php): `api/app/Http/Controllers/Controller.php`
- [Health response](https://github.com/hackieron/bahai/blob/main/api/app/Http/Resources/HealthResource.php): `api/app/Http/Resources/HealthResource.php`
- [Rate limiting](https://github.com/hackieron/bahai/blob/main/api/app/Providers/AppServiceProvider.php): `api/app/Providers/AppServiceProvider.php`
- [Provider registry](https://github.com/hackieron/bahai/blob/main/api/bootstrap/providers.php): `api/bootstrap/providers.php`
- [User model](https://github.com/hackieron/bahai/blob/main/api/app/Models/User.php): `api/app/Models/User.php`
- [User factory](https://github.com/hackieron/bahai/blob/main/api/database/factories/UserFactory.php): `api/database/factories/UserFactory.php`

### Other components

- **Household user**
- **API caller**

## Connections

- Household user → Tab navigation: uses tabs
- Household user → HTTP entry: sends request
- Home demo → Scene screen: may present
- Scene screen → App text: renders (evidence: `mobile/src/components/SceneScreen.tsx`)
- Scene renderer → Scene sizing context: reads sizing (evidence: `mobile/src/scene/Scene.tsx`)
- Lamp object → Scene object: uses object (evidence: `mobile/src/scene/objects/Lamp.tsx`)
- Custom tab bar → App text: renders (evidence: `mobile/src/components/TabBar.tsx`)
- Theme provider → Theme tokens: uses tokens (evidence: `mobile/src/theme/ThemeProvider.tsx`)
- HTTP entry → Laravel bootstrap: bootstraps (evidence: `api/public/index.php`)
- Laravel bootstrap → API routes: registers routes (evidence: `api/bootstrap/app.php`)
- API routes → Health endpoint: routes to (evidence: `api/routes/api.php`)
- Health endpoint → Base controller: extends (evidence: `api/app/Http/Controllers/Api/V1/HealthController.php`)
- Health endpoint → Health response: returns (evidence: `api/app/Http/Controllers/Api/V1/HealthController.php`)
- Provider registry → Rate limiting: registers (evidence: `api/bootstrap/providers.php`)
- User factory → User model: creates (evidence: `api/database/factories/UserFactory.php`)
