# hayder-ben-abdelhamid/nextwork-security-secretsmanager architecture

> Architecture diagram of the GitHub repository hayder-ben-abdelhamid/nextwork-security-secretsmanager, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hayder-ben-abdelhamid/nextwork-security-secretsmanager
- Repository: https://github.com/hayder-ben-abdelhamid/nextwork-security-secretsmanager

## Overview

This is a small FastAPI demonstration app for retrieving AWS credentials from Secrets Manager and using them to list S3 buckets. The main runtime path is a request to the bucket endpoint, which uses credentials loaded by config.py and returns bucket names or an error. A separate route serves the landing page, and the app mounts static assets. The README also describes secret rotation and Git history cleanup as learning topics; no runtime implementation of those workflows is shown. Relationships below are grounded in the sampled source.

Main entry points: [`app.py`](https://github.com/hayder-ben-abdelhamid/nextwork-security-secretsmanager/blob/main/app.py) (FastAPI routes), [`config.py`](https://github.com/hayder-ben-abdelhamid/nextwork-security-secretsmanager/blob/main/config.py) (Credential config), [`index.html`](https://github.com/hayder-ben-abdelhamid/nextwork-security-secretsmanager/blob/main/index.html) (Landing page), [`static/style.css`](https://github.com/hayder-ben-abdelhamid/nextwork-security-secretsmanager/blob/main/static/style.css) (Static stylesheet)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web app"]
  node_app["FastAPI routes<br/>[app.py]"]
  node_landing["Landing page<br/>[index.html]"]
  node_styles["Static stylesheet<br/>[style.css]"]
end

subgraph group_credentials["Credentials"]
  node_config["Credential config<br/>[config.py]"]
end

subgraph group_aws["AWS resources"]
  node_secrets["Secrets Manager"]
  node_s3[("S3 buckets")]
end

node_user(("Web user"))

node_user -->|"sends requests"| node_app
node_app -->|"reads page"| node_landing
node_app -->|"serves responses"| node_user
node_app -->|"mounts static files"| node_styles
node_app -->|"reads credentials"| node_config
node_config -->|"retrieves secret"| node_secrets
node_app -->|"lists buckets"| node_s3
node_s3 -->|"returns bucket data"| node_app

click node_app "https://github.com/hayder-ben-abdelhamid/nextwork-security-secretsmanager/blob/main/app.py"
click node_landing "https://github.com/hayder-ben-abdelhamid/nextwork-security-secretsmanager/blob/main/index.html"
click node_styles "https://github.com/hayder-ben-abdelhamid/nextwork-security-secretsmanager/blob/main/static/style.css"
click node_config "https://github.com/hayder-ben-abdelhamid/nextwork-security-secretsmanager/blob/main/config.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_app,node_landing,node_styles,node_user toneBlue
class node_config toneAmber
class node_secrets,node_s3 toneMint
```

## Components

### Web app

- [FastAPI routes](https://github.com/hayder-ben-abdelhamid/nextwork-security-secretsmanager/blob/main/app.py): `app.py`
- [Landing page](https://github.com/hayder-ben-abdelhamid/nextwork-security-secretsmanager/blob/main/index.html): `index.html`
- [Static stylesheet](https://github.com/hayder-ben-abdelhamid/nextwork-security-secretsmanager/blob/main/static/style.css): `static/style.css`

### Credentials

- [Credential config](https://github.com/hayder-ben-abdelhamid/nextwork-security-secretsmanager/blob/main/config.py): `config.py`

### AWS resources

- **Secrets Manager**
- **S3 buckets**

### Other components

- **Web user**

## Connections

- Web user → FastAPI routes: sends requests (evidence: `app.py`)
- FastAPI routes → Landing page: reads page (evidence: `app.py`)
- FastAPI routes → Web user: serves responses (evidence: `app.py`)
- FastAPI routes → Static stylesheet: mounts static files (evidence: `app.py`)
- FastAPI routes → Credential config: reads credentials (evidence: `app.py`)
- Credential config → Secrets Manager: retrieves secret (evidence: `config.py`)
- FastAPI routes → S3 buckets: lists buckets (evidence: `app.py`)
- S3 buckets → FastAPI routes: returns bucket data (evidence: `app.py`)
