# samkwibe/family-housing-hub architecture

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

- Interactive diagram: https://gitdiagram.com/samkwibe/family-housing-hub
- Repository: https://github.com/samkwibe/family-housing-hub

## Overview

Family Housing Hub combines React web and Expo mobile clients with a Python API and Firebase functions. The web workflow authenticates a household member, routes them to a role-appropriate dashboard, and exposes housing and family-management features backed by client data services. Backend household routes and services provide household-scoped operations, with additional automation and background-task capabilities. The README establishes the separate runtimes; source-index references and excerpts support only selected internal links, so unsampled integrations are not connected speculatively.

Main entry points: [`src/components/DashboardRouter.jsx`](https://github.com/samkwibe/family-housing-hub/blob/main/src/components/DashboardRouter.jsx) (Role dashboard routing), [`src/contexts/AuthContext.jsx`](https://github.com/samkwibe/family-housing-hub/blob/main/src/contexts/AuthContext.jsx) (Web authentication), [`src/App.jsx`](https://github.com/samkwibe/family-housing-hub/blob/main/src/App.jsx) (Web application), [`src/services/firebaseService.js`](https://github.com/samkwibe/family-housing-hub/blob/main/src/services/firebaseService.js) (Firebase data service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["Web application<br/>[App.jsx]"]
  node_routing["Route mapping<br/>[index.jsx]"]
  node_dashboard_route["Role dashboard routing"]
  node_web_layout["Navigation layout<br/>[Layout.jsx]"]
  node_theme_context["Theme context<br/>[ThemeContext.jsx]"]
end

subgraph group_identity["Identity and household"]
  node_auth["Web authentication<br/>[AuthContext.jsx]"]
  node_firebase_config["Firebase configuration<br/>[config.js]"]
  node_firebase_data["Firebase data service<br/>[firebaseService.js]"]
  node_user_data["User data service<br/>[userDataService.js]"]
  node_family_context["Family context<br/>[FamilyContext.jsx]"]
end

subgraph group_domain["Family and housing"]
  node_renter_dashboard["Renter dashboard<br/>[Dashboard.jsx]"]
  node_owner_dashboard["Owner dashboard<br/>[OwnerDashboard.jsx]"]
  node_child_dashboard["Child dashboard<br/>[ChildDashboard.jsx]"]
  node_rent["Rent and housing search<br/>[Rent.jsx]"]
  node_messages["Family messaging<br/>[Messages.jsx]"]
  node_profile["Profile management<br/>[Profile.jsx]"]
end

subgraph group_backend["Python services"]
  node_backend_routes["Household API routes"]
  node_household_service["Household membership"]
  node_database[("Database access<br/>[database.py]")]
  node_automation["Household automations"]
  node_tasks["Background tasks<br/>[tasks.py]"]
end

subgraph group_platform["Mobile and cloud"]
  node_mobile_app["Expo mobile client<br/>[index.tsx]"]
  node_firebase_functions["Firebase functions<br/>[index.js]"]
end

node_member(("Household member"))

node_member -->|"uses"| node_webapp
node_webapp -->|"routes through"| node_routing
node_routing -->|"routes to"| node_renter_dashboard
node_webapp -->|"renders dashboard routing"| node_dashboard_route
node_dashboard_route -->|"reads user state"| node_auth
node_dashboard_route -->|"loads user data"| node_user_data
node_dashboard_route -->|"renders owner view"| node_owner_dashboard
node_dashboard_route -->|"renders child view"| node_child_dashboard
node_webapp -->|"wraps protected pages"| node_web_layout
node_auth -->|"uses Firebase auth"| node_firebase_config
node_auth -->|"uses data service"| node_firebase_data
node_firebase_data -->|"uses Firebase setup"| node_firebase_config
node_renter_dashboard -->|"reads household context"| node_family_context
node_renter_dashboard -->|"loads user data"| node_user_data
node_owner_dashboard -->|"loads owner data"| node_user_data
node_child_dashboard -->|"reads family records"| node_firebase_data
node_rent -->|"reads signed-in user"| node_auth
node_messages -->|"uses family data service"| node_firebase_data
node_messages -->|"uses Firebase setup"| node_firebase_config
node_profile -.->|"uses account context"| node_auth
node_backend_routes -->|"delegates household operations"| node_household_service
node_household_service -->|"accesses database"| node_database
node_household_service -->|"queues work"| node_tasks
node_backend_routes -->|"invokes automation"| node_automation
node_mobile_app -.->|"uses Python API"| node_backend_routes

click node_webapp "https://github.com/samkwibe/family-housing-hub/blob/main/src/App.jsx"
click node_routing "https://github.com/samkwibe/family-housing-hub/blob/main/src/router/index.jsx"
click node_dashboard_route "https://github.com/samkwibe/family-housing-hub/blob/main/src/components/DashboardRouter.jsx"
click node_web_layout "https://github.com/samkwibe/family-housing-hub/blob/main/src/components/Layout.jsx"
click node_auth "https://github.com/samkwibe/family-housing-hub/blob/main/src/contexts/AuthContext.jsx"
click node_firebase_config "https://github.com/samkwibe/family-housing-hub/blob/main/src/firebase/config.js"
click node_firebase_data "https://github.com/samkwibe/family-housing-hub/blob/main/src/services/firebaseService.js"
click node_user_data "https://github.com/samkwibe/family-housing-hub/blob/main/src/services/userDataService.js"
click node_family_context "https://github.com/samkwibe/family-housing-hub/blob/main/src/contexts/FamilyContext.jsx"
click node_theme_context "https://github.com/samkwibe/family-housing-hub/blob/main/src/contexts/ThemeContext.jsx"
click node_renter_dashboard "https://github.com/samkwibe/family-housing-hub/blob/main/src/pages/Dashboard.jsx"
click node_owner_dashboard "https://github.com/samkwibe/family-housing-hub/blob/main/src/pages/OwnerDashboard.jsx"
click node_child_dashboard "https://github.com/samkwibe/family-housing-hub/blob/main/src/pages/ChildDashboard.jsx"
click node_rent "https://github.com/samkwibe/family-housing-hub/blob/main/src/pages/Rent.jsx"
click node_messages "https://github.com/samkwibe/family-housing-hub/blob/main/src/pages/Messages.jsx"
click node_profile "https://github.com/samkwibe/family-housing-hub/blob/main/src/pages/Profile.jsx"
click node_backend_routes "https://github.com/samkwibe/family-housing-hub/blob/main/backend/household_routes.py"
click node_household_service "https://github.com/samkwibe/family-housing-hub/blob/main/backend/household_service.py"
click node_database "https://github.com/samkwibe/family-housing-hub/blob/main/backend/database.py"
click node_automation "https://github.com/samkwibe/family-housing-hub/blob/main/backend/automation_engine.py"
click node_tasks "https://github.com/samkwibe/family-housing-hub/blob/main/backend/tasks.py"
click node_mobile_app "https://github.com/samkwibe/family-housing-hub/blob/main/mobile/app/index.tsx"
click node_firebase_functions "https://github.com/samkwibe/family-housing-hub/blob/main/functions/index.js"

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_webapp,node_routing,node_dashboard_route,node_web_layout,node_theme_context toneBlue
class node_auth,node_firebase_config,node_firebase_data,node_user_data,node_family_context toneAmber
class node_renter_dashboard,node_owner_dashboard,node_child_dashboard,node_rent,node_messages,node_profile toneMint
class node_backend_routes,node_household_service,node_database,node_automation,node_tasks toneRose
class node_mobile_app,node_firebase_functions,node_member toneIndigo
```

## Components

### Web experience

- [Web application](https://github.com/samkwibe/family-housing-hub/blob/main/src/App.jsx): `src/App.jsx`
- [Route mapping](https://github.com/samkwibe/family-housing-hub/blob/main/src/router/index.jsx): `src/router/index.jsx`
- [Role dashboard routing](https://github.com/samkwibe/family-housing-hub/blob/main/src/components/DashboardRouter.jsx): `src/components/DashboardRouter.jsx`
- [Navigation layout](https://github.com/samkwibe/family-housing-hub/blob/main/src/components/Layout.jsx): `src/components/Layout.jsx`
- [Theme context](https://github.com/samkwibe/family-housing-hub/blob/main/src/contexts/ThemeContext.jsx): `src/contexts/ThemeContext.jsx`

### Identity and household

- [Web authentication](https://github.com/samkwibe/family-housing-hub/blob/main/src/contexts/AuthContext.jsx): `src/contexts/AuthContext.jsx`
- [Firebase configuration](https://github.com/samkwibe/family-housing-hub/blob/main/src/firebase/config.js): `src/firebase/config.js`
- [Firebase data service](https://github.com/samkwibe/family-housing-hub/blob/main/src/services/firebaseService.js): `src/services/firebaseService.js`
- [User data service](https://github.com/samkwibe/family-housing-hub/blob/main/src/services/userDataService.js): `src/services/userDataService.js`
- [Family context](https://github.com/samkwibe/family-housing-hub/blob/main/src/contexts/FamilyContext.jsx): `src/contexts/FamilyContext.jsx`

### Family and housing

- [Renter dashboard](https://github.com/samkwibe/family-housing-hub/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Owner dashboard](https://github.com/samkwibe/family-housing-hub/blob/main/src/pages/OwnerDashboard.jsx): `src/pages/OwnerDashboard.jsx`
- [Child dashboard](https://github.com/samkwibe/family-housing-hub/blob/main/src/pages/ChildDashboard.jsx): `src/pages/ChildDashboard.jsx`
- [Rent and housing search](https://github.com/samkwibe/family-housing-hub/blob/main/src/pages/Rent.jsx): `src/pages/Rent.jsx`
- [Family messaging](https://github.com/samkwibe/family-housing-hub/blob/main/src/pages/Messages.jsx): `src/pages/Messages.jsx`
- [Profile management](https://github.com/samkwibe/family-housing-hub/blob/main/src/pages/Profile.jsx): `src/pages/Profile.jsx`

### Python services

- [Household API routes](https://github.com/samkwibe/family-housing-hub/blob/main/backend/household_routes.py): `backend/household_routes.py`
- [Household membership](https://github.com/samkwibe/family-housing-hub/blob/main/backend/household_service.py): `backend/household_service.py`
- [Database access](https://github.com/samkwibe/family-housing-hub/blob/main/backend/database.py): `backend/database.py`
- [Household automations](https://github.com/samkwibe/family-housing-hub/blob/main/backend/automation_engine.py): `backend/automation_engine.py`
- [Background tasks](https://github.com/samkwibe/family-housing-hub/blob/main/backend/tasks.py): `backend/tasks.py`

### Mobile and cloud

- [Expo mobile client](https://github.com/samkwibe/family-housing-hub/blob/main/mobile/app/index.tsx): `mobile/app/index.tsx`
- [Firebase functions](https://github.com/samkwibe/family-housing-hub/blob/main/functions/index.js): `functions/index.js`

### Other components

- **Household member**

## Connections

- Household member → Web application: uses (evidence: `README.md`)
- Web application → Route mapping: routes through (evidence: `src/App.jsx`)
- Route mapping → Renter dashboard: routes to (evidence: `src/router/index.jsx`)
- Web application → Role dashboard routing: renders dashboard routing (evidence: `src/App.jsx`)
- Role dashboard routing → Web authentication: reads user state (evidence: `src/components/DashboardRouter.jsx`)
- Role dashboard routing → User data service: loads user data (evidence: `src/components/DashboardRouter.jsx`)
- Role dashboard routing → Owner dashboard: renders owner view (evidence: `src/components/DashboardRouter.jsx`)
- Role dashboard routing → Child dashboard: renders child view (evidence: `src/components/DashboardRouter.jsx`)
- Web application → Navigation layout: wraps protected pages (evidence: `src/App.jsx`)
- Web authentication → Firebase configuration: uses Firebase auth (evidence: `src/contexts/AuthContext.jsx`)
- Web authentication → Firebase data service: uses data service (evidence: `src/contexts/AuthContext.jsx`)
- Firebase data service → Firebase configuration: uses Firebase setup (evidence: `src/services/firebaseService.js`)
- Renter dashboard → Family context: reads household context (evidence: `src/pages/Dashboard.jsx`)
- Renter dashboard → User data service: loads user data (evidence: `src/pages/Dashboard.jsx`)
- Owner dashboard → User data service: loads owner data (evidence: `src/pages/OwnerDashboard.jsx`)
- Child dashboard → Firebase data service: reads family records (evidence: `src/pages/ChildDashboard.jsx`)
- Rent and housing search → Web authentication: reads signed-in user
- Family messaging → Firebase data service: uses family data service (evidence: `src/pages/Messages.jsx`)
- Family messaging → Firebase configuration: uses Firebase setup (evidence: `src/pages/Messages.jsx`)
- Profile management → Web authentication: uses account context
- Household API routes → Household membership: delegates household operations (evidence: `backend/household_routes.py`)
- Household membership → Database access: accesses database (evidence: `backend/household_service.py`)
- Household membership → Background tasks: queues work (evidence: `backend/household_service.py`)
- Household API routes → Household automations: invokes automation (evidence: `backend/household_routes.py`)
- Expo mobile client → Household API routes: uses Python API
