The SIH Institute Inspection Platform is a prototype for inspecting and monitoring educational institutes. It combines:
- A FastAPI service that receives live PC telemetry over WebSockets.
- Python client agents that report CPU, memory, network, disk, and system information.
- A standalone dashboard for live monitoring and PC inventory.
- A React/Vite portal for institute management, inspection workflows, and live telemetry.
- An optional Spring Boot backend for authentication, institute management, assignments, inspections, and ML result storage.
SIH_Prototype/
|-- server.py FastAPI telemetry server
|-- client.py PC monitoring agent
|-- dashboard/ Standalone HTML dashboard
|-- frontend/ React/Vite inspection portal
|-- backend/ Optional Spring Boot REST API
|-- live_detection.py Camera and ML inference utility
|-- camera_test.py Camera stream test utility
|-- models/ Trained inspection models and documentation
|-- requirements.txt Python dependencies
`-- .gitignore
Install the following before running the project:
- Python 3.10 or newer
- Node.js 18 or newer for the React portal
- Java 21 for the optional Spring Boot backend
- A local network connection when monitoring other PCs
The Python requirements include FastAPI, WebSockets, psutil, OpenCV, PyTorch, and Ultralytics. Some of these packages are large and may take time to install.
The FastAPI service and client agents are the core of the live PC monitoring feature.
From the SIH_Prototype directory:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements.txtOn macOS or Linux, activate the environment with:
source .venv/bin/activateRun this on the computer that will host the monitoring dashboard:
python -m uvicorn server:app --host 0.0.0.0 --port 8000The server will be available at http://localhost:8000.
Open client.py and set SERVER_IP to the LAN IPv4 address of the computer running the FastAPI server:
SERVER_IP = "192.168.1.10"
SERVER_PORT = 8000Use 127.0.0.1 when the client and server run on the same computer. Run the client on each monitored PC:
python client.pyEach client connects to ws://SERVER_IP:8000/ws, sends a system-information handshake, and then sends live metrics every two seconds. Static system information is refreshed periodically while the client is running and is also refreshed whenever the client reconnects.
Start a small static file server from the project directory:
python -m http.server 5500 --directory dashboardOpen http://localhost:5500 in a browser. The dashboard provides:
- Server and online-client status.
- Live CPU, RAM, IP address, and last-seen information.
- PC inventory for clients that have connected.
- Detailed system information for each PC.
The standalone dashboard reads the FastAPI service from http://127.0.0.1:8000. To view a server running on another computer, update API_BASE in dashboard/app.js.
In a second terminal:
cd frontend
npm install
npm run devOpen the URL printed by Vite, normally http://localhost:5173. The portal includes institute dashboards, lab and asset views, inspection workflow pages, and the live PC telemetry page. It connects to the FastAPI service at http://127.0.0.1:8000 and to the optional Spring Boot API at http://localhost:8080.
| Method | Endpoint | Purpose |
|---|---|---|
GET |
/ |
Server status, online-client count, and inventory count |
GET |
/clients |
Current live clients and telemetry |
GET |
/inventory |
Known clients with system information and online state |
WS |
/ws |
Client handshake and live telemetry stream |
The FastAPI server currently stores client and inventory data in memory. Inventory entries remain available while the server is running, including after a client disconnects, but they are cleared when the server process restarts. The client handshake repopulates and refreshes the record after a restart.
The backend/ directory contains a separate REST API for the broader inspection platform. It provides:
- JWT authentication and role-based access control.
- Institute and inspector management.
- Inspector-to-institute assignments.
- Inspection lifecycle management.
- Storage for combined ML inspection results.
- Audit events and dashboard summary endpoints.
The default configuration uses an in-memory H2 database, so PostgreSQL is not required for a basic local run.
From the backend directory on Windows:
.\mvnw.cmd spring-boot:runOn macOS or Linux:
./mvnw spring-boot:runThe backend runs at http://localhost:8080. Seed the standard development accounts with:
curl -X POST http://localhost:8080/api/auth/seedFor PostgreSQL configuration, copy backend/src/main/resources/application-local.yml.example to application-local.yml and provide the database credentials. See backend/README.md for the complete backend architecture and endpoint reference.
The repository also contains optional visual inspection utilities:
live_detection.pyruns camera-stream inference using the trained models.camera_test.pychecks access to a camera stream.models/contains the available model files and inference notes.
These utilities are independent of the PC telemetry dashboard. Review the model documentation before using the results for inspection decisions; the models are intended for prototype and human-review workflows.
# FastAPI server
python -m uvicorn server:app --host 0.0.0.0 --port 8000
# PC client
python client.py
# Standalone dashboard server
python -m http.server 5500 --directory dashboard
# React portal
cd frontend
npm run dev
# React production build and lint
npm run build
npm run lint
# Spring Boot tests
cd backend
./mvnw testOn Windows, use npm.cmd and mvnw.cmd if PowerShell does not resolve the command directly.
- Confirm that the FastAPI server is running on port
8000. - Confirm that
SERVER_IPinclient.pypoints to the server computer's reachable LAN address. - Make sure both computers are on the same network.
- Allow Python or TCP port
8000through the host computer's firewall. - Check the client terminal for connection and retry messages.
Stop the existing process using port 8000, or start the service on another port and update SERVER_PORT in client.py and API_BASE in the dashboard and frontend services.
The React portal expects the FastAPI service at http://127.0.0.1:8000. Start the scanner service first, or update frontend/src/services/scannerService.js when the scanner is hosted on another computer.
The React portal can still open in its standalone or fallback mode, but backend-backed authentication and persisted inspection workflows require the Spring Boot service on port 8080.
- Do not expose the development services directly to the public internet without authentication, access control, and a production deployment configuration.
- Keep
SERVER_IP, database credentials, and JWT secrets out of public commits when they contain environment-specific or sensitive values. - The current telemetry inventory is process-local memory. Use a database-backed store before relying on it for long-term asset records.