# kalel-ifpb/projeto-ping architecture

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

- Interactive diagram: https://gitdiagram.com/kalel-ifpb/projeto-ping
- Repository: https://github.com/kalel-ifpb/projeto-ping

## Overview

projetoPING.COM is a Node-backed network-device monitor. Users register or sign in, manage private-IPv4 devices, and view current status and historical latency/loss; the backend performs immediate and scheduled ICMP checks. The sampled sources show the server invoking the ping module and the browser calling API endpoints, while README documents dashboard, device, problem, history, and detail views. Some API and scheduler code and the UI markup are unsampled, so those documented links are shown only where supported.

Main entry points: [`server.js`](https://github.com/kalel-ifpb/projeto-ping/blob/main/server.js) (HTTP API and routing), [`script.js`](https://github.com/kalel-ifpb/projeto-ping/blob/main/script.js) (Dashboard and views), [`monitoring.js`](https://github.com/kalel-ifpb/projeto-ping/blob/main/monitoring.js) (ICMP execution and classification), [`index.html`](https://github.com/kalel-ifpb/projeto-ping/blob/main/index.html) (Page structure)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_ui["Dashboard and views<br/>[script.js]"]
  node_html["Page structure<br/>[index.html]"]
  node_styles["Interface styling<br/>[style.css]"]
end

subgraph group_backend["Application backend"]
  node_auth["Account access<br/>[server.js]"]
  node_api["HTTP API and routing<br/>[server.js]"]
  node_devices["Device management<br/>[server.js]"]
  node_dashboard["Current status summary<br/>[server.js]"]
  node_history["Check history<br/>[server.js]"]
  node_static["Served interface assets<br/>[server.js]"]
end

subgraph group_monitor["Monitoring"]
  node_scheduler["Periodic checks<br/>[server.js]"]
  node_check["Check recording<br/>[server.js]"]
  node_ping["ICMP execution and classification<br/>[monitoring.js]"]
end

subgraph group_state["Persistent state"]
  node_db[("JSON data file<br/>[db.json]")]
end

node_user(("Account user"))
node_systemping{{"System ping utility"}}

node_user -->|"uses"| node_ui
node_ui -->|"calls API"| node_api
node_api -->|"routes auth"| node_auth
node_api -->|"routes devices"| node_devices
node_api -->|"routes dashboard"| node_dashboard
node_api -->|"routes history"| node_history
node_api -->|"serves assets"| node_static
node_devices -->|"checks new device"| node_check
node_scheduler -->|"runs checks"| node_check
node_api -->|"checks on demand"| node_check
node_check -->|"calls ping"| node_ping
node_ping -->|"executes"| node_systemping
node_api -->|"reads and writes"| node_db
node_ui -.->|"renders in"| node_html
node_static -.->|"serves"| node_styles
node_ui -->|"shows summary"| node_dashboard
node_ui -->|"shows history"| node_history
node_ui -->|"manages devices"| node_devices

click node_ui "https://github.com/kalel-ifpb/projeto-ping/blob/main/script.js"
click node_auth "https://github.com/kalel-ifpb/projeto-ping/blob/main/server.js"
click node_api "https://github.com/kalel-ifpb/projeto-ping/blob/main/server.js"
click node_devices "https://github.com/kalel-ifpb/projeto-ping/blob/main/server.js"
click node_dashboard "https://github.com/kalel-ifpb/projeto-ping/blob/main/server.js"
click node_history "https://github.com/kalel-ifpb/projeto-ping/blob/main/server.js"
click node_scheduler "https://github.com/kalel-ifpb/projeto-ping/blob/main/server.js"
click node_check "https://github.com/kalel-ifpb/projeto-ping/blob/main/server.js"
click node_ping "https://github.com/kalel-ifpb/projeto-ping/blob/main/monitoring.js"
click node_db "https://github.com/kalel-ifpb/projeto-ping/blob/main/db.json"
click node_static "https://github.com/kalel-ifpb/projeto-ping/blob/main/server.js"
click node_html "https://github.com/kalel-ifpb/projeto-ping/blob/main/index.html"
click node_styles "https://github.com/kalel-ifpb/projeto-ping/blob/main/style.css"

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_ui,node_html,node_styles,node_user toneBlue
class node_auth,node_api,node_devices,node_dashboard,node_history,node_static toneAmber
class node_scheduler,node_check,node_ping toneMint
class node_db toneRose
class node_systemping toneIndigo
```

## Components

### Web interface

- [Dashboard and views](https://github.com/kalel-ifpb/projeto-ping/blob/main/script.js): `script.js`
- [Page structure](https://github.com/kalel-ifpb/projeto-ping/blob/main/index.html): `index.html`
- [Interface styling](https://github.com/kalel-ifpb/projeto-ping/blob/main/style.css): `style.css`

### Application backend

- [Account access](https://github.com/kalel-ifpb/projeto-ping/blob/main/server.js): `server.js`
- [HTTP API and routing](https://github.com/kalel-ifpb/projeto-ping/blob/main/server.js): `server.js`
- [Device management](https://github.com/kalel-ifpb/projeto-ping/blob/main/server.js): `server.js`
- [Current status summary](https://github.com/kalel-ifpb/projeto-ping/blob/main/server.js): `server.js`
- [Check history](https://github.com/kalel-ifpb/projeto-ping/blob/main/server.js): `server.js`
- [Served interface assets](https://github.com/kalel-ifpb/projeto-ping/blob/main/server.js): `server.js`

### Monitoring

- [Periodic checks](https://github.com/kalel-ifpb/projeto-ping/blob/main/server.js): `server.js`
- [Check recording](https://github.com/kalel-ifpb/projeto-ping/blob/main/server.js): `server.js`
- [ICMP execution and classification](https://github.com/kalel-ifpb/projeto-ping/blob/main/monitoring.js): `monitoring.js`

### Persistent state

- [JSON data file](https://github.com/kalel-ifpb/projeto-ping/blob/main/db.json): `db.json`

### Other components

- **Account user**
- **System ping utility**

## Connections

- Account user → Dashboard and views: uses (evidence: `README.md`)
- Dashboard and views → HTTP API and routing: calls API (evidence: `script.js`)
- HTTP API and routing → Account access: routes auth (evidence: `server.js`)
- HTTP API and routing → Device management: routes devices (evidence: `server.js`)
- HTTP API and routing → Current status summary: routes dashboard (evidence: `README.md`)
- HTTP API and routing → Check history: routes history (evidence: `server.js`)
- HTTP API and routing → Served interface assets: serves assets (evidence: `server.js`)
- Device management → Check recording: checks new device (evidence: `README.md`)
- Periodic checks → Check recording: runs checks (evidence: `README.md`)
- HTTP API and routing → Check recording: checks on demand (evidence: `server.js`)
- Check recording → ICMP execution and classification: calls ping (evidence: `server.js`)
- ICMP execution and classification → System ping utility: executes (evidence: `monitoring.js`)
- HTTP API and routing → JSON data file: reads and writes (evidence: `server.js`)
- Dashboard and views → Page structure: renders in (evidence: `README.md`)
- Served interface assets → Interface styling: serves (evidence: `README.md`)
- Dashboard and views → Current status summary: shows summary (evidence: `README.md`)
- Dashboard and views → Check history: shows history (evidence: `script.js`)
- Dashboard and views → Device management: manages devices (evidence: `script.js`)
