# cigeke/somara-devsecops-platform architecture

> Architecture diagram of the GitHub repository cigeke/somara-devsecops-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cigeke/somara-devsecops-platform
- Repository: https://github.com/cigeke/somara-devsecops-platform

## Overview

SOMARA is a small FastAPI service presented as part of a broader DevSecOps platform. The documented workflow runs tests and security checks, builds and scans a container, publishes and deploys it, then checks service health and monitors production. The repository excerpt confirms the API’s health and root endpoints, security-header middleware, and Prometheus instrumentation. CI, deployment, rollback, DAST, and alerting are documented capabilities, but their implementation is not shown in the sampled source.

Main entry points: [`.github/workflows/devsecops.yml`](https://github.com/cigeke/somara-devsecops-platform/blob/main/.github/workflows/devsecops.yml) (CI/CD workflow), [`app/backend/main.py`](https://github.com/cigeke/somara-devsecops-platform/blob/main/app/backend/main.py) (FastAPI service), [`app/backend/test_main.py`](https://github.com/cigeke/somara-devsecops-platform/blob/main/app/backend/test_main.py) (Automated tests), [`app/backend/Dockerfile`](https://github.com/cigeke/somara-devsecops-platform/blob/main/app/backend/Dockerfile) (Container build)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_delivery["CI and Security"]
  node_actions["CI/CD workflow<br/>[devsecops.yml]"]
  node_source_scans["Source security scans<br/>[devsecops.yml]"]
  node_tests["Automated tests<br/>[test_main.py]"]
  node_container_build["Container build"]
  node_container_scan["Container scan<br/>[devsecops.yml]"]
  node_registry["GHCR registry"]
end

subgraph group_runtime["Application Runtime"]
  node_api["FastAPI service<br/>[main.py]"]
  node_security_middleware["Security headers<br/>[main.py]"]
  node_metrics["Metrics instrumentation<br/>[main.py]"]
  node_health_check["Health check<br/>[main.py]"]
end

subgraph group_operations["Production Operations"]
  node_hosting["Daruur hosting"]
  node_health_gate["Deployment health check"]
  node_rollback["Automatic rollback"]
  node_dast["Dynamic security test"]
  node_monitoring["Production monitoring"]
  node_alerting["Email alerting"]
end

node_developer(("Developer"))
node_github["GitHub repository"]

node_developer -->|"pushes code"| node_github
node_github -->|"triggers"| node_actions
node_actions -->|"runs scans"| node_source_scans
node_actions -->|"runs tests"| node_tests
node_actions -->|"builds image"| node_container_build
node_actions -->|"scans image"| node_container_scan
node_actions -->|"publishes image"| node_registry
node_registry -->|"supplies image"| node_hosting
node_hosting -->|"runs service"| node_api
node_api -->|"registers"| node_security_middleware
node_api -->|"instruments"| node_metrics
node_actions -->|"checks deployment"| node_health_gate
node_health_gate -->|"probes endpoint"| node_health_check
node_health_gate -->|"triggers if unhealthy"| node_rollback
node_hosting -->|"is tested by"| node_dast
node_api -->|"exports metrics"| node_monitoring
node_monitoring -->|"sends alerts"| node_alerting

click node_actions "https://github.com/cigeke/somara-devsecops-platform/blob/main/.github/workflows/devsecops.yml"
click node_source_scans "https://github.com/cigeke/somara-devsecops-platform/blob/main/.github/workflows/devsecops.yml"
click node_tests "https://github.com/cigeke/somara-devsecops-platform/blob/main/app/backend/test_main.py"
click node_container_build "https://github.com/cigeke/somara-devsecops-platform/blob/main/app/backend/Dockerfile"
click node_container_scan "https://github.com/cigeke/somara-devsecops-platform/blob/main/.github/workflows/devsecops.yml"
click node_api "https://github.com/cigeke/somara-devsecops-platform/blob/main/app/backend/main.py"
click node_security_middleware "https://github.com/cigeke/somara-devsecops-platform/blob/main/app/backend/main.py"
click node_metrics "https://github.com/cigeke/somara-devsecops-platform/blob/main/app/backend/main.py"
click node_health_check "https://github.com/cigeke/somara-devsecops-platform/blob/main/app/backend/main.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_actions,node_source_scans,node_tests,node_container_build,node_container_scan,node_registry toneBlue
class node_api,node_security_middleware,node_metrics,node_health_check toneAmber
class node_hosting,node_health_gate,node_rollback,node_dast,node_monitoring,node_alerting toneMint
class node_developer,node_github toneIndigo
```

## Components

### CI and Security

- [CI/CD workflow](https://github.com/cigeke/somara-devsecops-platform/blob/main/.github/workflows/devsecops.yml): `.github/workflows/devsecops.yml`
- [Source security scans](https://github.com/cigeke/somara-devsecops-platform/blob/main/.github/workflows/devsecops.yml): `.github/workflows/devsecops.yml`
- [Automated tests](https://github.com/cigeke/somara-devsecops-platform/blob/main/app/backend/test_main.py): `app/backend/test_main.py`
- [Container build](https://github.com/cigeke/somara-devsecops-platform/blob/main/app/backend/Dockerfile): `app/backend/Dockerfile`
- [Container scan](https://github.com/cigeke/somara-devsecops-platform/blob/main/.github/workflows/devsecops.yml): `.github/workflows/devsecops.yml`
- **GHCR registry**

### Application Runtime

- [FastAPI service](https://github.com/cigeke/somara-devsecops-platform/blob/main/app/backend/main.py): `app/backend/main.py`
- [Security headers](https://github.com/cigeke/somara-devsecops-platform/blob/main/app/backend/main.py): `app/backend/main.py`
- [Metrics instrumentation](https://github.com/cigeke/somara-devsecops-platform/blob/main/app/backend/main.py): `app/backend/main.py`
- [Health check](https://github.com/cigeke/somara-devsecops-platform/blob/main/app/backend/main.py): `app/backend/main.py`

### Production Operations

- **Daruur hosting**
- **Deployment health check**
- **Automatic rollback**
- **Dynamic security test**
- **Production monitoring**
- **Email alerting**

### Other components

- **Developer**
- **GitHub repository**

## Connections

- Developer → GitHub repository: pushes code (evidence: `README.md`)
- GitHub repository → CI/CD workflow: triggers (evidence: `README.md`)
- CI/CD workflow → Source security scans: runs scans (evidence: `README.md`)
- CI/CD workflow → Automated tests: runs tests (evidence: `README.md`)
- CI/CD workflow → Container build: builds image (evidence: `README.md`)
- CI/CD workflow → Container scan: scans image (evidence: `README.md`)
- CI/CD workflow → GHCR registry: publishes image (evidence: `README.md`)
- GHCR registry → Daruur hosting: supplies image (evidence: `README.md`)
- Daruur hosting → FastAPI service: runs service (evidence: `README.md`)
- FastAPI service → Security headers: registers (evidence: `app/backend/main.py`)
- FastAPI service → Metrics instrumentation: instruments (evidence: `app/backend/main.py`)
- CI/CD workflow → Deployment health check: checks deployment (evidence: `README.md`)
- Deployment health check → Health check: probes endpoint (evidence: `README.md`)
- Deployment health check → Automatic rollback: triggers if unhealthy (evidence: `README.md`)
- Daruur hosting → Dynamic security test: is tested by (evidence: `README.md`)
- FastAPI service → Production monitoring: exports metrics (evidence: `README.md`)
- Production monitoring → Email alerting: sends alerts (evidence: `README.md`)
