# leblanc-simon/lotor architecture

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

- Interactive diagram: https://gitdiagram.com/leblanc-simon/lotor
- Repository: https://github.com/leblanc-simon/lotor
- Video tour (about a minute): https://gitdiagram.com/leblanc-simon/lotor/video

## Overview

Lotor is a self-hosted, multi-organization software-inventory and vulnerability-management service. Host and repository agents produce SBOMs; the server receives and analyzes them, then exposes cross-project search, findings, history, triage/VEX, license and policy decisions, and notifications. The README documents the main product capabilities; sampled source confirms API ingestion and key service responsibilities. Some internal wiring is unsampled, so uncertain subsystem links are omitted.

Main entry points: [`internal/web/router.go`](https://github.com/leblanc-simon/lotor/blob/main/internal/web/router.go) (Web routes), [`internal/finding/analyze.go`](https://github.com/leblanc-simon/lotor/blob/main/internal/finding/analyze.go) (Finding analysis), [`cmd/lotor-server/main.go`](https://github.com/leblanc-simon/lotor/blob/main/cmd/lotor-server/main.go) (Server runtime), [`internal/search/search.go`](https://github.com/leblanc-simon/lotor/blob/main/internal/search/search.go) (Cross-project search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Inventory agents"]
  node_host_agent["Host agent<br/>[agent.go]"]
  node_repo_agent["Repository agent<br/>[agent.go]"]
end

subgraph group_server["Server intake"]
  node_server_entry["Server runtime<br/>[main.go]"]
  node_api_ingest["Agent ingest API<br/>[ingest.go]"]
  node_ingest["SBOM ingestion<br/>[ingest.go]"]
  node_postgres[("PostgreSQL")]
end

subgraph group_analysis["Analysis and inventory"]
  node_projects["Projects<br/>[project.go]"]
  node_inventory["Snapshots and history<br/>[retention.go]"]
  node_finding["Finding analysis<br/>[analyze.go]"]
  node_vuln[("Vulnerability database<br/>[manager.go]")]
end

subgraph group_response["Risk response"]
  node_license["License policy<br/>[service.go]"]
  node_triage["Triage and VEX<br/>[service.go]"]
  node_policy["CEL policies<br/>[service.go]"]
  node_notify["Notifications<br/>[service.go]"]
  node_audit["Audit log<br/>[audit.go]"]
end

subgraph group_experience["User experience"]
  node_web["Web routes<br/>[router.go]"]
  node_dashboard["Dashboard<br/>[read.go]"]
  node_search["Cross-project search<br/>[search.go]"]
  node_org["Organizations and teams<br/>[org.go]"]
  node_signup["Signup<br/>[signup.go]"]
end

node_operator(("Operator"))

node_operator -->|"uses"| node_web
node_operator -->|"installs"| node_host_agent
node_operator -->|"configures"| node_repo_agent
node_host_agent -->|"uploads SBOMs"| node_api_ingest
node_repo_agent -->|"uploads SBOMs"| node_api_ingest
node_repo_agent -->|"receives forge pushes"| node_repo_agent
node_api_ingest -->|"receives SBOM"| node_ingest
node_server_entry -->|"starts database"| node_postgres
node_server_entry -.->|"starts services"| node_web
node_server_entry -.->|"configures analysis"| node_finding
node_server_entry -.->|"configures imports"| node_vuln
node_ingest -->|"stores ingestions"| node_postgres
node_ingest -->|"associates inventory"| node_projects
node_finding -->|"analyzes snapshots"| node_inventory
node_finding -->|"checks vulnerabilities"| node_vuln
node_vuln -->|"reanalysis enables"| node_finding
node_web -->|"serves dashboard"| node_dashboard
node_web -->|"serves search"| node_search
node_web -->|"serves triage"| node_triage
node_web -->|"serves policies"| node_policy
node_search -->|"searches history"| node_inventory
node_search -->|"searches findings"| node_finding
node_search -->|"searches licenses"| node_license
node_triage -->|"records decisions"| node_audit
node_policy -->|"routes alerts"| node_notify
node_policy -->|"records changes"| node_audit
node_license -->|"evaluates components"| node_inventory
node_signup -->|"creates organization"| node_org
node_org -->|"stores organization data"| node_postgres

click node_host_agent "https://github.com/leblanc-simon/lotor/blob/main/internal/hostagent/agent.go"
click node_repo_agent "https://github.com/leblanc-simon/lotor/blob/main/internal/repoagent/agent.go"
click node_server_entry "https://github.com/leblanc-simon/lotor/blob/main/cmd/lotor-server/main.go"
click node_api_ingest "https://github.com/leblanc-simon/lotor/blob/main/internal/api/ingest.go"
click node_ingest "https://github.com/leblanc-simon/lotor/blob/main/internal/ingest/ingest.go"
click node_web "https://github.com/leblanc-simon/lotor/blob/main/internal/web/router.go"
click node_dashboard "https://github.com/leblanc-simon/lotor/blob/main/internal/dashboard/read.go"
click node_search "https://github.com/leblanc-simon/lotor/blob/main/internal/search/search.go"
click node_projects "https://github.com/leblanc-simon/lotor/blob/main/internal/project/project.go"
click node_inventory "https://github.com/leblanc-simon/lotor/blob/main/internal/inventory/retention.go"
click node_finding "https://github.com/leblanc-simon/lotor/blob/main/internal/finding/analyze.go"
click node_vuln "https://github.com/leblanc-simon/lotor/blob/main/internal/vuln/manager.go"
click node_license "https://github.com/leblanc-simon/lotor/blob/main/internal/license/service.go"
click node_triage "https://github.com/leblanc-simon/lotor/blob/main/internal/triage/service.go"
click node_policy "https://github.com/leblanc-simon/lotor/blob/main/internal/policy/service.go"
click node_notify "https://github.com/leblanc-simon/lotor/blob/main/internal/notify/service.go"
click node_org "https://github.com/leblanc-simon/lotor/blob/main/internal/org/org.go"
click node_signup "https://github.com/leblanc-simon/lotor/blob/main/internal/signup/signup.go"
click node_audit "https://github.com/leblanc-simon/lotor/blob/main/internal/audit/audit.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_host_agent,node_repo_agent toneBlue
class node_server_entry,node_api_ingest,node_ingest,node_postgres toneAmber
class node_projects,node_inventory,node_finding,node_vuln toneMint
class node_license,node_triage,node_policy,node_notify,node_audit toneRose
class node_web,node_dashboard,node_search,node_org,node_signup,node_operator toneIndigo
```

## Components

### Inventory agents

- [Host agent](https://github.com/leblanc-simon/lotor/blob/main/internal/hostagent/agent.go): `internal/hostagent/agent.go`
- [Repository agent](https://github.com/leblanc-simon/lotor/blob/main/internal/repoagent/agent.go): `internal/repoagent/agent.go`

### Server intake

- [Server runtime](https://github.com/leblanc-simon/lotor/blob/main/cmd/lotor-server/main.go): `cmd/lotor-server/main.go`
- [Agent ingest API](https://github.com/leblanc-simon/lotor/blob/main/internal/api/ingest.go): `internal/api/ingest.go`
- [SBOM ingestion](https://github.com/leblanc-simon/lotor/blob/main/internal/ingest/ingest.go): `internal/ingest/ingest.go`
- **PostgreSQL**

### Analysis and inventory

- [Projects](https://github.com/leblanc-simon/lotor/blob/main/internal/project/project.go): `internal/project/project.go`
- [Snapshots and history](https://github.com/leblanc-simon/lotor/blob/main/internal/inventory/retention.go): `internal/inventory/retention.go`
- [Finding analysis](https://github.com/leblanc-simon/lotor/blob/main/internal/finding/analyze.go): `internal/finding/analyze.go`
- [Vulnerability database](https://github.com/leblanc-simon/lotor/blob/main/internal/vuln/manager.go): `internal/vuln/manager.go`

### Risk response

- [License policy](https://github.com/leblanc-simon/lotor/blob/main/internal/license/service.go): `internal/license/service.go`
- [Triage and VEX](https://github.com/leblanc-simon/lotor/blob/main/internal/triage/service.go): `internal/triage/service.go`
- [CEL policies](https://github.com/leblanc-simon/lotor/blob/main/internal/policy/service.go): `internal/policy/service.go`
- [Notifications](https://github.com/leblanc-simon/lotor/blob/main/internal/notify/service.go): `internal/notify/service.go`
- [Audit log](https://github.com/leblanc-simon/lotor/blob/main/internal/audit/audit.go): `internal/audit/audit.go`

### User experience

- [Web routes](https://github.com/leblanc-simon/lotor/blob/main/internal/web/router.go): `internal/web/router.go`
- [Dashboard](https://github.com/leblanc-simon/lotor/blob/main/internal/dashboard/read.go): `internal/dashboard/read.go`
- [Cross-project search](https://github.com/leblanc-simon/lotor/blob/main/internal/search/search.go): `internal/search/search.go`
- [Organizations and teams](https://github.com/leblanc-simon/lotor/blob/main/internal/org/org.go): `internal/org/org.go`
- [Signup](https://github.com/leblanc-simon/lotor/blob/main/internal/signup/signup.go): `internal/signup/signup.go`

### Other components

- **Operator**

## Connections

- Operator → Web routes: uses
- Operator → Host agent: installs
- Operator → Repository agent: configures
- Host agent → Agent ingest API: uploads SBOMs
- Repository agent → Agent ingest API: uploads SBOMs
- Repository agent → Repository agent: receives forge pushes
- Agent ingest API → SBOM ingestion: receives SBOM (evidence: `internal/api/ingest.go`)
- Server runtime → PostgreSQL: starts database (evidence: `cmd/lotor-server/main.go`)
- Server runtime → Web routes: starts services
- Server runtime → Finding analysis: configures analysis
- Server runtime → Vulnerability database: configures imports
- SBOM ingestion → PostgreSQL: stores ingestions
- SBOM ingestion → Projects: associates inventory (evidence: `internal/ingest/ingest.go`)
- Finding analysis → Snapshots and history: analyzes snapshots (evidence: `internal/finding/analyze.go`)
- Finding analysis → Vulnerability database: checks vulnerabilities (evidence: `internal/finding/analyze.go`)
- Vulnerability database → Finding analysis: reanalysis enables
- Web routes → Dashboard: serves dashboard
- Web routes → Cross-project search: serves search
- Web routes → Triage and VEX: serves triage
- Web routes → CEL policies: serves policies
- Cross-project search → Snapshots and history: searches history (evidence: `internal/search/search.go`)
- Cross-project search → Finding analysis: searches findings (evidence: `internal/search/search.go`)
- Cross-project search → License policy: searches licenses (evidence: `internal/search/search.go`)
- Triage and VEX → Audit log: records decisions (evidence: `internal/triage/service.go`)
- CEL policies → Notifications: routes alerts
- CEL policies → Audit log: records changes (evidence: `internal/policy/service.go`)
- License policy → Snapshots and history: evaluates components (evidence: `internal/license/service.go`)
- Signup → Organizations and teams: creates organization (evidence: `internal/signup/signup.go`)
- Organizations and teams → PostgreSQL: stores organization data (evidence: `internal/org/org.go`)
