# mbashia/nginx-deploy-site architecture

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

- Interactive diagram: https://gitdiagram.com/mbashia/nginx-deploy-site
- Repository: https://github.com/mbashia/nginx-deploy-site

## Overview

This is a small Bash utility for bringing a backend site behind nginx and provisioning TLS. An administrator supplies an upstream, port, and domains; the script checks prerequisites and DNS, creates and enables an nginx configuration, validates it with rollback on failure, reloads nginx, and invokes Certbot. The repository provides no source excerpts, so the workflow and relationships shown here rely on README documentation only.

Main entry points: [`domain-deploy.sh`](https://github.com/mbashia/nginx-deploy-site/blob/main/domain-deploy.sh) (Vhost config)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_administrator(("Administrator"))
node_inputs["CLI inputs<br/>[domain-deploy.sh]"]
node_validation["Input checks<br/>[domain-deploy.sh]"]
node_dns_check["DNS checks<br/>[domain-deploy.sh]"]
node_dns["DNS resolver"]
node_config["Vhost config<br/>[domain-deploy.sh]"]
node_nginx_sites["nginx site files"]
node_config_test["Config test<br/>[domain-deploy.sh]"]
node_nginx["nginx"]
node_reload["nginx reload<br/>[domain-deploy.sh]"]
node_certbot["Certbot"]
node_backend["Backend app"]

node_administrator -->|"provides flags"| node_inputs
node_inputs -->|"validates"| node_validation
node_validation -->|"checks domains"| node_dns_check
node_dns_check -->|"resolves domains"| node_dns
node_dns_check -->|"permits writing"| node_config
node_config -->|"writes and enables"| node_nginx_sites
node_config -->|"proxies requests"| node_backend
node_config -->|"is validated by"| node_config_test
node_config_test -->|"runs nginx -t"| node_nginx
node_config_test -->|"rolls back on failure"| node_nginx_sites
node_config_test -->|"continues on success"| node_reload
node_reload -->|"reloads"| node_nginx
node_reload -->|"invokes certificate setup"| node_certbot
node_certbot -->|"adds TLS config"| node_nginx_sites

click node_inputs "https://github.com/mbashia/nginx-deploy-site/blob/main/domain-deploy.sh"
click node_validation "https://github.com/mbashia/nginx-deploy-site/blob/main/domain-deploy.sh"
click node_dns_check "https://github.com/mbashia/nginx-deploy-site/blob/main/domain-deploy.sh"
click node_config "https://github.com/mbashia/nginx-deploy-site/blob/main/domain-deploy.sh"
click node_config_test "https://github.com/mbashia/nginx-deploy-site/blob/main/domain-deploy.sh"
click node_reload "https://github.com/mbashia/nginx-deploy-site/blob/main/domain-deploy.sh"

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_administrator,node_dns,node_nginx_sites,node_nginx,node_certbot,node_backend toneIndigo
class node_inputs,node_validation,node_dns_check,node_config,node_config_test,node_reload toneTeal
```

## Components

### Other components

- **Administrator**
- [CLI inputs](https://github.com/mbashia/nginx-deploy-site/blob/main/domain-deploy.sh): `domain-deploy.sh`
- [Input checks](https://github.com/mbashia/nginx-deploy-site/blob/main/domain-deploy.sh): `domain-deploy.sh`
- [DNS checks](https://github.com/mbashia/nginx-deploy-site/blob/main/domain-deploy.sh): `domain-deploy.sh`
- **DNS resolver**
- [Vhost config](https://github.com/mbashia/nginx-deploy-site/blob/main/domain-deploy.sh): `domain-deploy.sh`
- **nginx site files**
- [Config test](https://github.com/mbashia/nginx-deploy-site/blob/main/domain-deploy.sh): `domain-deploy.sh`
- **nginx**
- [nginx reload](https://github.com/mbashia/nginx-deploy-site/blob/main/domain-deploy.sh): `domain-deploy.sh`
- **Certbot**
- **Backend app**

## Connections

- Administrator → CLI inputs: provides flags (evidence: `README.md`)
- CLI inputs → Input checks: validates (evidence: `README.md`)
- Input checks → DNS checks: checks domains (evidence: `README.md`)
- DNS checks → DNS resolver: resolves domains (evidence: `README.md`)
- DNS checks → Vhost config: permits writing (evidence: `README.md`)
- Vhost config → nginx site files: writes and enables (evidence: `README.md`)
- Vhost config → Backend app: proxies requests (evidence: `README.md`)
- Vhost config → Config test: is validated by (evidence: `README.md`)
- Config test → nginx: runs nginx -t (evidence: `README.md`)
- Config test → nginx site files: rolls back on failure (evidence: `README.md`)
- Config test → nginx reload: continues on success (evidence: `README.md`)
- nginx reload → nginx: reloads (evidence: `README.md`)
- nginx reload → Certbot: invokes certificate setup (evidence: `README.md`)
- Certbot → nginx site files: adds TLS config (evidence: `README.md`)
