# sysadminsmedia/homebox architecture

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

- Interactive diagram: https://gitdiagram.com/sysadminsmedia/homebox
- Repository: https://github.com/sysadminsmedia/homebox

## Overview

HomeBox is a self-hosted home-inventory application: users organize items, locations, tags, custom fields, attachments and maintenance, then find, report on, or export that inventory. The documented workflow enters through the web UI and versioned API, where services and repositories operate on persistent data; search and label generation support discovery and physical organization. The tree and excerpts establish routing, service wiring, generated database querying, search, export, and label generation. Other documented capabilities are represented at subsystem level because their handlers were not sampled.

Main entry points: [`backend/app/api/handlers/v1/controller.go`](https://github.com/sysadminsmedia/homebox/blob/main/backend/app/api/handlers/v1/controller.go) (V1 handlers), [`backend/internal/core/services`](https://github.com/sysadminsmedia/homebox/tree/main/backend/internal/core/services) (Domain services), [`frontend/lib/api/classes/items.ts`](https://github.com/sysadminsmedia/homebox/blob/main/frontend/lib/api/classes/items.ts) (API client), [`backend/app/api/routes.go`](https://github.com/sysadminsmedia/homebox/blob/main/backend/app/api/routes.go) (HTTP router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_ui["Inventory UI<br/>[index.vue]"]
  node_searchui["Search UI<br/>[search.vue]"]
  node_clientapi["API client<br/>[items.ts]"]
end

subgraph group_api["API and domain"]
  node_router["HTTP router<br/>[routes.go]"]
  node_controller["V1 handlers<br/>[controller.go]"]
  node_services["Domain services"]
  node_auth["Authentication"]
end

subgraph group_data["Persistence and search"]
  node_repo["Repositories"]
  node_ent[("Ent database client<br/>[client.go]")]
  node_search["Database search<br/>[database.go]"]
  node_sqlite[("SQLite database")]
end

subgraph group_features["Inventory capabilities"]
  node_inventory["Inventory organization"]
  node_attachments["Files and attachments"]
  node_maintenance["Maintenance tracking"]
  node_reporting["Reports and imports"]
  node_exports["Data export<br/>[service_exports.go]"]
  node_labels["Label generation<br/>[labelmaker.go]"]
end

subgraph group_ops["Runtime"]
  node_runtime["API server<br/>[main.go]"]
end

node_person(("Home user"))
node_external(("OIDC provider"))

node_person -->|"uses"| node_ui
node_ui -.->|"requests"| node_clientapi
node_searchui -.->|"searches"| node_clientapi
node_clientapi -.->|"calls API"| node_router
node_runtime -->|"serves"| node_router
node_router -->|"routes to"| node_controller
node_controller -->|"invokes"| node_services
node_controller -->|"configures auth"| node_auth
node_auth -.->|"authenticates with"| node_external
node_services -->|"uses"| node_repo
node_repo -.->|"queries"| node_ent
node_ent -.->|"persists"| node_sqlite
node_search -->|"queries entities"| node_ent
node_controller -.->|"searches"| node_search
node_controller -.->|"handles inventory"| node_inventory
node_controller -.->|"handles uploads"| node_attachments
node_controller -->|"handles schedules"| node_maintenance
node_services -.->|"processes reports"| node_reporting
node_controller -.->|"starts exports"| node_exports
node_services -->|"runs jobs"| node_exports
node_controller -.->|"generates labels"| node_labels

click node_ui "https://github.com/sysadminsmedia/homebox/blob/main/frontend/pages/item/%5Bid%5D/index.vue"
click node_searchui "https://github.com/sysadminsmedia/homebox/blob/main/frontend/pages/search.vue"
click node_clientapi "https://github.com/sysadminsmedia/homebox/blob/main/frontend/lib/api/classes/items.ts"
click node_router "https://github.com/sysadminsmedia/homebox/blob/main/backend/app/api/routes.go"
click node_controller "https://github.com/sysadminsmedia/homebox/blob/main/backend/app/api/handlers/v1/controller.go"
click node_services "https://github.com/sysadminsmedia/homebox/tree/main/backend/internal/core/services"
click node_repo "https://github.com/sysadminsmedia/homebox/tree/main/backend/internal/data/repo"
click node_ent "https://github.com/sysadminsmedia/homebox/blob/main/backend/internal/data/ent/client.go"
click node_search "https://github.com/sysadminsmedia/homebox/blob/main/backend/internal/data/search/database.go"
click node_inventory "https://github.com/sysadminsmedia/homebox/blob/main/backend/app/api/handlers/v1/v1_ctrl_entities.go"
click node_attachments "https://github.com/sysadminsmedia/homebox/blob/main/backend/app/api/handlers/v1/v1_ctrl_entities_attachments.go"
click node_maintenance "https://github.com/sysadminsmedia/homebox/blob/main/backend/app/api/handlers/v1/v1_ctrl_maintenance.go"
click node_reporting "https://github.com/sysadminsmedia/homebox/tree/main/backend/internal/core/services/reporting"
click node_exports "https://github.com/sysadminsmedia/homebox/blob/main/backend/internal/core/services/service_exports.go"
click node_labels "https://github.com/sysadminsmedia/homebox/blob/main/backend/pkgs/labelmaker/labelmaker.go"
click node_auth "https://github.com/sysadminsmedia/homebox/tree/main/backend/app/api/providers"
click node_runtime "https://github.com/sysadminsmedia/homebox/blob/main/backend/app/api/main.go"

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_ui,node_searchui,node_clientapi,node_person toneBlue
class node_router,node_controller,node_services,node_auth toneAmber
class node_repo,node_ent,node_search,node_sqlite toneMint
class node_inventory,node_attachments,node_maintenance,node_reporting,node_exports,node_labels toneRose
class node_runtime,node_external toneIndigo
```

## Components

### Web experience

- [Inventory UI](https://github.com/sysadminsmedia/homebox/blob/main/frontend/pages/item/%5Bid%5D/index.vue): `frontend/pages/item/[id]/index.vue`
- [Search UI](https://github.com/sysadminsmedia/homebox/blob/main/frontend/pages/search.vue): `frontend/pages/search.vue`
- [API client](https://github.com/sysadminsmedia/homebox/blob/main/frontend/lib/api/classes/items.ts): `frontend/lib/api/classes/items.ts`

### API and domain

- [HTTP router](https://github.com/sysadminsmedia/homebox/blob/main/backend/app/api/routes.go): `backend/app/api/routes.go`
- [V1 handlers](https://github.com/sysadminsmedia/homebox/blob/main/backend/app/api/handlers/v1/controller.go): `backend/app/api/handlers/v1/controller.go`
- [Domain services](https://github.com/sysadminsmedia/homebox/tree/main/backend/internal/core/services): `backend/internal/core/services`
- [Authentication](https://github.com/sysadminsmedia/homebox/tree/main/backend/app/api/providers): `backend/app/api/providers`

### Persistence and search

- [Repositories](https://github.com/sysadminsmedia/homebox/tree/main/backend/internal/data/repo): `backend/internal/data/repo`
- [Ent database client](https://github.com/sysadminsmedia/homebox/blob/main/backend/internal/data/ent/client.go): `backend/internal/data/ent/client.go`
- [Database search](https://github.com/sysadminsmedia/homebox/blob/main/backend/internal/data/search/database.go): `backend/internal/data/search/database.go`
- **SQLite database**

### Inventory capabilities

- [Inventory organization](https://github.com/sysadminsmedia/homebox/blob/main/backend/app/api/handlers/v1/v1_ctrl_entities.go): `backend/app/api/handlers/v1/v1_ctrl_entities.go`
- [Files and attachments](https://github.com/sysadminsmedia/homebox/blob/main/backend/app/api/handlers/v1/v1_ctrl_entities_attachments.go): `backend/app/api/handlers/v1/v1_ctrl_entities_attachments.go`
- [Maintenance tracking](https://github.com/sysadminsmedia/homebox/blob/main/backend/app/api/handlers/v1/v1_ctrl_maintenance.go): `backend/app/api/handlers/v1/v1_ctrl_maintenance.go`
- [Reports and imports](https://github.com/sysadminsmedia/homebox/tree/main/backend/internal/core/services/reporting): `backend/internal/core/services/reporting`
- [Data export](https://github.com/sysadminsmedia/homebox/blob/main/backend/internal/core/services/service_exports.go): `backend/internal/core/services/service_exports.go`
- [Label generation](https://github.com/sysadminsmedia/homebox/blob/main/backend/pkgs/labelmaker/labelmaker.go): `backend/pkgs/labelmaker/labelmaker.go`

### Runtime

- [API server](https://github.com/sysadminsmedia/homebox/blob/main/backend/app/api/main.go): `backend/app/api/main.go`

### Other components

- **Home user**
- **OIDC provider**

## Connections

- Home user → Inventory UI: uses
- Inventory UI → API client: requests
- Search UI → API client: searches
- API client → HTTP router: calls API
- API server → HTTP router: serves (evidence: `backend/app/api/main.go`)
- HTTP router → V1 handlers: routes to (evidence: `backend/app/api/routes.go`)
- V1 handlers → Domain services: invokes (evidence: `backend/app/api/handlers/v1/controller.go`)
- V1 handlers → Authentication: configures auth (evidence: `backend/app/api/handlers/v1/controller.go`)
- Authentication → OIDC provider: authenticates with
- Domain services → Repositories: uses (evidence: `backend/internal/core/services/service_exports.go`)
- Repositories → Ent database client: queries
- Ent database client → SQLite database: persists
- Database search → Ent database client: queries entities (evidence: `backend/internal/data/search/database.go`)
- V1 handlers → Database search: searches
- V1 handlers → Inventory organization: handles inventory
- V1 handlers → Files and attachments: handles uploads
- V1 handlers → Maintenance tracking: handles schedules
- Domain services → Reports and imports: processes reports (evidence: `backend/internal/core/services/service_exports.go`)
- V1 handlers → Data export: starts exports
- Domain services → Data export: runs jobs (evidence: `backend/internal/core/services/service_exports.go`)
- V1 handlers → Label generation: generates labels
