# neddy2000/fastapi-idp-lite architecture

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

- Interactive diagram: https://gitdiagram.com/neddy2000/fastapi-idp-lite
- Repository: https://github.com/neddy2000/fastapi-idp-lite

## Overview

This is a lightweight IDP-style control plane for deploying temporary, isolated static HTML previews. A client submits a project name, HTML, and optional TTL to the FastAPI API; deployment provisions a per-project Nginx container and gateway routing, then returns a preview URL. Clients can list or manually remove projects, while a background cleaner removes expired deployments. The README documents the major runtime capabilities; sampled source confirms request schemas and some handler and cleanup calls, but deployment internals are only partially excerpted.

Main entry points: [`app/main.py`](https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/main.py) (Deploy Orchestration), [`nginx/conf.d/sites`](https://github.com/neddy2000/fastapi-idp-lite/tree/main/nginx/conf.d/sites) (Site Route Configs), [`app/schemas.py`](https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/schemas.py) (Request Schemas), [`nginx/default.conf`](https://github.com/neddy2000/fastapi-idp-lite/blob/main/nginx/default.conf) (Gateway Config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Control API"]
  node_deploy_api["Deploy Endpoint<br/>[main.py]"]
  node_project_api["Project Listing<br/>[main.py]"]
  node_undeploy_api["Undeploy Endpoint<br/>[main.py]"]
  node_schemas["Request Schemas<br/>[schemas.py]"]
end

subgraph group_lifecycle["Deployment Lifecycle"]
  node_deployment["Deploy Orchestration<br/>[main.py]"]
  node_site_files[("Site HTML Files<br/>[main.py]")]
  node_site_container["Project Container"]
  node_inventory["Project Inventory<br/>[main.py]"]
  node_ttl_cleaner["TTL Cleaner<br/>[main.py]"]
  node_removal["Site Removal<br/>[main.py]"]
end

subgraph group_serving["Preview Serving"]
  node_gateway_config["Gateway Config<br/>[default.conf]"]
  node_site_routes["Site Route Configs<br/>[sites]"]
  node_gateway["Nginx Gateway"]
end

node_client(("API Client"))
node_docker["Docker Engine"]
node_preview_user(("Preview Visitor"))

node_client -->|"submits deployment"| node_deploy_api
node_client -->|"lists projects"| node_project_api
node_client -->|"requests removal"| node_undeploy_api
node_deploy_api -->|"accepts request"| node_schemas
node_deploy_api -->|"dispatches to"| node_deployment
node_deployment -->|"writes HTML"| node_site_files
node_deployment -->|"starts container"| node_site_container
node_deployment -->|"generates routes"| node_site_routes
node_deployment -->|"provisions through"| node_docker
node_project_api -->|"returns status"| node_inventory
node_ttl_cleaner -->|"removes expired"| node_removal
node_removal -->|"removes container"| node_site_container
node_removal -->|"removes route"| node_site_routes
node_removal -->|"cleans up through"| node_docker
node_undeploy_api -->|"dispatches to"| node_removal
node_preview_user -->|"requests preview"| node_gateway
node_gateway -.->|"uses configuration"| node_gateway_config
node_gateway -->|"routes project paths"| node_site_routes
node_gateway -->|"serves site from"| node_site_container

click node_deploy_api "https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/main.py"
click node_project_api "https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/main.py"
click node_undeploy_api "https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/main.py"
click node_schemas "https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/schemas.py"
click node_deployment "https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/main.py"
click node_site_files "https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/main.py"
click node_inventory "https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/main.py"
click node_ttl_cleaner "https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/main.py"
click node_removal "https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/main.py"
click node_gateway_config "https://github.com/neddy2000/fastapi-idp-lite/blob/main/nginx/default.conf"
click node_site_routes "https://github.com/neddy2000/fastapi-idp-lite/tree/main/nginx/conf.d/sites"

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_deploy_api,node_project_api,node_undeploy_api,node_schemas,node_client,node_preview_user toneBlue
class node_deployment,node_site_files,node_site_container,node_inventory,node_ttl_cleaner,node_removal toneAmber
class node_gateway_config,node_site_routes,node_gateway toneMint
class node_docker toneIndigo
```

## Components

### Control API

- [Deploy Endpoint](https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/main.py): `app/main.py`
- [Project Listing](https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/main.py): `app/main.py`
- [Undeploy Endpoint](https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/main.py): `app/main.py`
- [Request Schemas](https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/schemas.py): `app/schemas.py`

### Deployment Lifecycle

- [Deploy Orchestration](https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/main.py): `app/main.py`
- [Site HTML Files](https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/main.py): `app/main.py`
- **Project Container**
- [Project Inventory](https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/main.py): `app/main.py`
- [TTL Cleaner](https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/main.py): `app/main.py`
- [Site Removal](https://github.com/neddy2000/fastapi-idp-lite/blob/main/app/main.py): `app/main.py`

### Preview Serving

- [Gateway Config](https://github.com/neddy2000/fastapi-idp-lite/blob/main/nginx/default.conf): `nginx/default.conf`
- [Site Route Configs](https://github.com/neddy2000/fastapi-idp-lite/tree/main/nginx/conf.d/sites): `nginx/conf.d/sites`
- **Nginx Gateway**

### Other components

- **API Client**
- **Docker Engine**
- **Preview Visitor**

## Connections

- API Client → Deploy Endpoint: submits deployment (evidence: `README.md`)
- API Client → Project Listing: lists projects (evidence: `README.md`)
- API Client → Undeploy Endpoint: requests removal (evidence: `README.md`)
- Deploy Endpoint → Request Schemas: accepts request (evidence: `app/main.py`)
- Deploy Endpoint → Deploy Orchestration: dispatches to (evidence: `app/main.py`)
- Deploy Orchestration → Site HTML Files: writes HTML (evidence: `README.md`)
- Deploy Orchestration → Project Container: starts container (evidence: `README.md`)
- Deploy Orchestration → Site Route Configs: generates routes (evidence: `README.md`)
- Deploy Orchestration → Docker Engine: provisions through (evidence: `README.md`)
- Project Listing → Project Inventory: returns status (evidence: `README.md`)
- TTL Cleaner → Site Removal: removes expired (evidence: `app/main.py`)
- Site Removal → Project Container: removes container (evidence: `README.md`)
- Site Removal → Site Route Configs: removes route (evidence: `README.md`)
- Site Removal → Docker Engine: cleans up through (evidence: `README.md`)
- Undeploy Endpoint → Site Removal: dispatches to (evidence: `app/main.py`)
- Preview Visitor → Nginx Gateway: requests preview (evidence: `README.md`)
- Nginx Gateway → Gateway Config: uses configuration
- Nginx Gateway → Site Route Configs: routes project paths (evidence: `README.md`)
- Nginx Gateway → Project Container: serves site from (evidence: `README.md`)
