# iyadeh/attackmap architecture

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

- Interactive diagram: https://gitdiagram.com/iyadeh/attackmap
- Repository: https://github.com/iyadeh/attackmap

## Overview

AttackMap is a project-based architecture modeling and security-review application. Users create or open a project, model services and connections, inspect security findings, and review a project security summary. The visible model includes architecture editing, security analysis and triage, overview aggregation, and database persistence. The README is only the Next.js starter template, and several route/workspace implementations were not sampled, so uncertain wiring between those subsystems is omitted.

Main entry points: [`src/app/actions.ts`](https://github.com/iyadeh/attackmap/blob/main/src/app/actions.ts) (Server actions), [`src/components/architecture/architecture-workspace.tsx`](https://github.com/iyadeh/attackmap/blob/main/src/components/architecture/architecture-workspace.tsx) (Architecture workspace), [`src/lib/db/client.ts`](https://github.com/iyadeh/attackmap/blob/main/src/lib/db/client.ts) (Database client), [`src/lib/overview/project-security-overview.ts`](https://github.com/iyadeh/attackmap/blob/main/src/lib/overview/project-security-overview.ts) (Overview aggregation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_projects["Project management"]
  node_projects_page["Projects route<br/>[page.tsx]"]
  node_projects_view["Projects view<br/>[projects-view.tsx]"]
  node_detail_page["Project route<br/>[page.tsx]"]
end

subgraph group_modeling["Architecture modeling"]
  node_workspace["Architecture workspace"]
  node_canvas["Architecture canvas"]
  node_palette["Component palette"]
  node_service_inspector["Service inspector"]
  node_service_factory["Service factory<br/>[service-factory.ts]"]
  node_autosave["Autosave coordinator"]
end

subgraph group_security["Security review"]
  node_findings["Finding review<br/>[findings-view.tsx]"]
  node_risk_engine["Risk analysis<br/>[engine.ts]"]
  node_rules["Security rules<br/>[rules.ts]"]
  node_scoring["Security scoring<br/>[scoring.ts]"]
  node_dispositions["Finding triage"]
  node_overview_view["Security overview"]
  node_overview_summary["Overview aggregation"]
end

subgraph group_persistence["Persistence"]
  node_actions["Server actions<br/>[actions.ts]"]
  node_project_store["Project persistence"]
  node_architecture_store["Architecture persistence"]
  node_disposition_store["Disposition persistence"]
  node_db_client["Database client<br/>[client.ts]"]
  node_db_schema["Database schema<br/>[schema.ts]"]
end

node_user(("User"))
node_postgres[("PostgreSQL")]

node_user -->|"opens"| node_projects_page
node_projects_page -->|"renders"| node_projects_view
node_projects_view -->|"creates project"| node_actions
node_actions -->|"manages projects"| node_project_store
node_project_store -->|"queries"| node_db_client
node_detail_page -->|"renders"| node_workspace
node_user -->|"edits architecture"| node_workspace
node_workspace -->|"renders"| node_canvas
node_workspace -->|"renders"| node_palette
node_workspace -->|"renders"| node_service_inspector
node_palette -->|"creates services"| node_service_factory
node_workspace -->|"saves changes"| node_autosave
node_autosave -->|"requests save"| node_actions
node_detail_page -->|"loads project"| node_actions
node_actions -->|"loads or saves"| node_architecture_store
node_architecture_store -->|"queries"| node_db_client
node_actions -->|"manages dispositions"| node_disposition_store
node_disposition_store -->|"queries"| node_db_client
node_findings -->|"triages findings"| node_dispositions
node_findings -->|"accepts or reopens"| node_actions
node_risk_engine -->|"evaluates rules"| node_rules
node_overview_summary -->|"analyzes architecture"| node_risk_engine
node_overview_summary -->|"scores findings"| node_scoring
node_overview_summary -->|"counts triage"| node_dispositions
node_overview_view -->|"presents summary"| node_overview_summary
node_db_client -->|"uses schema"| node_db_schema
node_db_client -->|"connects"| node_postgres

click node_projects_page "https://github.com/iyadeh/attackmap/blob/main/src/app/projects/page.tsx"
click node_projects_view "https://github.com/iyadeh/attackmap/blob/main/src/components/projects/projects-view.tsx"
click node_detail_page "https://github.com/iyadeh/attackmap/blob/main/src/app/projects/%5BprojectId%5D/page.tsx"
click node_actions "https://github.com/iyadeh/attackmap/blob/main/src/app/actions.ts"
click node_project_store "https://github.com/iyadeh/attackmap/blob/main/src/lib/db/project-persistence.ts"
click node_workspace "https://github.com/iyadeh/attackmap/blob/main/src/components/architecture/architecture-workspace.tsx"
click node_canvas "https://github.com/iyadeh/attackmap/blob/main/src/components/architecture/architecture-canvas.tsx"
click node_palette "https://github.com/iyadeh/attackmap/blob/main/src/components/architecture/component-palette.tsx"
click node_service_inspector "https://github.com/iyadeh/attackmap/blob/main/src/components/architecture/service-inspector.tsx"
click node_service_factory "https://github.com/iyadeh/attackmap/blob/main/src/lib/architecture/service-factory.ts"
click node_autosave "https://github.com/iyadeh/attackmap/blob/main/src/lib/architecture/autosave-coordinator.ts"
click node_architecture_store "https://github.com/iyadeh/attackmap/blob/main/src/lib/db/architecture-persistence.ts"
click node_findings "https://github.com/iyadeh/attackmap/blob/main/src/components/findings/findings-view.tsx"
click node_risk_engine "https://github.com/iyadeh/attackmap/blob/main/src/lib/risk-engine/engine.ts"
click node_rules "https://github.com/iyadeh/attackmap/blob/main/src/lib/risk-engine/rules.ts"
click node_scoring "https://github.com/iyadeh/attackmap/blob/main/src/lib/risk-engine/scoring.ts"
click node_dispositions "https://github.com/iyadeh/attackmap/blob/main/src/lib/findings/finding-dispositions.ts"
click node_disposition_store "https://github.com/iyadeh/attackmap/blob/main/src/lib/db/finding-disposition-persistence.ts"
click node_overview_view "https://github.com/iyadeh/attackmap/blob/main/src/components/overview/project-security-overview.tsx"
click node_overview_summary "https://github.com/iyadeh/attackmap/blob/main/src/lib/overview/project-security-overview.ts"
click node_db_client "https://github.com/iyadeh/attackmap/blob/main/src/lib/db/client.ts"
click node_db_schema "https://github.com/iyadeh/attackmap/blob/main/src/lib/db/schema.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_projects_page,node_projects_view,node_detail_page,node_user toneBlue
class node_workspace,node_canvas,node_palette,node_service_inspector,node_service_factory,node_autosave,node_postgres toneAmber
class node_findings,node_risk_engine,node_rules,node_scoring,node_dispositions,node_overview_view,node_overview_summary toneMint
class node_actions,node_project_store,node_architecture_store,node_disposition_store,node_db_client,node_db_schema toneRose
```

## Components

### Project management

- [Projects route](https://github.com/iyadeh/attackmap/blob/main/src/app/projects/page.tsx): `src/app/projects/page.tsx`
- [Projects view](https://github.com/iyadeh/attackmap/blob/main/src/components/projects/projects-view.tsx): `src/components/projects/projects-view.tsx`
- [Project route](https://github.com/iyadeh/attackmap/blob/main/src/app/projects/%5BprojectId%5D/page.tsx): `src/app/projects/[projectId]/page.tsx`

### Architecture modeling

- [Architecture workspace](https://github.com/iyadeh/attackmap/blob/main/src/components/architecture/architecture-workspace.tsx): `src/components/architecture/architecture-workspace.tsx`
- [Architecture canvas](https://github.com/iyadeh/attackmap/blob/main/src/components/architecture/architecture-canvas.tsx): `src/components/architecture/architecture-canvas.tsx`
- [Component palette](https://github.com/iyadeh/attackmap/blob/main/src/components/architecture/component-palette.tsx): `src/components/architecture/component-palette.tsx`
- [Service inspector](https://github.com/iyadeh/attackmap/blob/main/src/components/architecture/service-inspector.tsx): `src/components/architecture/service-inspector.tsx`
- [Service factory](https://github.com/iyadeh/attackmap/blob/main/src/lib/architecture/service-factory.ts): `src/lib/architecture/service-factory.ts`
- [Autosave coordinator](https://github.com/iyadeh/attackmap/blob/main/src/lib/architecture/autosave-coordinator.ts): `src/lib/architecture/autosave-coordinator.ts`

### Security review

- [Finding review](https://github.com/iyadeh/attackmap/blob/main/src/components/findings/findings-view.tsx): `src/components/findings/findings-view.tsx`
- [Risk analysis](https://github.com/iyadeh/attackmap/blob/main/src/lib/risk-engine/engine.ts): `src/lib/risk-engine/engine.ts`
- [Security rules](https://github.com/iyadeh/attackmap/blob/main/src/lib/risk-engine/rules.ts): `src/lib/risk-engine/rules.ts`
- [Security scoring](https://github.com/iyadeh/attackmap/blob/main/src/lib/risk-engine/scoring.ts): `src/lib/risk-engine/scoring.ts`
- [Finding triage](https://github.com/iyadeh/attackmap/blob/main/src/lib/findings/finding-dispositions.ts): `src/lib/findings/finding-dispositions.ts`
- [Security overview](https://github.com/iyadeh/attackmap/blob/main/src/components/overview/project-security-overview.tsx): `src/components/overview/project-security-overview.tsx`
- [Overview aggregation](https://github.com/iyadeh/attackmap/blob/main/src/lib/overview/project-security-overview.ts): `src/lib/overview/project-security-overview.ts`

### Persistence

- [Server actions](https://github.com/iyadeh/attackmap/blob/main/src/app/actions.ts): `src/app/actions.ts`
- [Project persistence](https://github.com/iyadeh/attackmap/blob/main/src/lib/db/project-persistence.ts): `src/lib/db/project-persistence.ts`
- [Architecture persistence](https://github.com/iyadeh/attackmap/blob/main/src/lib/db/architecture-persistence.ts): `src/lib/db/architecture-persistence.ts`
- [Disposition persistence](https://github.com/iyadeh/attackmap/blob/main/src/lib/db/finding-disposition-persistence.ts): `src/lib/db/finding-disposition-persistence.ts`
- [Database client](https://github.com/iyadeh/attackmap/blob/main/src/lib/db/client.ts): `src/lib/db/client.ts`
- [Database schema](https://github.com/iyadeh/attackmap/blob/main/src/lib/db/schema.ts): `src/lib/db/schema.ts`

### Other components

- **User**
- **PostgreSQL**

## Connections

- User → Projects route: opens
- Projects route → Projects view: renders
- Projects view → Server actions: creates project
- Server actions → Project persistence: manages projects
- Project persistence → Database client: queries
- Project route → Architecture workspace: renders
- User → Architecture workspace: edits architecture
- Architecture workspace → Architecture canvas: renders
- Architecture workspace → Component palette: renders
- Architecture workspace → Service inspector: renders
- Component palette → Service factory: creates services
- Architecture workspace → Autosave coordinator: saves changes
- Autosave coordinator → Server actions: requests save
- Project route → Server actions: loads project
- Server actions → Architecture persistence: loads or saves
- Architecture persistence → Database client: queries
- Server actions → Disposition persistence: manages dispositions
- Disposition persistence → Database client: queries
- Finding review → Finding triage: triages findings
- Finding review → Server actions: accepts or reopens
- Risk analysis → Security rules: evaluates rules
- Overview aggregation → Risk analysis: analyzes architecture
- Overview aggregation → Security scoring: scores findings
- Overview aggregation → Finding triage: counts triage
- Security overview → Overview aggregation: presents summary
- Database client → Database schema: uses schema
- Database client → PostgreSQL: connects
