# pierre-mzuafo/secureapp architecture

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

- Interactive diagram: https://gitdiagram.com/pierre-mzuafo/secureapp
- Repository: https://github.com/pierre-mzuafo/secureapp

## Overview

SecureApp is a small FastAPI item API and a DevSecOps pipeline demonstrator. A client calls the API’s health and item endpoints; Pydantic validates item input, while the CRUD handlers read and write an in-memory store. The README documents a GitHub Actions pipeline for linting, tests, Python security audits, Docker builds, and Trivy image scans. Pipeline details are based on the README; the workflow and Dockerfile contents were not sampled.

Main entry points: [`.github/workflows/ci-cd.yml`](https://github.com/pierre-mzuafo/secureapp/blob/main/.github/workflows/ci-cd.yml) (CI workflow), [`app/main.py`](https://github.com/pierre-mzuafo/secureapp/blob/main/app/main.py) (FastAPI app), [`Dockerfile`](https://github.com/pierre-mzuafo/secureapp/blob/main/Dockerfile) (Docker build)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API runtime"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_health["Health check<br/>[main.py]"]
  node_items["Item endpoints<br/>[main.py]"]
  node_item_model["Item model<br/>[main.py]"]
  node_item_store[("In-memory store<br/>[main.py]")]
end

subgraph group_devsecops["DevSecOps pipeline"]
  node_workflow["CI workflow<br/>[ci-cd.yml]"]
  node_quality_security["Lint and audits<br/>[ci-cd.yml]"]
  node_tests["Unit tests<br/>[ci-cd.yml]"]
  node_docker_build["Docker build"]
  node_trivy["Trivy scan<br/>[ci-cd.yml]"]
end

node_client(("API client"))

node_client -->|"calls"| node_api_app
node_api_app -->|"dispatches"| node_health
node_api_app -->|"dispatches"| node_items
node_items -->|"validates"| node_item_model
node_items -->|"reads and writes"| node_item_store
node_workflow -->|"runs"| node_quality_security
node_workflow -->|"runs"| node_tests
node_workflow -->|"builds"| node_docker_build
node_workflow -->|"scans image"| node_trivy
node_docker_build -->|"produces image"| node_trivy

click node_api_app "https://github.com/pierre-mzuafo/secureapp/blob/main/app/main.py"
click node_health "https://github.com/pierre-mzuafo/secureapp/blob/main/app/main.py"
click node_items "https://github.com/pierre-mzuafo/secureapp/blob/main/app/main.py"
click node_item_model "https://github.com/pierre-mzuafo/secureapp/blob/main/app/main.py"
click node_item_store "https://github.com/pierre-mzuafo/secureapp/blob/main/app/main.py"
click node_workflow "https://github.com/pierre-mzuafo/secureapp/blob/main/.github/workflows/ci-cd.yml"
click node_quality_security "https://github.com/pierre-mzuafo/secureapp/blob/main/.github/workflows/ci-cd.yml"
click node_tests "https://github.com/pierre-mzuafo/secureapp/blob/main/.github/workflows/ci-cd.yml"
click node_docker_build "https://github.com/pierre-mzuafo/secureapp/blob/main/Dockerfile"
click node_trivy "https://github.com/pierre-mzuafo/secureapp/blob/main/.github/workflows/ci-cd.yml"

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_api_app,node_health,node_items,node_item_model,node_item_store,node_client toneBlue
class node_workflow,node_quality_security,node_tests,node_docker_build,node_trivy toneAmber
```

## Components

### API runtime

- [FastAPI app](https://github.com/pierre-mzuafo/secureapp/blob/main/app/main.py): `app/main.py`
- [Health check](https://github.com/pierre-mzuafo/secureapp/blob/main/app/main.py): `app/main.py`
- [Item endpoints](https://github.com/pierre-mzuafo/secureapp/blob/main/app/main.py): `app/main.py`
- [Item model](https://github.com/pierre-mzuafo/secureapp/blob/main/app/main.py): `app/main.py`
- [In-memory store](https://github.com/pierre-mzuafo/secureapp/blob/main/app/main.py): `app/main.py`

### DevSecOps pipeline

- [CI workflow](https://github.com/pierre-mzuafo/secureapp/blob/main/.github/workflows/ci-cd.yml): `.github/workflows/ci-cd.yml`
- [Lint and audits](https://github.com/pierre-mzuafo/secureapp/blob/main/.github/workflows/ci-cd.yml): `.github/workflows/ci-cd.yml`
- [Unit tests](https://github.com/pierre-mzuafo/secureapp/blob/main/.github/workflows/ci-cd.yml): `.github/workflows/ci-cd.yml`
- [Docker build](https://github.com/pierre-mzuafo/secureapp/blob/main/Dockerfile): `Dockerfile`
- [Trivy scan](https://github.com/pierre-mzuafo/secureapp/blob/main/.github/workflows/ci-cd.yml): `.github/workflows/ci-cd.yml`

### Other components

- **API client**

## Connections

- API client → FastAPI app: calls
- FastAPI app → Health check: dispatches
- FastAPI app → Item endpoints: dispatches
- Item endpoints → Item model: validates
- Item endpoints → In-memory store: reads and writes
- CI workflow → Lint and audits: runs
- CI workflow → Unit tests: runs
- CI workflow → Docker build: builds
- CI workflow → Trivy scan: scans image
- Docker build → Trivy scan: produces image
