# angelocassella/mio-server-multisito architecture

> Architecture diagram of the GitHub repository angelocassella/mio-server-multisito, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/angelocassella/mio-server-multisito
- Repository: https://github.com/angelocassella/mio-server-multisito

## Overview

This repository is a multisite server hosting separate web applications behind Nginx, with Python backends and a shared MySQL service. The RegistroSport workflow is browser interaction, frontend state loading and updates, authenticated API handling, then persistent state access. Progetto1 currently exposes health and database-connectivity endpoints alongside its frontend. The README documents domain-based routing and containerized services; deployment wiring is not shown in sampled source, so those relationships are documented at that level rather than inferred from Compose configuration.

Main entry points: [`nginx/nginx.conf`](https://github.com/angelocassella/mio-server-multisito/blob/main/nginx/nginx.conf) (Nginx routing), [`frontends/registrosport/index.html`](https://github.com/angelocassella/mio-server-multisito/blob/main/frontends/registrosport/index.html) (Registro page), [`services/registrosport/main.py`](https://github.com/angelocassella/mio-server-multisito/blob/main/services/registrosport/main.py) (Registro API), [`frontends/registrosport/app.js`](https://github.com/angelocassella/mio-server-multisito/blob/main/frontends/registrosport/app.js) (Registro interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["Shared routing"]
  node_nginx["Nginx routing<br/>[nginx.conf]"]
  node_mysql[("Shared MySQL")]
end

subgraph group_registro["RegistroSport"]
  node_reg_frontend["Registro interface<br/>[app.js]"]
  node_reg_backend["Registro API<br/>[main.py]"]
  node_reg_state[("Registro state<br/>[main.py]")]
  node_reg_page["Registro page<br/>[index.html]"]
  node_reg_styles["Registro styling<br/>[styles.css]"]
end

subgraph group_progetto1["Progetto1"]
  node_pro_page["Progetto1 page<br/>[index.html]"]
  node_pro_api["Progetto1 API<br/>[main.py]"]
end

node_browser(("Site visitor"))

node_browser -->|"requests site"| node_nginx
node_nginx -->|"serves site"| node_reg_page
node_nginx -->|"routes by domain"| node_reg_backend
node_nginx -->|"serves site"| node_pro_page
node_nginx -->|"routes by domain"| node_pro_api
node_reg_page -.->|"uses styles"| node_reg_styles
node_reg_page -.->|"loads script"| node_reg_frontend
node_reg_frontend -->|"fetches state"| node_reg_backend
node_reg_backend -->|"reads and writes"| node_reg_state
node_reg_state -->|"persists in"| node_mysql
node_pro_api -->|"tests connection"| node_mysql

click node_nginx "https://github.com/angelocassella/mio-server-multisito/blob/main/nginx/nginx.conf"
click node_reg_frontend "https://github.com/angelocassella/mio-server-multisito/blob/main/frontends/registrosport/app.js"
click node_reg_backend "https://github.com/angelocassella/mio-server-multisito/blob/main/services/registrosport/main.py"
click node_reg_state "https://github.com/angelocassella/mio-server-multisito/blob/main/services/registrosport/main.py"
click node_reg_page "https://github.com/angelocassella/mio-server-multisito/blob/main/frontends/registrosport/index.html"
click node_reg_styles "https://github.com/angelocassella/mio-server-multisito/blob/main/frontends/registrosport/styles.css"
click node_pro_page "https://github.com/angelocassella/mio-server-multisito/blob/main/frontends/progetto1/index.html"
click node_pro_api "https://github.com/angelocassella/mio-server-multisito/blob/main/services/progetto1/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_nginx,node_mysql toneBlue
class node_reg_frontend,node_reg_backend,node_reg_state,node_reg_page,node_reg_styles toneAmber
class node_pro_page,node_pro_api toneMint
class node_browser toneIndigo
```

## Components

### Shared routing

- [Nginx routing](https://github.com/angelocassella/mio-server-multisito/blob/main/nginx/nginx.conf): `nginx/nginx.conf`
- **Shared MySQL**

### RegistroSport

- [Registro interface](https://github.com/angelocassella/mio-server-multisito/blob/main/frontends/registrosport/app.js): `frontends/registrosport/app.js`
- [Registro API](https://github.com/angelocassella/mio-server-multisito/blob/main/services/registrosport/main.py): `services/registrosport/main.py`
- [Registro state](https://github.com/angelocassella/mio-server-multisito/blob/main/services/registrosport/main.py): `services/registrosport/main.py`
- [Registro page](https://github.com/angelocassella/mio-server-multisito/blob/main/frontends/registrosport/index.html): `frontends/registrosport/index.html`
- [Registro styling](https://github.com/angelocassella/mio-server-multisito/blob/main/frontends/registrosport/styles.css): `frontends/registrosport/styles.css`

### Progetto1

- [Progetto1 page](https://github.com/angelocassella/mio-server-multisito/blob/main/frontends/progetto1/index.html): `frontends/progetto1/index.html`
- [Progetto1 API](https://github.com/angelocassella/mio-server-multisito/blob/main/services/progetto1/main.py): `services/progetto1/main.py`

### Other components

- **Site visitor**

## Connections

- Site visitor → Nginx routing: requests site (evidence: `README.md`)
- Nginx routing → Registro page: serves site (evidence: `README.md`)
- Nginx routing → Registro API: routes by domain (evidence: `README.md`)
- Nginx routing → Progetto1 page: serves site (evidence: `README.md`)
- Nginx routing → Progetto1 API: routes by domain (evidence: `README.md`)
- Registro page → Registro styling: uses styles
- Registro page → Registro interface: loads script
- Registro interface → Registro API: fetches state (evidence: `frontends/registrosport/app.js`)
- Registro API → Registro state: reads and writes (evidence: `services/registrosport/main.py`)
- Registro state → Shared MySQL: persists in (evidence: `README.md`)
- Progetto1 API → Shared MySQL: tests connection (evidence: `services/progetto1/main.py`)
