# profomarpinzon/demo-app architecture

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

- Interactive diagram: https://gitdiagram.com/profomarpinzon/demo-app
- Repository: https://github.com/profomarpinzon/demo-app

## Overview

This small infrastructure demo identifies which server handled a browser request. The dashboard polls the Express `/api/info` endpoint every five seconds, then displays the responding instance’s IP, hostname, instance name, and timestamp. Express also serves the dashboard’s static files. Server identity values are assembled in the API handler from host/network details, the current time, and the configured instance name. The excerpts show the polling and response logic; the HTML and styling are listed in the tree but were not inspected.

Main entry points: [`server.js`](https://github.com/profomarpinzon/demo-app/blob/main/server.js) (Info endpoint), [`public/app.js`](https://github.com/profomarpinzon/demo-app/blob/main/public/app.js) (Polling client), [`public/index.html`](https://github.com/profomarpinzon/demo-app/blob/main/public/index.html) (Dashboard page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_page["Dashboard page<br/>[index.html]"]
  node_client["Polling client<br/>[app.js]"]
end

subgraph group_server["Server"]
  node_express["HTTP server<br/>[server.js]"]
  node_info["Info endpoint<br/>[server.js]"]
  node_hostinfo["Host identity<br/>[server.js]"]
end

node_browser(("Browser"))
node_system["Host system"]

node_express -->|"serves static files"| node_page
node_browser -.->|"uses dashboard"| node_client
node_client -->|"polls every 5s"| node_info
node_info -->|"assembles response"| node_hostinfo
node_hostinfo -->|"reads host details"| node_system
node_info -->|"returns JSON"| node_client

click node_page "https://github.com/profomarpinzon/demo-app/blob/main/public/index.html"
click node_client "https://github.com/profomarpinzon/demo-app/blob/main/public/app.js"
click node_express "https://github.com/profomarpinzon/demo-app/blob/main/server.js"
click node_info "https://github.com/profomarpinzon/demo-app/blob/main/server.js"
click node_hostinfo "https://github.com/profomarpinzon/demo-app/blob/main/server.js"

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_page,node_client,node_browser toneBlue
class node_express,node_info,node_hostinfo toneAmber
class node_system toneIndigo
```

## Components

### Dashboard

- [Dashboard page](https://github.com/profomarpinzon/demo-app/blob/main/public/index.html): `public/index.html`
- [Polling client](https://github.com/profomarpinzon/demo-app/blob/main/public/app.js): `public/app.js`

### Server

- [HTTP server](https://github.com/profomarpinzon/demo-app/blob/main/server.js): `server.js`
- [Info endpoint](https://github.com/profomarpinzon/demo-app/blob/main/server.js): `server.js`
- [Host identity](https://github.com/profomarpinzon/demo-app/blob/main/server.js): `server.js`

### Other components

- **Browser**
- **Host system**

## Connections

- HTTP server → Dashboard page: serves static files (evidence: `server.js`)
- Browser → Polling client: uses dashboard (evidence: `README.md`)
- Polling client → Info endpoint: polls every 5s (evidence: `public/app.js`)
- Info endpoint → Host identity: assembles response (evidence: `server.js`)
- Host identity → Host system: reads host details (evidence: `server.js`)
- Info endpoint → Polling client: returns JSON (evidence: `public/app.js`)
