# openbmc/bmcweb architecture

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

- Interactive diagram: https://gitdiagram.com/openbmc/bmcweb
- Repository: https://github.com/openbmc/bmcweb

## Overview

bmcweb is an embedded OpenBMC web server exposing Redfish and several device-specific interfaces. A client request enters the HTTP application and router, is handled by an interface or Redfish route, and returns an HTTP response; Redfish handlers translate between API resources and DBus-backed system state. The README documents authentication, event delivery, KVM, serial console, virtual media, aggregation, and protocol support. Some implementation wiring is unsampled, so edges are limited to README statements and source-index references.

Main entry points: [`http/routing.hpp`](https://github.com/openbmc/bmcweb/blob/master/http/routing.hpp) (Route dispatch), [`redfish-core/include/query.hpp`](https://github.com/openbmc/bmcweb/blob/master/redfish-core/include/query.hpp) (Redfish query handling), [`http/app.hpp`](https://github.com/openbmc/bmcweb/blob/master/http/app.hpp) (HTTP application), [`redfish-core/lib`](https://github.com/openbmc/bmcweb/tree/master/redfish-core/lib) (Redfish resources)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP server"]
  node_app["HTTP application<br/>[app.hpp]"]
  node_router["Route dispatch<br/>[routing.hpp]"]
  node_request["HTTP request<br/>[http_request.hpp]"]
  node_response["HTTP response<br/>[http_response.hpp]"]
  node_httpbody["HTTP body<br/>[http_body.hpp]"]
  node_tls["TLS and HTTP/2<br/>[mutual_tls.cpp]"]
end

subgraph group_security["Identity and security"]
  node_auth["Authentication<br/>[authentication.hpp]"]
  node_sessions[("Sessions and persistence")]
  node_login["Web UI login<br/>[login_routes.hpp]"]
  node_pam["PAM"]
end

subgraph group_redfish["Redfish API"]
  node_redfish_routes["Redfish resources"]
  node_redfish_query["Redfish query handling<br/>[query.hpp]"]
  node_query_params["Query parameters<br/>[query_param.hpp]"]
  node_redfish_messages["Redfish messages<br/>[error_messages.hpp]"]
  node_aggregation["Resource aggregation"]
  node_event_service["Event subscriptions"]
end

subgraph group_device["Device interfaces"]
  node_dbus_rest["OpenBMC DBus REST"]
  node_dbus_events["DBus event websocket<br/>[dbus_monitor.hpp]"]
  node_serial["Serial console<br/>[obmc_console.hpp]"]
  node_kvm["KVM websocket<br/>[kvm_websocket.hpp]"]
  node_virtual_media["Virtual media<br/>[vm_websocket.hpp]"]
end

subgraph group_state["System state"]
  node_dbus["DBus access<br/>[dbus_utility.hpp]"]
  node_system_bus[("System DBus")]
  node_event_store[("Event service store")]
end

node_client(("API client"))

node_client -->|"sends request"| node_app
node_app -->|"dispatches"| node_router
node_router -->|"routes request"| node_request
node_request -.->|"produces response"| node_response
node_app -.->|"serves HTTP&#40;S&#41;"| node_tls
node_router -->|"routes login"| node_login
node_login -->|"creates session"| node_sessions
node_auth -->|"authenticates credentials"| node_pam
node_router -.->|"dispatches Redfish"| node_redfish_routes
node_redfish_routes -.->|"reads system state"| node_dbus
node_redfish_routes -->|"uses query handling"| node_redfish_query
node_redfish_query -->|"parses parameters"| node_query_params
node_query_params -->|"formats errors"| node_redfish_messages
node_redfish_query -->|"forwards remote requests"| node_aggregation
node_redfish_query -.->|"fills response"| node_response
node_dbus -->|"calls methods"| node_system_bus
node_router -->|"routes DBus REST"| node_dbus_rest
node_router -.->|"routes event websocket"| node_dbus_events
node_router -->|"routes console websocket"| node_serial
node_router -.->|"routes KVM websocket"| node_kvm
node_router -->|"routes virtual media"| node_virtual_media
node_event_service -->|"uses persistent store"| node_event_store
node_event_service -->|"sends event stream"| node_response

click node_app "https://github.com/openbmc/bmcweb/blob/master/http/app.hpp"
click node_router "https://github.com/openbmc/bmcweb/blob/master/http/routing.hpp"
click node_request "https://github.com/openbmc/bmcweb/blob/master/http/http_request.hpp"
click node_response "https://github.com/openbmc/bmcweb/blob/master/http/http_response.hpp"
click node_httpbody "https://github.com/openbmc/bmcweb/blob/master/http/http_body.hpp"
click node_auth "https://github.com/openbmc/bmcweb/blob/master/include/authentication.hpp"
click node_sessions "https://github.com/openbmc/bmcweb/blob/master/include/persistent_data.hpp"
click node_login "https://github.com/openbmc/bmcweb/blob/master/features/webui_login/login_routes.hpp"
click node_redfish_routes "https://github.com/openbmc/bmcweb/tree/master/redfish-core/lib"
click node_redfish_query "https://github.com/openbmc/bmcweb/blob/master/redfish-core/include/query.hpp"
click node_query_params "https://github.com/openbmc/bmcweb/blob/master/redfish-core/include/utils/query_param.hpp"
click node_redfish_messages "https://github.com/openbmc/bmcweb/blob/master/redfish-core/include/error_messages.hpp"
click node_aggregation "https://github.com/openbmc/bmcweb/blob/master/redfish-core/include/redfish_aggregator.hpp"
click node_event_service "https://github.com/openbmc/bmcweb/blob/master/redfish-core/include/event_service_manager.hpp"
click node_dbus_rest "https://github.com/openbmc/bmcweb/blob/master/features/openbmc_rest/openbmc_dbus_rest.hpp"
click node_dbus_events "https://github.com/openbmc/bmcweb/blob/master/features/openbmc_rest/dbus_monitor.hpp"
click node_serial "https://github.com/openbmc/bmcweb/blob/master/features/serial/obmc_console.hpp"
click node_kvm "https://github.com/openbmc/bmcweb/blob/master/features/kvm/kvm_websocket.hpp"
click node_virtual_media "https://github.com/openbmc/bmcweb/blob/master/features/virtual_media/vm_websocket.hpp"
click node_dbus "https://github.com/openbmc/bmcweb/blob/master/include/dbus_utility.hpp"
click node_event_store "https://github.com/openbmc/bmcweb/blob/master/include/event_service_store.hpp"
click node_tls "https://github.com/openbmc/bmcweb/blob/master/http/mutual_tls.cpp"

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_app,node_router,node_request,node_response,node_httpbody,node_tls,node_client toneBlue
class node_auth,node_sessions,node_login,node_pam toneAmber
class node_redfish_routes,node_redfish_query,node_query_params,node_redfish_messages,node_aggregation,node_event_service toneMint
class node_dbus_rest,node_dbus_events,node_serial,node_kvm,node_virtual_media toneRose
class node_dbus,node_system_bus,node_event_store toneIndigo
```

## Components

### HTTP server

- [HTTP application](https://github.com/openbmc/bmcweb/blob/master/http/app.hpp): `http/app.hpp`
- [Route dispatch](https://github.com/openbmc/bmcweb/blob/master/http/routing.hpp): `http/routing.hpp`
- [HTTP request](https://github.com/openbmc/bmcweb/blob/master/http/http_request.hpp): `http/http_request.hpp`
- [HTTP response](https://github.com/openbmc/bmcweb/blob/master/http/http_response.hpp): `http/http_response.hpp`
- [HTTP body](https://github.com/openbmc/bmcweb/blob/master/http/http_body.hpp): `http/http_body.hpp`
- [TLS and HTTP/2](https://github.com/openbmc/bmcweb/blob/master/http/mutual_tls.cpp): `http/mutual_tls.cpp`

### Identity and security

- [Authentication](https://github.com/openbmc/bmcweb/blob/master/include/authentication.hpp): `include/authentication.hpp`
- [Sessions and persistence](https://github.com/openbmc/bmcweb/blob/master/include/persistent_data.hpp): `include/persistent_data.hpp`
- [Web UI login](https://github.com/openbmc/bmcweb/blob/master/features/webui_login/login_routes.hpp): `features/webui_login/login_routes.hpp`
- **PAM**

### Redfish API

- [Redfish resources](https://github.com/openbmc/bmcweb/tree/master/redfish-core/lib): `redfish-core/lib`
- [Redfish query handling](https://github.com/openbmc/bmcweb/blob/master/redfish-core/include/query.hpp): `redfish-core/include/query.hpp`
- [Query parameters](https://github.com/openbmc/bmcweb/blob/master/redfish-core/include/utils/query_param.hpp): `redfish-core/include/utils/query_param.hpp`
- [Redfish messages](https://github.com/openbmc/bmcweb/blob/master/redfish-core/include/error_messages.hpp): `redfish-core/include/error_messages.hpp`
- [Resource aggregation](https://github.com/openbmc/bmcweb/blob/master/redfish-core/include/redfish_aggregator.hpp): `redfish-core/include/redfish_aggregator.hpp`
- [Event subscriptions](https://github.com/openbmc/bmcweb/blob/master/redfish-core/include/event_service_manager.hpp): `redfish-core/include/event_service_manager.hpp`

### Device interfaces

- [OpenBMC DBus REST](https://github.com/openbmc/bmcweb/blob/master/features/openbmc_rest/openbmc_dbus_rest.hpp): `features/openbmc_rest/openbmc_dbus_rest.hpp`
- [DBus event websocket](https://github.com/openbmc/bmcweb/blob/master/features/openbmc_rest/dbus_monitor.hpp): `features/openbmc_rest/dbus_monitor.hpp`
- [Serial console](https://github.com/openbmc/bmcweb/blob/master/features/serial/obmc_console.hpp): `features/serial/obmc_console.hpp`
- [KVM websocket](https://github.com/openbmc/bmcweb/blob/master/features/kvm/kvm_websocket.hpp): `features/kvm/kvm_websocket.hpp`
- [Virtual media](https://github.com/openbmc/bmcweb/blob/master/features/virtual_media/vm_websocket.hpp): `features/virtual_media/vm_websocket.hpp`

### System state

- [DBus access](https://github.com/openbmc/bmcweb/blob/master/include/dbus_utility.hpp): `include/dbus_utility.hpp`
- **System DBus**
- [Event service store](https://github.com/openbmc/bmcweb/blob/master/include/event_service_store.hpp): `include/event_service_store.hpp`

### Other components

- **API client**

## Connections

- API client → HTTP application: sends request (evidence: `README.md`)
- HTTP application → Route dispatch: dispatches (evidence: `http/app.hpp`)
- Route dispatch → HTTP request: routes request (evidence: `http/routing.hpp`)
- HTTP request → HTTP response: produces response
- HTTP application → TLS and HTTP/2: serves HTTP(S) (evidence: `README.md`)
- Route dispatch → Web UI login: routes login (evidence: `features/webui_login/login_routes.hpp`)
- Web UI login → Sessions and persistence: creates session (evidence: `features/webui_login/login_routes.hpp`)
- Authentication → PAM: authenticates credentials (evidence: `README.md`)
- Route dispatch → Redfish resources: dispatches Redfish (evidence: `README.md`)
- Redfish resources → DBus access: reads system state (evidence: `redfish-core/lib/storage.hpp`)
- Redfish resources → Redfish query handling: uses query handling (evidence: `redfish-core/lib/managers.hpp`)
- Redfish query handling → Query parameters: parses parameters (evidence: `redfish-core/include/query.hpp`)
- Query parameters → Redfish messages: formats errors (evidence: `redfish-core/include/utils/query_param.hpp`)
- Redfish query handling → Resource aggregation: forwards remote requests (evidence: `redfish-core/include/query.hpp`)
- Redfish query handling → HTTP response: fills response (evidence: `redfish-core/include/query.hpp`)
- DBus access → System DBus: calls methods (evidence: `include/dbus_utility.hpp`)
- Route dispatch → OpenBMC DBus REST: routes DBus REST (evidence: `features/openbmc_rest/openbmc_dbus_rest.hpp`)
- Route dispatch → DBus event websocket: routes event websocket (evidence: `README.md`)
- Route dispatch → Serial console: routes console websocket (evidence: `features/serial/obmc_console.hpp`)
- Route dispatch → KVM websocket: routes KVM websocket (evidence: `README.md`)
- Route dispatch → Virtual media: routes virtual media (evidence: `features/virtual_media/vm_websocket.hpp`)
- Event subscriptions → Event service store: uses persistent store (evidence: `redfish-core/include/event_service_manager.hpp`)
- Event subscriptions → HTTP response: sends event stream (evidence: `redfish-core/include/event_service_manager.hpp`)
