# shiva4646/cansat architecture

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

- Interactive diagram: https://gitdiagram.com/shiva4646/cansat
- Repository: https://github.com/shiva4646/cansat

## Overview

This repository is a CanSat ground-station GUI: incoming telemetry is received by a server, presented as live mission, sensor, position, and attitude views, while the server also provides a command path back toward the serial device. A separate backend simulator can generate telemetry and optionally persist it. The sampled sources support the UI update calls and the server’s serial/command responsibilities; some server-to-client event wiring is in omitted excerpts, so those links are marked unverified. The tree also contains a `frontend` directory, but no sampled implementation establishes its runtime role.

Main entry points: [`GUI-master/frontend-legacy/index.html`](https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/index.html) (Dashboard Shell), [`GUI-master/frontend-legacy/JS/telemetry_update-ui.js`](https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/telemetry_update-ui.js) (Telemetry Hydration), [`GUI-master/backend/server.js`](https://github.com/shiva4646/cansat/blob/main/GUI-master/backend/server.js) (Ground Station Server), [`GUI-master/frontend-legacy/JS/socket.js`](https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/socket.js) (Socket Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Telemetry Ingest"]
  node_server["Ground Station Server<br/>[server.js]"]
  node_legacy_socket["Socket Client<br/>[socket.js]"]
end

subgraph group_presentation["Mission UI"]
  node_telemetry_ui["Telemetry Hydration"]
  node_dashboard["Dashboard Shell<br/>[index.html]"]
  node_navigation["Page Navigation<br/>[sidebar.js]"]
  node_mission_clock["Mission Clocks<br/>[index.js]"]
  node_timer["Mission Timer<br/>[timer.js]"]
  node_modern_frontend["Frontend Entry<br/>[index.html]"]
end

subgraph group_visuals["Live Visualizations"]
  node_charts["Telemetry Charts<br/>[chart.js]"]
  node_map["GPS Map<br/>[map.js]"]
  node_orientation["Attitude and Radar<br/>[orientation.js]"]
  node_sat_visual["Satellite Model<br/>[threejs-sat.js]"]
end

subgraph group_simulation["Simulation and Persistence"]
  node_simulator["Telemetry Simulator<br/>[fav.js]"]
  node_database[("Telemetry Database")]
end

node_operator(("Ground Operator"))
node_can_device["CanSat Device"]
node_map_tiles["Map Tile Service"]

node_can_device -->|"sends serial data"| node_server
node_server -.->|"broadcasts telemetry"| node_legacy_socket
node_legacy_socket -->|"dispatches updates"| node_telemetry_ui
node_telemetry_ui -->|"updates charts"| node_charts
node_telemetry_ui -->|"updates position"| node_map
node_telemetry_ui -->|"updates readouts"| node_dashboard
node_operator -.->|"views mission"| node_dashboard
node_dashboard -.->|"loads navigation"| node_navigation
node_dashboard -.->|"loads clock"| node_mission_clock
node_dashboard -.->|"loads timer"| node_timer
node_orientation -->|"creates model"| node_sat_visual
node_map -->|"loads tiles"| node_map_tiles
node_operator -.->|"sends commands"| node_server
node_server -->|"writes serial command"| node_can_device
node_simulator -.->|"emits telemetry"| node_legacy_socket
node_simulator -->|"inserts packets"| node_database

click node_server "https://github.com/shiva4646/cansat/blob/main/GUI-master/backend/server.js"
click node_legacy_socket "https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/socket.js"
click node_telemetry_ui "https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/telemetry_update-ui.js"
click node_dashboard "https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/index.html"
click node_navigation "https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/sidebar.js"
click node_mission_clock "https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/index.js"
click node_timer "https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/timer.js"
click node_charts "https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/chart.js"
click node_map "https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/map.js"
click node_orientation "https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/orientation.js"
click node_sat_visual "https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/threejs-sat.js"
click node_simulator "https://github.com/shiva4646/cansat/blob/main/GUI-master/backend/fav.js"
click node_modern_frontend "https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend/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_server,node_legacy_socket toneBlue
class node_telemetry_ui,node_dashboard,node_navigation,node_mission_clock,node_timer,node_modern_frontend toneAmber
class node_charts,node_map,node_orientation,node_sat_visual toneMint
class node_simulator,node_database toneRose
class node_operator,node_can_device,node_map_tiles toneIndigo
```

## Components

### Telemetry Ingest

- [Ground Station Server](https://github.com/shiva4646/cansat/blob/main/GUI-master/backend/server.js): `GUI-master/backend/server.js`
- [Socket Client](https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/socket.js): `GUI-master/frontend-legacy/JS/socket.js`

### Mission UI

- [Telemetry Hydration](https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/telemetry_update-ui.js): `GUI-master/frontend-legacy/JS/telemetry_update-ui.js`
- [Dashboard Shell](https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/index.html): `GUI-master/frontend-legacy/index.html`
- [Page Navigation](https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/sidebar.js): `GUI-master/frontend-legacy/JS/sidebar.js`
- [Mission Clocks](https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/index.js): `GUI-master/frontend-legacy/JS/index.js`
- [Mission Timer](https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/timer.js): `GUI-master/frontend-legacy/JS/timer.js`
- [Frontend Entry](https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend/index.html): `GUI-master/frontend/index.html`

### Live Visualizations

- [Telemetry Charts](https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/chart.js): `GUI-master/frontend-legacy/JS/chart.js`
- [GPS Map](https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/map.js): `GUI-master/frontend-legacy/JS/map.js`
- [Attitude and Radar](https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/orientation.js): `GUI-master/frontend-legacy/JS/orientation.js`
- [Satellite Model](https://github.com/shiva4646/cansat/blob/main/GUI-master/frontend-legacy/JS/threejs-sat.js): `GUI-master/frontend-legacy/JS/threejs-sat.js`

### Simulation and Persistence

- [Telemetry Simulator](https://github.com/shiva4646/cansat/blob/main/GUI-master/backend/fav.js): `GUI-master/backend/fav.js`
- **Telemetry Database**

### Other components

- **Ground Operator**
- **CanSat Device**
- **Map Tile Service**

## Connections

- CanSat Device → Ground Station Server: sends serial data (evidence: `GUI-master/backend/server.js`)
- Ground Station Server → Socket Client: broadcasts telemetry
- Socket Client → Telemetry Hydration: dispatches updates (evidence: `GUI-master/frontend-legacy/JS/socket.js`)
- Telemetry Hydration → Telemetry Charts: updates charts (evidence: `GUI-master/frontend-legacy/JS/telemetry_update-ui.js`)
- Telemetry Hydration → GPS Map: updates position (evidence: `GUI-master/frontend-legacy/JS/telemetry_update-ui.js`)
- Telemetry Hydration → Dashboard Shell: updates readouts (evidence: `GUI-master/frontend-legacy/JS/telemetry_update-ui.js`)
- Ground Operator → Dashboard Shell: views mission
- Dashboard Shell → Page Navigation: loads navigation
- Dashboard Shell → Mission Clocks: loads clock
- Dashboard Shell → Mission Timer: loads timer
- Attitude and Radar → Satellite Model: creates model (evidence: `GUI-master/frontend-legacy/JS/orientation.js`)
- GPS Map → Map Tile Service: loads tiles (evidence: `GUI-master/frontend-legacy/JS/map.js`)
- Ground Operator → Ground Station Server: sends commands
- Ground Station Server → CanSat Device: writes serial command (evidence: `GUI-master/backend/server.js`)
- Telemetry Simulator → Socket Client: emits telemetry
- Telemetry Simulator → Telemetry Database: inserts packets (evidence: `GUI-master/backend/fav.js`)
