# secsimon/ttm architecture

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

- Interactive diagram: https://gitdiagram.com/secsimon/ttm
- Repository: https://github.com/secsimon/ttm

## Overview

TTModeler is an IoT-focused threat-modeling application for web and desktop. The documented workflow is to create or open a project, model the system and its threats, assess risk and mitigations, then review results or export reports. Its major capabilities also include customizable threat libraries, security-reference integrations, project storage and collaboration, and multiple diagram types. The graph combines documented product stages with central model and service modules; unsampled UI-to-engine calls are not asserted.

Main entry points: [`src/app/modeling/modeling.component.ts`](https://github.com/secsimon/ttm/blob/main/src/app/modeling/modeling.component.ts) (Modeling workspace), [`src/app/util/data.service.ts`](https://github.com/secsimon/ttm/blob/main/src/app/util/data.service.ts) (Project storage service), [`src/app/home/home.component.ts`](https://github.com/secsimon/ttm/blob/main/src/app/home/home.component.ts) (Project home), [`src/app/login/login.component.ts`](https://github.com/secsimon/ttm/blob/main/src/app/login/login.component.ts) (GitHub login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application and projects"]
  node_app["TTModeler app<br/>[app.component.ts]"]
  node_home["Project home<br/>[home.component.ts]"]
  node_login["GitHub login<br/>[login.component.ts]"]
  node_project["Project model<br/>[project-file.ts]"]
  node_data["Project storage service<br/>[data.service.ts]"]
  node_local[("Offline preferences")]
end

subgraph group_model["System modeling"]
  node_modeling["Modeling workspace"]
  node_diagrams["System diagrams<br/>[diagram.ts]"]
  node_context["Device context<br/>[system-context.ts]"]
  node_components["Device components<br/>[component.ts]"]
end

subgraph group_analysis["Threat and risk analysis"]
  node_threats["Threat analysis"]
  node_threatmodel["Threat records<br/>[threat-model.ts]"]
  node_risk["Risk overview"]
  node_mitigation["Mitigation analysis"]
  node_mitigations["Mitigation records<br/>[mitigations.ts]"]
end

subgraph group_library["Configuration and libraries"]
  node_configuration["Threat library settings"]
  node_references["Security references"]
end

subgraph group_outputs["Review and reporting"]
  node_dashboard["Results dashboard"]
  node_reporting["Reports and exports"]
end

node_user(("Modeler"))

node_user -->|"opens projects"| node_home
node_user -->|"models device"| node_modeling
node_user -->|"signs in"| node_login
node_home -.->|"loads or saves"| node_data
node_login -.->|"authorizes storage"| node_data
node_data -->|"loads and saves"| node_project
node_data -->|"reads preferences"| node_local
node_modeling -.->|"edits diagrams"| node_diagrams
node_modeling -.->|"models system"| node_context
node_modeling -.->|"models components"| node_components
node_user -->|"identifies threats"| node_threats
node_threats -.->|"generates threats"| node_threatmodel
node_user -->|"assesses risk"| node_risk
node_user -->|"reviews mitigations"| node_mitigation
node_mitigation -.->|"evaluates controls"| node_mitigations
node_user -->|"customizes libraries"| node_configuration
node_user -->|"consults references"| node_references
node_user -->|"reviews results"| node_dashboard
node_user -->|"exports reports"| node_reporting
node_project -.->|"provides project data"| node_reporting

click node_app "https://github.com/secsimon/ttm/blob/main/src/app/app.component.ts"
click node_home "https://github.com/secsimon/ttm/blob/main/src/app/home/home.component.ts"
click node_login "https://github.com/secsimon/ttm/blob/main/src/app/login/login.component.ts"
click node_project "https://github.com/secsimon/ttm/blob/main/src/app/model/project-file.ts"
click node_data "https://github.com/secsimon/ttm/blob/main/src/app/util/data.service.ts"
click node_local "https://github.com/secsimon/ttm/blob/main/src/app/util/local-storage.service.ts"
click node_modeling "https://github.com/secsimon/ttm/blob/main/src/app/modeling/modeling.component.ts"
click node_diagrams "https://github.com/secsimon/ttm/blob/main/src/app/model/diagram.ts"
click node_context "https://github.com/secsimon/ttm/blob/main/src/app/model/system-context.ts"
click node_components "https://github.com/secsimon/ttm/blob/main/src/app/model/component.ts"
click node_threats "https://github.com/secsimon/ttm/blob/main/src/app/util/threat-engine.service.ts"
click node_threatmodel "https://github.com/secsimon/ttm/blob/main/src/app/model/threat-model.ts"
click node_risk "https://github.com/secsimon/ttm/blob/main/src/app/risk-overview/risk-overview.component.ts"
click node_mitigation "https://github.com/secsimon/ttm/blob/main/src/app/util/mitigation-engine.service.ts"
click node_mitigations "https://github.com/secsimon/ttm/blob/main/src/app/model/mitigations.ts"
click node_configuration "https://github.com/secsimon/ttm/blob/main/src/app/configuration/configuration.component.ts"
click node_dashboard "https://github.com/secsimon/ttm/blob/main/src/app/dashboard/dashboard.component.ts"
click node_reporting "https://github.com/secsimon/ttm/blob/main/src/app/reporting/reporting.component.ts"
click node_references "https://github.com/secsimon/ttm/blob/main/src/app/shared/components/cve-entry/cve-entry.component.ts"

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_home,node_login,node_project,node_data,node_local toneBlue
class node_modeling,node_diagrams,node_context,node_components toneAmber
class node_threats,node_threatmodel,node_risk,node_mitigation,node_mitigations toneMint
class node_configuration,node_references toneRose
class node_dashboard,node_reporting,node_user toneIndigo
```

## Components

### Application and projects

- [TTModeler app](https://github.com/secsimon/ttm/blob/main/src/app/app.component.ts): `src/app/app.component.ts`
- [Project home](https://github.com/secsimon/ttm/blob/main/src/app/home/home.component.ts): `src/app/home/home.component.ts`
- [GitHub login](https://github.com/secsimon/ttm/blob/main/src/app/login/login.component.ts): `src/app/login/login.component.ts`
- [Project model](https://github.com/secsimon/ttm/blob/main/src/app/model/project-file.ts): `src/app/model/project-file.ts`
- [Project storage service](https://github.com/secsimon/ttm/blob/main/src/app/util/data.service.ts): `src/app/util/data.service.ts`
- [Offline preferences](https://github.com/secsimon/ttm/blob/main/src/app/util/local-storage.service.ts): `src/app/util/local-storage.service.ts`

### System modeling

- [Modeling workspace](https://github.com/secsimon/ttm/blob/main/src/app/modeling/modeling.component.ts): `src/app/modeling/modeling.component.ts`
- [System diagrams](https://github.com/secsimon/ttm/blob/main/src/app/model/diagram.ts): `src/app/model/diagram.ts`
- [Device context](https://github.com/secsimon/ttm/blob/main/src/app/model/system-context.ts): `src/app/model/system-context.ts`
- [Device components](https://github.com/secsimon/ttm/blob/main/src/app/model/component.ts): `src/app/model/component.ts`

### Threat and risk analysis

- [Threat analysis](https://github.com/secsimon/ttm/blob/main/src/app/util/threat-engine.service.ts): `src/app/util/threat-engine.service.ts`
- [Threat records](https://github.com/secsimon/ttm/blob/main/src/app/model/threat-model.ts): `src/app/model/threat-model.ts`
- [Risk overview](https://github.com/secsimon/ttm/blob/main/src/app/risk-overview/risk-overview.component.ts): `src/app/risk-overview/risk-overview.component.ts`
- [Mitigation analysis](https://github.com/secsimon/ttm/blob/main/src/app/util/mitigation-engine.service.ts): `src/app/util/mitigation-engine.service.ts`
- [Mitigation records](https://github.com/secsimon/ttm/blob/main/src/app/model/mitigations.ts): `src/app/model/mitigations.ts`

### Configuration and libraries

- [Threat library settings](https://github.com/secsimon/ttm/blob/main/src/app/configuration/configuration.component.ts): `src/app/configuration/configuration.component.ts`
- [Security references](https://github.com/secsimon/ttm/blob/main/src/app/shared/components/cve-entry/cve-entry.component.ts): `src/app/shared/components/cve-entry/cve-entry.component.ts`

### Review and reporting

- [Results dashboard](https://github.com/secsimon/ttm/blob/main/src/app/dashboard/dashboard.component.ts): `src/app/dashboard/dashboard.component.ts`
- [Reports and exports](https://github.com/secsimon/ttm/blob/main/src/app/reporting/reporting.component.ts): `src/app/reporting/reporting.component.ts`

### Other components

- **Modeler**

## Connections

- Modeler → Project home: opens projects (evidence: `README.md`)
- Modeler → Modeling workspace: models device (evidence: `README.md`)
- Modeler → GitHub login: signs in (evidence: `README.md`)
- Project home → Project storage service: loads or saves (evidence: `src/app/home/home.component.ts`)
- GitHub login → Project storage service: authorizes storage
- Project storage service → Project model: loads and saves (evidence: `src/app/util/data.service.ts`)
- Project storage service → Offline preferences: reads preferences (evidence: `src/app/util/data.service.ts`)
- Modeling workspace → System diagrams: edits diagrams
- Modeling workspace → Device context: models system
- Modeling workspace → Device components: models components
- Modeler → Threat analysis: identifies threats (evidence: `README.md`)
- Threat analysis → Threat records: generates threats (evidence: `src/app/util/threat-engine.service.ts`)
- Modeler → Risk overview: assesses risk (evidence: `README.md`)
- Modeler → Mitigation analysis: reviews mitigations (evidence: `README.md`)
- Mitigation analysis → Mitigation records: evaluates controls (evidence: `src/app/util/mitigation-engine.service.ts`)
- Modeler → Threat library settings: customizes libraries (evidence: `README.md`)
- Modeler → Security references: consults references (evidence: `README.md`)
- Modeler → Results dashboard: reviews results (evidence: `README.md`)
- Modeler → Reports and exports: exports reports (evidence: `README.md`)
- Project model → Reports and exports: provides project data
