# shwetamore2810/cloud-monitoring-platform architecture

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

- Interactive diagram: https://gitdiagram.com/shwetamore2810/cloud-monitoring-platform
- Repository: https://github.com/shwetamore2810/cloud-monitoring-platform

## Overview

This repository implements a server-monitoring web application: users authenticate, manage saved servers, fetch live CPU, memory, disk, and load metrics over SSH, and view current and historical results. The frontend also includes a public-facing landing experience. The excerpts show the backend routes, database access, authentication setup, and frontend routing; several page-to-API links are supported by the SOURCE INDEX, while unsampled implementations are represented only at their known paths.

Main entry points: [`frontend/src/App.jsx`](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/App.jsx) (Application routes), [`backend/server.js`](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/backend/server.js) (HTTP API server), [`frontend/src/pages/Servers.jsx`](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/pages/Servers.jsx) (Server management), [`frontend/src/api.js`](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Application routes<br/>[App.jsx]"]
  node_api["API client<br/>[api.js]"]
  node_landing["Landing experience<br/>[LandingPage.jsx]"]
end

subgraph group_identity["Identity"]
  node_authstate["Auth state<br/>[AuthProvider.jsx]"]
  node_login["Login and registration<br/>[Login.jsx]"]
  node_accounts["Account settings<br/>[Accounts.jsx]"]
  node_authroutes["Authentication routes<br/>[auth.js]"]
  node_authmw["Token authentication<br/>[authenticate.js]"]
end

subgraph group_monitor["Monitoring"]
  node_servers["Server management<br/>[Servers.jsx]"]
  node_serverforms["Add server<br/>[AddServer.jsx]"]
  node_servertable["Server list<br/>[ServersTable.jsx]"]
  node_metricsctx["Live metrics state<br/>[MetricsContext.jsx]"]
  node_dashboard["Operations dashboard<br/>[Dashboard.jsx]"]
  node_history["Metrics history<br/>[MetricsHistory.jsx]"]
  node_serverroutes["Server routes<br/>[servers.js]"]
  node_metricroutes["Metrics collection and history<br/>[metrics.js]"]
end

subgraph group_service["Backend service"]
  node_backend["HTTP API server<br/>[server.js]"]
end

subgraph group_storage["Persistence"]
  node_dbclient["Database client<br/>[db.js]"]
  node_database[("PostgreSQL")]
end

node_user(("User"))
node_ssh{{"Monitored servers"}}

node_user -->|"uses"| node_app
node_app -->|"provides auth"| node_authstate
node_app -->|"provides metrics state"| node_metricsctx
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_accounts
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_history
node_app -->|"routes to"| node_servers
node_login -->|"calls"| node_api
node_login -->|"updates"| node_authstate
node_accounts -->|"reads"| node_authstate
node_servers -->|"calls"| node_api
node_servers -->|"renders"| node_serverforms
node_servers -->|"renders"| node_servertable
node_history -->|"calls"| node_api
node_dashboard -.->|"uses state"| node_metricsctx
node_api -->|"sends API requests"| node_backend
node_backend -->|"mounts"| node_authroutes
node_backend -->|"mounts"| node_serverroutes
node_backend -->|"mounts"| node_metricroutes
node_backend -->|"guards routes"| node_authmw
node_authroutes -->|"queries"| node_dbclient
node_serverroutes -->|"queries"| node_dbclient
node_metricroutes -->|"queries"| node_dbclient
node_metricroutes -->|"collects metrics"| node_ssh
node_dbclient -->|"queries"| node_database
node_authroutes -.->|"authenticates"| node_user

click node_app "https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/App.jsx"
click node_authstate "https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/AuthProvider.jsx"
click node_api "https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/api.js"
click node_login "https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/pages/Login.jsx"
click node_accounts "https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/pages/Accounts.jsx"
click node_landing "https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/pages/LandingPage.jsx"
click node_servers "https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/pages/Servers.jsx"
click node_serverforms "https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/components/AddServer.jsx"
click node_servertable "https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/components/ServersTable.jsx"
click node_metricsctx "https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/context/MetricsContext.jsx"
click node_dashboard "https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/pages/Dashboard.jsx"
click node_history "https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/pages/MetricsHistory.jsx"
click node_backend "https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/backend/server.js"
click node_authroutes "https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/backend/routes/auth.js"
click node_authmw "https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/backend/middleware/authenticate.js"
click node_serverroutes "https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/backend/routes/servers.js"
click node_metricroutes "https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/backend/routes/metrics.js"
click node_dbclient "https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/backend/db.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_app,node_api,node_landing,node_user toneBlue
class node_authstate,node_login,node_accounts,node_authroutes,node_authmw toneAmber
class node_servers,node_serverforms,node_servertable,node_metricsctx,node_dashboard,node_history,node_serverroutes,node_metricroutes,node_ssh toneMint
class node_backend toneRose
class node_dbclient,node_database toneIndigo
```

## Components

### Web application

- [Application routes](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [API client](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/api.js): `frontend/src/api.js`
- [Landing experience](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/pages/LandingPage.jsx): `frontend/src/pages/LandingPage.jsx`

### Identity

- [Auth state](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/AuthProvider.jsx): `frontend/src/AuthProvider.jsx`
- [Login and registration](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Account settings](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/pages/Accounts.jsx): `frontend/src/pages/Accounts.jsx`
- [Authentication routes](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [Token authentication](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/backend/middleware/authenticate.js): `backend/middleware/authenticate.js`

### Monitoring

- [Server management](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/pages/Servers.jsx): `frontend/src/pages/Servers.jsx`
- [Add server](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/components/AddServer.jsx): `frontend/src/components/AddServer.jsx`
- [Server list](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/components/ServersTable.jsx): `frontend/src/components/ServersTable.jsx`
- [Live metrics state](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/context/MetricsContext.jsx): `frontend/src/context/MetricsContext.jsx`
- [Operations dashboard](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Metrics history](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/frontend/src/pages/MetricsHistory.jsx): `frontend/src/pages/MetricsHistory.jsx`
- [Server routes](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/backend/routes/servers.js): `backend/routes/servers.js`
- [Metrics collection and history](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/backend/routes/metrics.js): `backend/routes/metrics.js`

### Backend service

- [HTTP API server](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/backend/server.js): `backend/server.js`

### Persistence

- [Database client](https://github.com/shwetamore2810/cloud-monitoring-platform/blob/main/backend/db.js): `backend/db.js`
- **PostgreSQL**

### Other components

- **User**
- **Monitored servers**

## Connections

- User → Application routes: uses
- Application routes → Auth state: provides auth (evidence: `frontend/src/App.jsx`)
- Application routes → Live metrics state: provides metrics state (evidence: `frontend/src/App.jsx`)
- Application routes → Login and registration: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Account settings: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Landing experience: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Operations dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Metrics history: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Server management: routes to (evidence: `frontend/src/App.jsx`)
- Login and registration → API client: calls (evidence: `frontend/src/pages/Login.jsx`)
- Login and registration → Auth state: updates (evidence: `frontend/src/pages/Login.jsx`)
- Account settings → Auth state: reads (evidence: `frontend/src/pages/Accounts.jsx`)
- Server management → API client: calls (evidence: `frontend/src/pages/Servers.jsx`)
- Server management → Add server: renders (evidence: `frontend/src/pages/Servers.jsx`)
- Server management → Server list: renders (evidence: `frontend/src/pages/Servers.jsx`)
- Metrics history → API client: calls (evidence: `frontend/src/pages/MetricsHistory.jsx`)
- Operations dashboard → Live metrics state: uses state
- API client → HTTP API server: sends API requests (evidence: `frontend/src/api.js`)
- HTTP API server → Authentication routes: mounts (evidence: `backend/server.js`)
- HTTP API server → Server routes: mounts (evidence: `backend/server.js`)
- HTTP API server → Metrics collection and history: mounts (evidence: `backend/server.js`)
- HTTP API server → Token authentication: guards routes (evidence: `backend/server.js`)
- Authentication routes → Database client: queries (evidence: `backend/routes/auth.js`)
- Server routes → Database client: queries (evidence: `backend/routes/servers.js`)
- Metrics collection and history → Database client: queries (evidence: `backend/routes/metrics.js`)
- Metrics collection and history → Monitored servers: collects metrics (evidence: `backend/routes/metrics.js`)
- Database client → PostgreSQL: queries (evidence: `backend/db.js`)
- Authentication routes → User: authenticates
