# parijagitsss/labsphere architecture

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

- Interactive diagram: https://gitdiagram.com/parijagitsss/labsphere
- Repository: https://github.com/parijagitsss/labsphere

## Overview

LabSphere is a lab-classroom monitoring and teaching-control system. Teachers manage sessions and lab computers in the dashboard; student clients register with the backend and send activity and screen data, which teachers can review and act on. The backend coordinates live connections and persists session/activity records, while teacher screen broadcasts and desktop annotation provide live instruction. Source excerpts establish the main HTTP, WebSocket, and local browser-activity flows; other dashboard capabilities are represented where documented, without inferring unsampled call paths.

Main entry points: [`backend/app/main.py`](https://github.com/parijagitsss/labsphere/blob/main/backend/app/main.py) (Lab API), [`teacher-dashboard/src/App.jsx`](https://github.com/parijagitsss/labsphere/blob/main/teacher-dashboard/src/App.jsx) (Teacher dashboard), [`student-client/student.py`](https://github.com/parijagitsss/labsphere/blob/main/student-client/student.py) (Student client), [`backend/app/database.py`](https://github.com/parijagitsss/labsphere/blob/main/backend/app/database.py) (Database connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_teacher["Teacher tools"]
  node_dashboard["Teacher dashboard<br/>[App.jsx]"]
  node_dashboard_mount["Dashboard mount<br/>[main.jsx]"]
  node_overlay["Desktop ink overlay<br/>[teacher_overlay.py]"]
  node_session_control["Session control<br/>[App.jsx]"]
  node_screen_broadcast["Teacher screen broadcast<br/>[App.jsx]"]
  node_activity_review["Activity review<br/>[App.jsx]"]
end

subgraph group_backend["Backend services"]
  node_api["Lab API<br/>[main.py]"]
  node_connections["Connection manager<br/>[manager.py]"]
  node_config["Backend configuration<br/>[config.py]"]
  node_computer_monitoring["Computer monitoring<br/>[main.py]"]
  node_activity_classification["Activity classification<br/>[main.py]"]
  node_session_activity["Session activity records<br/>[main.py]"]
  node_computer_commands["Computer commands<br/>[main.py]"]
end

subgraph group_student["Student monitoring"]
  node_client["Student client<br/>[student.py]"]
  node_browser_extension["Browser extension<br/>[background.js]"]
  node_local_activity["Local activity receiver<br/>[student.py]"]
end

subgraph group_persistence["Persistence"]
  node_database_config["Database connection<br/>[database.py]"]
  node_mongo[("MongoDB Atlas")]
end

node_teacher(("Teacher"))

node_teacher -->|"uses"| node_dashboard
node_dashboard_mount -->|"renders"| node_dashboard
node_dashboard -->|"calls HTTP API"| node_api
node_dashboard -->|"manages sessions"| node_session_control
node_dashboard -->|"fetches status"| node_computer_monitoring
node_dashboard -->|"uploads frames"| node_screen_broadcast
node_dashboard -->|"fetches activity"| node_activity_review
node_overlay -->|"connects WebSocket"| node_api
node_api -->|"uses"| node_connections
node_api -->|"imports collections"| node_database_config
node_database_config -->|"connects"| node_mongo
node_client -->|"registers and streams"| node_api
node_api -->|"sends frames and commands"| node_client
node_browser_extension -->|"posts tab activity"| node_local_activity
node_client -->|"hosts receiver"| node_local_activity
node_api -->|"classifies activity"| node_activity_classification
node_api -->|"reads session records"| node_session_activity
node_session_activity -->|"uses collections"| node_database_config
node_computer_commands -->|"dispatches commands"| node_connections
node_screen_broadcast -->|"broadcast reaches clients"| node_client

click node_dashboard "https://github.com/parijagitsss/labsphere/blob/main/teacher-dashboard/src/App.jsx"
click node_dashboard_mount "https://github.com/parijagitsss/labsphere/blob/main/teacher-dashboard/src/main.jsx"
click node_overlay "https://github.com/parijagitsss/labsphere/blob/main/teacher_overlay.py"
click node_api "https://github.com/parijagitsss/labsphere/blob/main/backend/app/main.py"
click node_connections "https://github.com/parijagitsss/labsphere/blob/main/backend/app/websocket/manager.py"
click node_config "https://github.com/parijagitsss/labsphere/blob/main/backend/app/config.py"
click node_database_config "https://github.com/parijagitsss/labsphere/blob/main/backend/app/database.py"
click node_client "https://github.com/parijagitsss/labsphere/blob/main/student-client/student.py"
click node_browser_extension "https://github.com/parijagitsss/labsphere/blob/main/student-client/browser-extension/background.js"
click node_local_activity "https://github.com/parijagitsss/labsphere/blob/main/student-client/student.py"
click node_session_control "https://github.com/parijagitsss/labsphere/blob/main/teacher-dashboard/src/App.jsx"
click node_computer_monitoring "https://github.com/parijagitsss/labsphere/blob/main/backend/app/main.py"
click node_activity_classification "https://github.com/parijagitsss/labsphere/blob/main/backend/app/main.py"
click node_session_activity "https://github.com/parijagitsss/labsphere/blob/main/backend/app/main.py"
click node_screen_broadcast "https://github.com/parijagitsss/labsphere/blob/main/teacher-dashboard/src/App.jsx"
click node_computer_commands "https://github.com/parijagitsss/labsphere/blob/main/backend/app/main.py"
click node_activity_review "https://github.com/parijagitsss/labsphere/blob/main/teacher-dashboard/src/App.jsx"

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_dashboard_mount,node_overlay,node_session_control,node_screen_broadcast,node_activity_review toneBlue
class node_api,node_connections,node_config,node_computer_monitoring,node_activity_classification,node_session_activity,node_computer_commands toneAmber
class node_client,node_browser_extension,node_local_activity toneMint
class node_database_config,node_mongo toneRose
class node_teacher toneIndigo
```

## Components

### Teacher tools

- [Teacher dashboard](https://github.com/parijagitsss/labsphere/blob/main/teacher-dashboard/src/App.jsx): `teacher-dashboard/src/App.jsx`
- [Dashboard mount](https://github.com/parijagitsss/labsphere/blob/main/teacher-dashboard/src/main.jsx): `teacher-dashboard/src/main.jsx`
- [Desktop ink overlay](https://github.com/parijagitsss/labsphere/blob/main/teacher_overlay.py): `teacher_overlay.py`
- [Session control](https://github.com/parijagitsss/labsphere/blob/main/teacher-dashboard/src/App.jsx): `teacher-dashboard/src/App.jsx`
- [Teacher screen broadcast](https://github.com/parijagitsss/labsphere/blob/main/teacher-dashboard/src/App.jsx): `teacher-dashboard/src/App.jsx`
- [Activity review](https://github.com/parijagitsss/labsphere/blob/main/teacher-dashboard/src/App.jsx): `teacher-dashboard/src/App.jsx`

### Backend services

- [Lab API](https://github.com/parijagitsss/labsphere/blob/main/backend/app/main.py): `backend/app/main.py`
- [Connection manager](https://github.com/parijagitsss/labsphere/blob/main/backend/app/websocket/manager.py): `backend/app/websocket/manager.py`
- [Backend configuration](https://github.com/parijagitsss/labsphere/blob/main/backend/app/config.py): `backend/app/config.py`
- [Computer monitoring](https://github.com/parijagitsss/labsphere/blob/main/backend/app/main.py): `backend/app/main.py`
- [Activity classification](https://github.com/parijagitsss/labsphere/blob/main/backend/app/main.py): `backend/app/main.py`
- [Session activity records](https://github.com/parijagitsss/labsphere/blob/main/backend/app/main.py): `backend/app/main.py`
- [Computer commands](https://github.com/parijagitsss/labsphere/blob/main/backend/app/main.py): `backend/app/main.py`

### Student monitoring

- [Student client](https://github.com/parijagitsss/labsphere/blob/main/student-client/student.py): `student-client/student.py`
- [Browser extension](https://github.com/parijagitsss/labsphere/blob/main/student-client/browser-extension/background.js): `student-client/browser-extension/background.js`
- [Local activity receiver](https://github.com/parijagitsss/labsphere/blob/main/student-client/student.py): `student-client/student.py`

### Persistence

- [Database connection](https://github.com/parijagitsss/labsphere/blob/main/backend/app/database.py): `backend/app/database.py`
- **MongoDB Atlas**

### Other components

- **Teacher**

## Connections

- Teacher → Teacher dashboard: uses (evidence: `teacher-dashboard/src/App.jsx`)
- Dashboard mount → Teacher dashboard: renders (evidence: `teacher-dashboard/src/main.jsx`)
- Teacher dashboard → Lab API: calls HTTP API (evidence: `teacher-dashboard/src/App.jsx`)
- Teacher dashboard → Session control: manages sessions (evidence: `teacher-dashboard/src/App.jsx`)
- Teacher dashboard → Computer monitoring: fetches status (evidence: `teacher-dashboard/src/App.jsx`)
- Teacher dashboard → Teacher screen broadcast: uploads frames (evidence: `teacher-dashboard/src/App.jsx`)
- Teacher dashboard → Activity review: fetches activity (evidence: `teacher-dashboard/src/App.jsx`)
- Desktop ink overlay → Lab API: connects WebSocket (evidence: `teacher_overlay.py`)
- Lab API → Connection manager: uses (evidence: `backend/app/main.py`)
- Lab API → Database connection: imports collections (evidence: `backend/app/main.py`)
- Database connection → MongoDB Atlas: connects (evidence: `backend/app/database.py`)
- Student client → Lab API: registers and streams (evidence: `student-client/student.py`)
- Lab API → Student client: sends frames and commands (evidence: `backend/app/main.py`)
- Browser extension → Local activity receiver: posts tab activity (evidence: `student-client/browser-extension/background.js`)
- Student client → Local activity receiver: hosts receiver (evidence: `student-client/student.py`)
- Lab API → Activity classification: classifies activity (evidence: `backend/app/main.py`)
- Lab API → Session activity records: reads session records (evidence: `backend/app/main.py`)
- Session activity records → Database connection: uses collections (evidence: `backend/app/main.py`)
- Computer commands → Connection manager: dispatches commands (evidence: `backend/app/main.py`)
- Teacher screen broadcast → Student client: broadcast reaches clients
