# mcodr23/intent-based-network-controller architecture

> Architecture diagram of the GitHub repository mcodr23/intent-based-network-controller, 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/mcodr23/intent-based-network-controller
- Repository: https://github.com/mcodr23/intent-based-network-controller

## Overview

This is a demo-first intent-based network controller: users discover mock devices, view topology, define network policy, deploy generated configurations, then inspect compliance and telemetry. The frontend presents the workflow; FastAPI routes dispatch requests to services, with persistent domain state in the database. Authentication/RBAC and audit logging span the API. The README documents the wider capability set; some subsystem links below rely on that documentation because their source was not excerpted.

Main entry points: [`backend/app/db/session.py`](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/db/session.py) (Controller state store), [`backend/app/api/routes/auth.py`](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/api/routes/auth.py) (Authentication routes), [`backend/app/services/discovery_service.py`](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/discovery_service.py) (Device discovery), [`backend/app/services/topology_service.py`](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/topology_service.py) (Topology service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_ui["Controller dashboard<br/>[app.js]"]
end

subgraph group_api["API and access"]
  node_api_app["API application<br/>[main.py]"]
  node_auth_route["Authentication routes<br/>[auth.py]"]
  node_access["JWT and RBAC<br/>[deps.py]"]
  node_auth_service["Account service<br/>[auth_service.py]"]
end

subgraph group_control["Network control"]
  node_inventory_route["Inventory routes<br/>[inventory.py]"]
  node_discovery["Device discovery"]
  node_mock_devices["Mock device catalog<br/>[mock_data.py]"]
  node_topology["Topology service"]
  node_policies["Intent and policy<br/>[policy_service.py]"]
  node_deployment_route["Deployment routes<br/>[deployment.py]"]
  node_deployment["Deployment orchestration"]
  node_config["Config generation<br/>[config_service.py]"]
end

subgraph group_assurance["Assurance and records"]
  node_compliance_route["Compliance routes<br/>[compliance.py]"]
  node_compliance["Drift and remediation"]
  node_telemetry["Telemetry collection"]
  node_monitor["Background monitor<br/>[monitor_service.py]"]
  node_audit["Audit logging<br/>[audit_service.py]"]
  node_database[("Controller state store<br/>[session.py]")]
end

node_user(("Network operator"))

node_user -->|"uses"| node_ui
node_ui -.->|"submits requests"| node_api_app
node_api_app -->|"registers routes"| node_auth_route
node_auth_route -->|"authenticates users"| node_auth_service
node_auth_route -->|"creates tokens"| node_access
node_access -->|"loads users"| node_database
node_inventory_route -->|"starts discovery"| node_discovery
node_discovery -->|"matches devices"| node_mock_devices
node_inventory_route -->|"rebuilds topology"| node_topology
node_discovery -->|"upserts inventory"| node_database
node_topology -->|"reads neighbors"| node_mock_devices
node_topology -->|"stores topology"| node_database
node_deployment_route -->|"starts deployment"| node_deployment
node_deployment -->|"renders configs"| node_config
node_deployment -->|"stores deployments"| node_database
node_compliance_route -->|"checks or remediates"| node_compliance
node_compliance -->|"records drift"| node_database
node_monitor -->|"collects metrics"| node_telemetry
node_monitor -->|"checks drift"| node_compliance
node_telemetry -->|"stores metrics"| node_database
node_auth_route -->|"records actions"| node_audit
node_audit -->|"stores audit logs"| node_database

click node_ui "https://github.com/mcodr23/intent-based-network-controller/blob/main/frontend/js/app.js"
click node_api_app "https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/main.py"
click node_auth_route "https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/api/routes/auth.py"
click node_access "https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/api/deps.py"
click node_auth_service "https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/auth_service.py"
click node_inventory_route "https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/api/routes/inventory.py"
click node_discovery "https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/discovery_service.py"
click node_mock_devices "https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/mock_data.py"
click node_topology "https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/topology_service.py"
click node_policies "https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/policy_service.py"
click node_deployment_route "https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/api/routes/deployment.py"
click node_deployment "https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/deployment_service.py"
click node_config "https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/config_service.py"
click node_compliance_route "https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/api/routes/compliance.py"
click node_compliance "https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/compliance_service.py"
click node_telemetry "https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/telemetry_service.py"
click node_monitor "https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/monitor_service.py"
click node_audit "https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/audit_service.py"
click node_database "https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/db/session.py"

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 toneBlue
class node_api_app,node_auth_route,node_access,node_auth_service toneAmber
class node_inventory_route,node_discovery,node_mock_devices,node_topology,node_policies,node_deployment_route,node_deployment,node_config toneMint
class node_compliance_route,node_compliance,node_telemetry,node_monitor,node_audit,node_database toneRose
class node_user toneIndigo
```

## Components

### User experience

- [Controller dashboard](https://github.com/mcodr23/intent-based-network-controller/blob/main/frontend/js/app.js): `frontend/js/app.js`

### API and access

- [API application](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication routes](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/api/routes/auth.py): `backend/app/api/routes/auth.py`
- [JWT and RBAC](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/api/deps.py): `backend/app/api/deps.py`
- [Account service](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/auth_service.py): `backend/app/services/auth_service.py`

### Network control

- [Inventory routes](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/api/routes/inventory.py): `backend/app/api/routes/inventory.py`
- [Device discovery](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/discovery_service.py): `backend/app/services/discovery_service.py`
- [Mock device catalog](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/mock_data.py): `backend/app/services/mock_data.py`
- [Topology service](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/topology_service.py): `backend/app/services/topology_service.py`
- [Intent and policy](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/policy_service.py): `backend/app/services/policy_service.py`
- [Deployment routes](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/api/routes/deployment.py): `backend/app/api/routes/deployment.py`
- [Deployment orchestration](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/deployment_service.py): `backend/app/services/deployment_service.py`
- [Config generation](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/config_service.py): `backend/app/services/config_service.py`

### Assurance and records

- [Compliance routes](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/api/routes/compliance.py): `backend/app/api/routes/compliance.py`
- [Drift and remediation](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/compliance_service.py): `backend/app/services/compliance_service.py`
- [Telemetry collection](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/telemetry_service.py): `backend/app/services/telemetry_service.py`
- [Background monitor](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/monitor_service.py): `backend/app/services/monitor_service.py`
- [Audit logging](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/services/audit_service.py): `backend/app/services/audit_service.py`
- [Controller state store](https://github.com/mcodr23/intent-based-network-controller/blob/main/backend/app/db/session.py): `backend/app/db/session.py`

### Other components

- **Network operator**

## Connections

- Network operator → Controller dashboard: uses (evidence: `README.md`)
- Controller dashboard → API application: submits requests
- API application → Authentication routes: registers routes (evidence: `backend/app/main.py`)
- Authentication routes → Account service: authenticates users (evidence: `backend/app/api/routes/auth.py`)
- Authentication routes → JWT and RBAC: creates tokens (evidence: `backend/app/api/routes/auth.py`)
- JWT and RBAC → Controller state store: loads users (evidence: `backend/app/api/deps.py`)
- Inventory routes → Device discovery: starts discovery (evidence: `backend/app/api/routes/inventory.py`)
- Device discovery → Mock device catalog: matches devices (evidence: `backend/app/services/discovery_service.py`)
- Inventory routes → Topology service: rebuilds topology (evidence: `backend/app/api/routes/inventory.py`)
- Device discovery → Controller state store: upserts inventory (evidence: `backend/app/services/discovery_service.py`)
- Topology service → Mock device catalog: reads neighbors (evidence: `backend/app/services/topology_service.py`)
- Topology service → Controller state store: stores topology (evidence: `backend/app/services/topology_service.py`)
- Deployment routes → Deployment orchestration: starts deployment (evidence: `backend/app/api/routes/deployment.py`)
- Deployment orchestration → Config generation: renders configs (evidence: `backend/app/services/deployment_service.py`)
- Deployment orchestration → Controller state store: stores deployments (evidence: `README.md`)
- Compliance routes → Drift and remediation: checks or remediates (evidence: `backend/app/api/routes/compliance.py`)
- Drift and remediation → Controller state store: records drift (evidence: `backend/app/services/compliance_service.py`)
- Background monitor → Telemetry collection: collects metrics (evidence: `backend/app/services/monitor_service.py`)
- Background monitor → Drift and remediation: checks drift (evidence: `backend/app/services/monitor_service.py`)
- Telemetry collection → Controller state store: stores metrics (evidence: `README.md`)
- Authentication routes → Audit logging: records actions (evidence: `backend/app/api/routes/auth.py`)
- Audit logging → Controller state store: stores audit logs (evidence: `backend/app/services/audit_service.py`)
