# sachinkondawar/containershield architecture

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

- Interactive diagram: https://gitdiagram.com/sachinkondawar/containershield
- Repository: https://github.com/sachinkondawar/containershield

## Overview

ContainerShield is a security dashboard for Docker inventory, image and source-code scanning, scan history, and AI-assisted interpretation of findings. The main workflow is: users inspect their Docker host or start a scan; the frontend calls the backend API; scan findings and history are returned for review, and the assistant answers questions grounded in stored findings. The provided tree contains only the frontend, so backend services and integrations are represented from README documentation, not sampled source.

Main entry points: [`frontend/src/App.jsx`](https://github.com/sachinkondawar/containershield/blob/main/frontend/src/App.jsx) (Routes and providers), [`frontend/src/services/dockerService.js`](https://github.com/sachinkondawar/containershield/blob/main/frontend/src/services/dockerService.js) (Docker API client), [`frontend/src/pages/NewScan.jsx`](https://github.com/sachinkondawar/containershield/blob/main/frontend/src/pages/NewScan.jsx) (Image scan setup), [`frontend/src/pages/Dashboard.jsx`](https://github.com/sachinkondawar/containershield/blob/main/frontend/src/pages/Dashboard.jsx) (Security dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Application shell"]
  node_app["Routes and providers<br/>[App.jsx]"]
  node_dashboard["Security dashboard<br/>[Dashboard.jsx]"]
end

subgraph group_inventory["Docker inventory"]
  node_docker_pages["Container and image views<br/>[Containers.jsx]"]
  node_docker_details["Inventory details"]
  node_docker_service["Docker API client<br/>[dockerService.js]"]
end

subgraph group_image_scanning["Image scanning"]
  node_new_scan["Image scan setup<br/>[NewScan.jsx]"]
  node_trivy_service["Trivy API client<br/>[trivyService.js]"]
  node_manifest["Manifest matching<br/>[trivyService.js]"]
end

subgraph group_source_assistant["Source and assistant"]
  node_source_scanner["Source scanner<br/>[SourceScanner.jsx]"]
  node_semgrep_service["Semgrep API client<br/>[semgrepService.js]"]
  node_assistant["Security assistant<br/>[Assistant.jsx]"]
  node_chat_service["Chat API client<br/>[chatService.js]"]
end

subgraph group_scan_data["Scan results"]
  node_history["Scan history and details<br/>[ScanHistory.jsx]"]
  node_scan_service["Scan history API client<br/>[scanService.js]"]
end

node_user(("Security operator"))
node_backend{{"Spring Boot API"}}
node_trivy["Trivy scanner"]
node_semgrep["Semgrep scanner"]
node_ollama["Ollama model"]
node_postgres[("PostgreSQL")]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_docker_pages
node_app -->|"routes to"| node_docker_details
node_app -->|"routes to"| node_new_scan
node_app -->|"routes to"| node_source_scanner
node_app -->|"routes to"| node_assistant
node_app -->|"routes to"| node_history
node_dashboard -->|"requests inventory"| node_docker_service
node_dashboard -->|"requests summaries"| node_scan_service
node_docker_pages -->|"requests inventory"| node_docker_service
node_docker_details -->|"requests details"| node_docker_service
node_new_scan -->|"loads images"| node_docker_service
node_new_scan -->|"starts scan"| node_trivy_service
node_new_scan -->|"submits manifest"| node_manifest
node_manifest -->|"posts scan and file"| node_backend
node_trivy_service -->|"requests image scan"| node_backend
node_docker_service -->|"requests Docker data"| node_backend
node_source_scanner -->|"starts source scan"| node_semgrep_service
node_semgrep_service -->|"requests source scan"| node_backend
node_assistant -->|"asks question"| node_chat_service
node_chat_service -->|"sends chat request"| node_backend
node_history -->|"loads scan records"| node_scan_service
node_scan_service -->|"requests history"| node_backend
node_backend -->|"runs image analysis"| node_trivy
node_backend -->|"runs source analysis"| node_semgrep
node_backend -->|"requests grounded answer"| node_ollama
node_backend -->|"stores and reads findings"| node_postgres

click node_app "https://github.com/sachinkondawar/containershield/blob/main/frontend/src/App.jsx"
click node_dashboard "https://github.com/sachinkondawar/containershield/blob/main/frontend/src/pages/Dashboard.jsx"
click node_docker_pages "https://github.com/sachinkondawar/containershield/blob/main/frontend/src/pages/Containers.jsx"
click node_docker_details "https://github.com/sachinkondawar/containershield/blob/main/frontend/src/pages/ContainerDetails.jsx"
click node_docker_service "https://github.com/sachinkondawar/containershield/blob/main/frontend/src/services/dockerService.js"
click node_new_scan "https://github.com/sachinkondawar/containershield/blob/main/frontend/src/pages/NewScan.jsx"
click node_trivy_service "https://github.com/sachinkondawar/containershield/blob/main/frontend/src/services/trivyService.js"
click node_manifest "https://github.com/sachinkondawar/containershield/blob/main/frontend/src/services/trivyService.js"
click node_source_scanner "https://github.com/sachinkondawar/containershield/blob/main/frontend/src/pages/SourceScanner.jsx"
click node_semgrep_service "https://github.com/sachinkondawar/containershield/blob/main/frontend/src/services/semgrepService.js"
click node_assistant "https://github.com/sachinkondawar/containershield/blob/main/frontend/src/pages/Assistant.jsx"
click node_chat_service "https://github.com/sachinkondawar/containershield/blob/main/frontend/src/services/chatService.js"
click node_history "https://github.com/sachinkondawar/containershield/blob/main/frontend/src/pages/ScanHistory.jsx"
click node_scan_service "https://github.com/sachinkondawar/containershield/blob/main/frontend/src/services/scanService.js"

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_dashboard toneBlue
class node_docker_pages,node_docker_details,node_docker_service,node_postgres toneAmber
class node_new_scan,node_trivy_service,node_manifest,node_backend toneMint
class node_source_scanner,node_semgrep_service,node_assistant,node_chat_service toneRose
class node_history,node_scan_service,node_user,node_trivy,node_semgrep,node_ollama toneIndigo
```

## Components

### Application shell

- [Routes and providers](https://github.com/sachinkondawar/containershield/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Security dashboard](https://github.com/sachinkondawar/containershield/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`

### Docker inventory

- [Container and image views](https://github.com/sachinkondawar/containershield/blob/main/frontend/src/pages/Containers.jsx): `frontend/src/pages/Containers.jsx`
- [Inventory details](https://github.com/sachinkondawar/containershield/blob/main/frontend/src/pages/ContainerDetails.jsx): `frontend/src/pages/ContainerDetails.jsx`
- [Docker API client](https://github.com/sachinkondawar/containershield/blob/main/frontend/src/services/dockerService.js): `frontend/src/services/dockerService.js`

### Image scanning

- [Image scan setup](https://github.com/sachinkondawar/containershield/blob/main/frontend/src/pages/NewScan.jsx): `frontend/src/pages/NewScan.jsx`
- [Trivy API client](https://github.com/sachinkondawar/containershield/blob/main/frontend/src/services/trivyService.js): `frontend/src/services/trivyService.js`
- [Manifest matching](https://github.com/sachinkondawar/containershield/blob/main/frontend/src/services/trivyService.js): `frontend/src/services/trivyService.js`

### Source and assistant

- [Source scanner](https://github.com/sachinkondawar/containershield/blob/main/frontend/src/pages/SourceScanner.jsx): `frontend/src/pages/SourceScanner.jsx`
- [Semgrep API client](https://github.com/sachinkondawar/containershield/blob/main/frontend/src/services/semgrepService.js): `frontend/src/services/semgrepService.js`
- [Security assistant](https://github.com/sachinkondawar/containershield/blob/main/frontend/src/pages/Assistant.jsx): `frontend/src/pages/Assistant.jsx`
- [Chat API client](https://github.com/sachinkondawar/containershield/blob/main/frontend/src/services/chatService.js): `frontend/src/services/chatService.js`

### Scan results

- [Scan history and details](https://github.com/sachinkondawar/containershield/blob/main/frontend/src/pages/ScanHistory.jsx): `frontend/src/pages/ScanHistory.jsx`
- [Scan history API client](https://github.com/sachinkondawar/containershield/blob/main/frontend/src/services/scanService.js): `frontend/src/services/scanService.js`

### Other components

- **Security operator**
- **Spring Boot API**
- **Trivy scanner**
- **Semgrep scanner**
- **Ollama model**
- **PostgreSQL**

## Connections

- Security operator → Routes and providers: uses
- Routes and providers → Security dashboard: routes to
- Routes and providers → Container and image views: routes to
- Routes and providers → Inventory details: routes to
- Routes and providers → Image scan setup: routes to
- Routes and providers → Source scanner: routes to
- Routes and providers → Security assistant: routes to
- Routes and providers → Scan history and details: routes to
- Security dashboard → Docker API client: requests inventory
- Security dashboard → Scan history API client: requests summaries
- Container and image views → Docker API client: requests inventory
- Inventory details → Docker API client: requests details
- Image scan setup → Docker API client: loads images
- Image scan setup → Trivy API client: starts scan
- Image scan setup → Manifest matching: submits manifest
- Manifest matching → Spring Boot API: posts scan and file
- Trivy API client → Spring Boot API: requests image scan
- Docker API client → Spring Boot API: requests Docker data
- Source scanner → Semgrep API client: starts source scan
- Semgrep API client → Spring Boot API: requests source scan
- Security assistant → Chat API client: asks question
- Chat API client → Spring Boot API: sends chat request
- Scan history and details → Scan history API client: loads scan records
- Scan history API client → Spring Boot API: requests history
- Spring Boot API → Trivy scanner: runs image analysis
- Spring Boot API → Semgrep scanner: runs source analysis
- Spring Boot API → Ollama model: requests grounded answer
- Spring Boot API → PostgreSQL: stores and reads findings
