# netbox-community/netbox architecture

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

- Interactive diagram: https://gitdiagram.com/netbox-community/netbox
- Repository: https://github.com/netbox-community/netbox

## Overview

NetBox is a network-infrastructure source of truth: engineers model intended network state through its UI or programmable APIs, then automation and other tools consume that state. Its domain model spans physical infrastructure, IPAM, circuits, and related network resources; shared model features provide customization, validation, permissions, and change history. The README documents configuration rendering, scripts, event-driven webhooks, and plugins as major capabilities. The tree and excerpts support the component paths; many detailed integrations are documented but their implementations were not sampled.

Main entry points: [`netbox/netbox/views`](https://github.com/netbox-community/netbox/tree/main/netbox/netbox/views) (Web UI), [`netbox/netbox/api`](https://github.com/netbox-community/netbox/tree/main/netbox/netbox/api) (REST API), [`netbox/extras/event_rules.py`](https://github.com/netbox-community/netbox/blob/main/netbox/extras/event_rules.py) (Event Rules), [`netbox/netbox/graphql`](https://github.com/netbox-community/netbox/tree/main/netbox/netbox/graphql) (GraphQL API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_webui["Web UI"]
  node_rest["REST API"]
  node_graphql["GraphQL API"]
end

subgraph group_network["Network Model"]
  node_physical["Physical Infrastructure"]
  node_ipam["IP Address Management"]
  node_circuits["Circuits"]
  node_virtualization["Virtualization"]
  node_vpn["VPN"]
  node_wireless["Wireless"]
  node_tenancy["Tenancy"]
end

subgraph group_governance["Governance and Extensibility"]
  node_plugins["Plugins"]
  node_customization["Custom Fields and Tags"]
end

subgraph group_automation["Automation and Events"]
  node_config_rendering["Configuration Rendering<br/>[configs.py]"]
  node_scripts["Custom Scripts<br/>[scripts.py]"]
  node_event_rules["Event Rules<br/>[event_rules.py]"]
  node_webhooks["Webhooks<br/>[webhooks.py]"]
end

subgraph group_platform["Shared Platform"]
  node_database[("Network State")]
  node_model_features["Model Features<br/>[features.py]"]
  node_permissions["Permissions<br/>[permissions.py]"]
  node_changelog["Change Logging<br/>[change_logging.py]"]
end

node_engineer(("Network Engineer"))
node_automation_tools(("Automation Tools"))

node_engineer -->|"models state"| node_webui
node_engineer -->|"accesses API"| node_rest
node_engineer -.->|"queries data"| node_graphql
node_webui -->|"models infrastructure"| node_physical
node_webui -->|"manages resources"| node_ipam
node_rest -->|"exposes network state"| node_database
node_graphql -.->|"queries network state"| node_database
node_physical -->|"persists intended state"| node_database
node_ipam -->|"persists intended state"| node_database
node_circuits -->|"models circuits"| node_database
node_virtualization -->|"models resources"| node_database
node_vpn -->|"models resources"| node_database
node_wireless -->|"models resources"| node_database
node_tenancy -->|"models resources"| node_database
node_model_features -->|"extends managed models"| node_database
node_permissions -->|"restricts access"| node_webui
node_changelog -->|"records changes"| node_database
node_customization -->|"extends data model"| node_model_features
node_config_rendering -->|"renders configurations"| node_database
node_rest -->|"serves rendered configs"| node_automation_tools
node_engineer -->|"runs workflows"| node_scripts
node_event_rules -->|"triggers scripts"| node_scripts
node_event_rules -->|"triggers webhooks"| node_webhooks
node_webhooks -->|"sends events"| node_automation_tools
node_plugins -->|"adds functionality"| node_webui

click node_webui "https://github.com/netbox-community/netbox/tree/main/netbox/netbox/views"
click node_rest "https://github.com/netbox-community/netbox/tree/main/netbox/netbox/api"
click node_graphql "https://github.com/netbox-community/netbox/tree/main/netbox/netbox/graphql"
click node_physical "https://github.com/netbox-community/netbox/tree/main/netbox/dcim/models"
click node_ipam "https://github.com/netbox-community/netbox/tree/main/netbox/ipam/models"
click node_circuits "https://github.com/netbox-community/netbox/tree/main/netbox/circuits/models"
click node_virtualization "https://github.com/netbox-community/netbox/tree/main/netbox/virtualization/models"
click node_vpn "https://github.com/netbox-community/netbox/tree/main/netbox/vpn"
click node_wireless "https://github.com/netbox-community/netbox/tree/main/netbox/wireless"
click node_tenancy "https://github.com/netbox-community/netbox/tree/main/netbox/tenancy/models"
click node_model_features "https://github.com/netbox-community/netbox/blob/main/netbox/netbox/models/features.py"
click node_permissions "https://github.com/netbox-community/netbox/blob/main/netbox/users/models/permissions.py"
click node_changelog "https://github.com/netbox-community/netbox/blob/main/netbox/core/models/change_logging.py"
click node_config_rendering "https://github.com/netbox-community/netbox/blob/main/netbox/extras/models/configs.py"
click node_scripts "https://github.com/netbox-community/netbox/blob/main/netbox/extras/scripts.py"
click node_event_rules "https://github.com/netbox-community/netbox/blob/main/netbox/extras/event_rules.py"
click node_webhooks "https://github.com/netbox-community/netbox/blob/main/netbox/extras/webhooks.py"
click node_plugins "https://github.com/netbox-community/netbox/tree/main/netbox/netbox/plugins"
click node_customization "https://github.com/netbox-community/netbox/tree/main/netbox/extras/models"

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_webui,node_rest,node_graphql toneBlue
class node_physical,node_ipam,node_circuits,node_virtualization,node_vpn,node_wireless,node_tenancy toneAmber
class node_plugins,node_customization toneMint
class node_config_rendering,node_scripts,node_event_rules,node_webhooks toneRose
class node_database,node_model_features,node_permissions,node_changelog,node_engineer,node_automation_tools toneIndigo
```

## Components

### User Interfaces

- [Web UI](https://github.com/netbox-community/netbox/tree/main/netbox/netbox/views): `netbox/netbox/views`
- [REST API](https://github.com/netbox-community/netbox/tree/main/netbox/netbox/api): `netbox/netbox/api`
- [GraphQL API](https://github.com/netbox-community/netbox/tree/main/netbox/netbox/graphql): `netbox/netbox/graphql`

### Network Model

- [Physical Infrastructure](https://github.com/netbox-community/netbox/tree/main/netbox/dcim/models): `netbox/dcim/models`
- [IP Address Management](https://github.com/netbox-community/netbox/tree/main/netbox/ipam/models): `netbox/ipam/models`
- [Circuits](https://github.com/netbox-community/netbox/tree/main/netbox/circuits/models): `netbox/circuits/models`
- [Virtualization](https://github.com/netbox-community/netbox/tree/main/netbox/virtualization/models): `netbox/virtualization/models`
- [VPN](https://github.com/netbox-community/netbox/tree/main/netbox/vpn): `netbox/vpn`
- [Wireless](https://github.com/netbox-community/netbox/tree/main/netbox/wireless): `netbox/wireless`
- [Tenancy](https://github.com/netbox-community/netbox/tree/main/netbox/tenancy/models): `netbox/tenancy/models`

### Governance and Extensibility

- [Plugins](https://github.com/netbox-community/netbox/tree/main/netbox/netbox/plugins): `netbox/netbox/plugins`
- [Custom Fields and Tags](https://github.com/netbox-community/netbox/tree/main/netbox/extras/models): `netbox/extras/models`

### Automation and Events

- [Configuration Rendering](https://github.com/netbox-community/netbox/blob/main/netbox/extras/models/configs.py): `netbox/extras/models/configs.py`
- [Custom Scripts](https://github.com/netbox-community/netbox/blob/main/netbox/extras/scripts.py): `netbox/extras/scripts.py`
- [Event Rules](https://github.com/netbox-community/netbox/blob/main/netbox/extras/event_rules.py): `netbox/extras/event_rules.py`
- [Webhooks](https://github.com/netbox-community/netbox/blob/main/netbox/extras/webhooks.py): `netbox/extras/webhooks.py`

### Shared Platform

- **Network State**
- [Model Features](https://github.com/netbox-community/netbox/blob/main/netbox/netbox/models/features.py): `netbox/netbox/models/features.py`
- [Permissions](https://github.com/netbox-community/netbox/blob/main/netbox/users/models/permissions.py): `netbox/users/models/permissions.py`
- [Change Logging](https://github.com/netbox-community/netbox/blob/main/netbox/core/models/change_logging.py): `netbox/core/models/change_logging.py`

### Other components

- **Network Engineer**
- **Automation Tools**

## Connections

- Network Engineer → Web UI: models state
- Network Engineer → REST API: accesses API
- Network Engineer → GraphQL API: queries data
- Web UI → Physical Infrastructure: models infrastructure
- Web UI → IP Address Management: manages resources
- REST API → Network State: exposes network state
- GraphQL API → Network State: queries network state
- Physical Infrastructure → Network State: persists intended state
- IP Address Management → Network State: persists intended state
- Circuits → Network State: models circuits
- Virtualization → Network State: models resources
- VPN → Network State: models resources
- Wireless → Network State: models resources
- Tenancy → Network State: models resources
- Model Features → Network State: extends managed models (evidence: `netbox/netbox/models/features.py`)
- Permissions → Web UI: restricts access
- Change Logging → Network State: records changes
- Custom Fields and Tags → Model Features: extends data model (evidence: `netbox/netbox/models/features.py`)
- Configuration Rendering → Network State: renders configurations
- REST API → Automation Tools: serves rendered configs
- Network Engineer → Custom Scripts: runs workflows
- Event Rules → Custom Scripts: triggers scripts
- Event Rules → Webhooks: triggers webhooks
- Webhooks → Automation Tools: sends events
- Plugins → Web UI: adds functionality
