# umid4219/call-server architecture

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

- Interactive diagram: https://gitdiagram.com/umid4219/call-server
- Repository: https://github.com/umid4219/call-server

## Overview

This is a FastAPI call-log collection and reporting service. A device submits call records; the service normalizes call types, timestamps, and durations, filters records older than 48 hours, and appends accepted rows to CSV. Browser clients can view aggregate statistics or download a two-sheet Excel report. The route implementations and storage/report logic are all in main.py; index.html is served as the home page, but its contents are not provided.

Main entry points: [`main.py`](https://github.com/umid4219/call-server/blob/main/main.py) (FastAPI app), [`index.html`](https://github.com/umid4219/call-server/blob/main/index.html) (Home page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Log ingestion"]
  node_receive["Receive and normalize<br/>[main.py]"]
end

subgraph group_storage["CSV storage"]
  node_csv[("Call-log CSV<br/>[main.py]")]
end

subgraph group_reporting["Reporting"]
  node_stats["Statistics endpoint<br/>[main.py]"]
  node_report["Excel report endpoint<br/>[main.py]"]
  node_xlsx["Excel report file<br/>[main.py]"]
  node_home["Home endpoint<br/>[main.py]"]
  node_html["Home page<br/>[index.html]"]
end

node_device(("Call-log device"))
node_browser(("Browser user"))
node_app["FastAPI app<br/>[main.py]"]

node_device -->|"posts records"| node_receive
node_app -->|"dispatches"| node_receive
node_app -->|"dispatches"| node_stats
node_app -->|"dispatches"| node_report
node_app -->|"dispatches"| node_home
node_receive -->|"appends rows"| node_csv
node_browser -->|"requests"| node_app
node_stats -->|"reads"| node_csv
node_report -->|"reads"| node_csv
node_report -->|"writes workbook"| node_xlsx
node_report -->|"returns file"| node_browser
node_home -->|"reads"| node_html
node_home -->|"returns page"| node_browser

click node_app "https://github.com/umid4219/call-server/blob/main/main.py"
click node_receive "https://github.com/umid4219/call-server/blob/main/main.py"
click node_csv "https://github.com/umid4219/call-server/blob/main/main.py"
click node_stats "https://github.com/umid4219/call-server/blob/main/main.py"
click node_report "https://github.com/umid4219/call-server/blob/main/main.py"
click node_xlsx "https://github.com/umid4219/call-server/blob/main/main.py"
click node_home "https://github.com/umid4219/call-server/blob/main/main.py"
click node_html "https://github.com/umid4219/call-server/blob/main/index.html"

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_receive,node_browser toneBlue
class node_csv toneAmber
class node_stats,node_report,node_xlsx,node_home,node_html,node_app toneMint
class node_device toneIndigo
```

## Components

### Log ingestion

- [Receive and normalize](https://github.com/umid4219/call-server/blob/main/main.py): `main.py`

### CSV storage

- [Call-log CSV](https://github.com/umid4219/call-server/blob/main/main.py): `main.py`

### Reporting

- [Statistics endpoint](https://github.com/umid4219/call-server/blob/main/main.py): `main.py`
- [Excel report endpoint](https://github.com/umid4219/call-server/blob/main/main.py): `main.py`
- [Excel report file](https://github.com/umid4219/call-server/blob/main/main.py): `main.py`
- [Home endpoint](https://github.com/umid4219/call-server/blob/main/main.py): `main.py`
- [Home page](https://github.com/umid4219/call-server/blob/main/index.html): `index.html`

### Other components

- **Call-log device**
- **Browser user**
- [FastAPI app](https://github.com/umid4219/call-server/blob/main/main.py): `main.py`

## Connections

- Call-log device → Receive and normalize: posts records
- FastAPI app → Receive and normalize: dispatches
- FastAPI app → Statistics endpoint: dispatches
- FastAPI app → Excel report endpoint: dispatches
- FastAPI app → Home endpoint: dispatches
- Receive and normalize → Call-log CSV: appends rows
- Browser user → FastAPI app: requests
- Statistics endpoint → Call-log CSV: reads
- Excel report endpoint → Call-log CSV: reads
- Excel report endpoint → Excel report file: writes workbook
- Excel report endpoint → Browser user: returns file
- Home endpoint → Home page: reads
- Home endpoint → Browser user: returns page
