# ayaanzaroon78/drdo-project architecture

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

- Interactive diagram: https://gitdiagram.com/ayaanzaroon78/drdo-project
- Repository: https://github.com/ayaanzaroon78/drdo-project

## Overview

SecureTelemetry simulates sensor telemetry, validates packets for integrity and sequence errors, records results and security events, then exposes monitoring through REST, WebSockets, and dashboard views. Authentication—including a simulated hardware-key challenge/response flow—is a separate protected workflow. The graph preserves the documented analytics and monitoring capabilities; some subsystem links are based on the README and tree because their implementation was not sampled.

Main entry points: [`frontend/lib/api.ts`](https://github.com/ayaanzaroon78/drdo-project/blob/main/frontend/lib/api.ts) (REST client), [`backend/packets/services.py`](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/packets/services.py) (Packet ingestion), [`backend/websocket_app/consumers.py`](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/websocket_app/consumers.py) (WebSocket consumers), [`backend/authentication_app/services.py`](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/authentication_app/services.py) (Key challenge service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Dashboard client"]
  node_dashboard["Dashboard pages<br/>[page.tsx]"]
  node_feature_pages["Feature pages"]
  node_api_client["REST client<br/>[api.ts]"]
  node_ws_hook["Live socket hook<br/>[useWebSocket.ts]"]
end

subgraph group_telemetry["Telemetry processing"]
  node_sensor_sim["Sensor simulator<br/>[simulator.py]"]
  node_sensor_api["Sensor API<br/>[views.py]"]
  node_packet_api["Packet API<br/>[views.py]"]
  node_ingestion["Packet ingestion<br/>[services.py]"]
  node_crc["CRC engine<br/>[crc.py]"]
end

subgraph group_identity["Authentication"]
  node_auth_api["Authentication API<br/>[views.py]"]
  node_auth_service["Key challenge service<br/>[services.py]"]
end

subgraph group_monitoring["Monitoring and events"]
  node_analytics_api["Analytics API<br/>[views.py]"]
  node_analytics_data[("Analytics records<br/>[models.py]")]
  node_event_service["Event logger<br/>[services.py]"]
  node_event_api["Security event API<br/>[views.py]"]
  node_socket_layer["WebSocket consumers<br/>[consumers.py]"]
  node_socket_routes["Socket routing<br/>[routing.py]"]
end

subgraph group_persistence["Application state"]
  node_sensor_data[("Sensor records<br/>[models.py]")]
  node_packet_data[("Packet records<br/>[models.py]")]
  node_auth_data[("User and key sessions<br/>[models.py]")]
  node_event_data[("Security events<br/>[models.py]")]
end

node_user(("Operator"))

node_user -->|"uses"| node_dashboard
node_user -->|"opens"| node_feature_pages
node_dashboard -->|"requests data"| node_api_client
node_feature_pages -->|"requests data"| node_api_client
node_api_client -->|"REST calls"| node_sensor_api
node_api_client -->|"REST calls"| node_packet_api
node_api_client -->|"REST calls"| node_auth_api
node_api_client -->|"REST calls"| node_analytics_api
node_api_client -->|"REST calls"| node_event_api
node_sensor_sim -->|"submits readings"| node_ingestion
node_sensor_api -->|"reads and writes"| node_sensor_data
node_packet_api -->|"ingests and verifies"| node_ingestion
node_ingestion -->|"calculates CRC"| node_crc
node_ingestion -->|"updates sequence"| node_sensor_data
node_ingestion -->|"stores packets"| node_packet_data
node_ingestion -->|"logs failures"| node_event_service
node_ingestion -->|"broadcasts packets"| node_socket_layer
node_auth_api -->|"runs key flow"| node_auth_service
node_auth_service -->|"updates sessions"| node_auth_data
node_auth_service -->|"logs auth events"| node_event_service
node_event_service -->|"stores events"| node_event_data
node_event_api -->|"reads events"| node_event_data
node_analytics_api -->|"reads metrics"| node_analytics_data
node_socket_routes -->|"routes connections"| node_socket_layer
node_ws_hook -->|"receives live packets"| node_socket_layer
node_socket_layer -->|"sends packet updates"| node_ws_hook

click node_dashboard "https://github.com/ayaanzaroon78/drdo-project/blob/main/frontend/app/(dashboard)/dashboard/page.tsx"
click node_feature_pages "https://github.com/ayaanzaroon78/drdo-project/tree/main/frontend/app/(dashboard)"
click node_api_client "https://github.com/ayaanzaroon78/drdo-project/blob/main/frontend/lib/api.ts"
click node_ws_hook "https://github.com/ayaanzaroon78/drdo-project/blob/main/frontend/hooks/useWebSocket.ts"
click node_sensor_sim "https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/sensors/simulator.py"
click node_sensor_api "https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/sensors/views.py"
click node_packet_api "https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/packets/views.py"
click node_ingestion "https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/packets/services.py"
click node_crc "https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/core/crc.py"
click node_sensor_data "https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/sensors/models.py"
click node_packet_data "https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/packets/models.py"
click node_auth_api "https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/authentication_app/views.py"
click node_auth_service "https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/authentication_app/services.py"
click node_auth_data "https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/authentication_app/models.py"
click node_analytics_api "https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/analytics/views.py"
click node_analytics_data "https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/analytics/models.py"
click node_event_service "https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/security_events/services.py"
click node_event_api "https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/security_events/views.py"
click node_event_data "https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/security_events/models.py"
click node_socket_layer "https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/websocket_app/consumers.py"
click node_socket_routes "https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/websocket_app/routing.py"

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_dashboard,node_feature_pages,node_api_client,node_ws_hook toneBlue
class node_sensor_sim,node_sensor_api,node_packet_api,node_ingestion,node_crc toneAmber
class node_auth_api,node_auth_service toneMint
class node_analytics_api,node_analytics_data,node_event_service,node_event_api,node_socket_layer,node_socket_routes toneRose
class node_sensor_data,node_packet_data,node_auth_data,node_event_data,node_user toneIndigo
```

## Components

### Dashboard client

- [Dashboard pages](https://github.com/ayaanzaroon78/drdo-project/blob/main/frontend/app/(dashboard)/dashboard/page.tsx): `frontend/app/(dashboard)/dashboard/page.tsx`
- [Feature pages](https://github.com/ayaanzaroon78/drdo-project/tree/main/frontend/app/(dashboard)): `frontend/app/(dashboard)`
- [REST client](https://github.com/ayaanzaroon78/drdo-project/blob/main/frontend/lib/api.ts): `frontend/lib/api.ts`
- [Live socket hook](https://github.com/ayaanzaroon78/drdo-project/blob/main/frontend/hooks/useWebSocket.ts): `frontend/hooks/useWebSocket.ts`

### Telemetry processing

- [Sensor simulator](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/sensors/simulator.py): `backend/sensors/simulator.py`
- [Sensor API](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/sensors/views.py): `backend/sensors/views.py`
- [Packet API](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/packets/views.py): `backend/packets/views.py`
- [Packet ingestion](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/packets/services.py): `backend/packets/services.py`
- [CRC engine](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/core/crc.py): `backend/core/crc.py`

### Authentication

- [Authentication API](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/authentication_app/views.py): `backend/authentication_app/views.py`
- [Key challenge service](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/authentication_app/services.py): `backend/authentication_app/services.py`

### Monitoring and events

- [Analytics API](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/analytics/views.py): `backend/analytics/views.py`
- [Analytics records](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/analytics/models.py): `backend/analytics/models.py`
- [Event logger](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/security_events/services.py): `backend/security_events/services.py`
- [Security event API](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/security_events/views.py): `backend/security_events/views.py`
- [WebSocket consumers](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/websocket_app/consumers.py): `backend/websocket_app/consumers.py`
- [Socket routing](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/websocket_app/routing.py): `backend/websocket_app/routing.py`

### Application state

- [Sensor records](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/sensors/models.py): `backend/sensors/models.py`
- [Packet records](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/packets/models.py): `backend/packets/models.py`
- [User and key sessions](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/authentication_app/models.py): `backend/authentication_app/models.py`
- [Security events](https://github.com/ayaanzaroon78/drdo-project/blob/main/backend/security_events/models.py): `backend/security_events/models.py`

### Other components

- **Operator**

## Connections

- Operator → Dashboard pages: uses
- Operator → Feature pages: opens
- Dashboard pages → REST client: requests data
- Feature pages → REST client: requests data
- REST client → Sensor API: REST calls
- REST client → Packet API: REST calls
- REST client → Authentication API: REST calls
- REST client → Analytics API: REST calls
- REST client → Security event API: REST calls
- Sensor simulator → Packet ingestion: submits readings
- Sensor API → Sensor records: reads and writes
- Packet API → Packet ingestion: ingests and verifies
- Packet ingestion → CRC engine: calculates CRC
- Packet ingestion → Sensor records: updates sequence
- Packet ingestion → Packet records: stores packets
- Packet ingestion → Event logger: logs failures
- Packet ingestion → WebSocket consumers: broadcasts packets
- Authentication API → Key challenge service: runs key flow
- Key challenge service → User and key sessions: updates sessions
- Key challenge service → Event logger: logs auth events
- Event logger → Security events: stores events
- Security event API → Security events: reads events
- Analytics API → Analytics records: reads metrics
- Socket routing → WebSocket consumers: routes connections
- Live socket hook → WebSocket consumers: receives live packets
- WebSocket consumers → Live socket hook: sends packet updates
