ThisPc-Api is a Redis publisher, and an API endpoint used in ThisPc project, to deliver performance and system resources data about this pc.
ThisPC-Client: installed on the PC to monitor with.
- Collect: CPU, Memory, Network IO and Storage Disks stats.
- API endpoint: Using FastAPI this pc becomes an API endpoint allowing remote entities to query the collected data about system resources, performance and running processes.
- Interactive API documentation thanks to FastAPI automatic docs generation (OpenAPI).
- Redis Publisher: This pc regularly publishes its collected data under a Redis channel PC- which enables subscribers to the PC-* pattern to get live data.
Clone this repository
git clone https://github.com/Goldenboycoder/this-pc-api.git
cd this-pc-apipip install fastapi
pip install "uvicorn[standard]"
pip install "uvicorn[standard]" gunicorn
pip install redis
Depending on your environment you can use one of the following:
If running on Windows OS, use the ASGI server uvicorn which runs in a single process:
python deploy.py -m uvicorn
If running on Linux, then use gunicorn as a process manager in addition to uvicorn worker processes.
python deploy.py -m gunicorn
Open your browser to: 127.0.0.1:5555/docs
You will see the automatic interactive API documentation (provided by Swagger UI) The docs get automatically updated as you change the API.
Go to: 127.0.0.1:5555/redocs
You will see the alternative automatic documentation (provided by ReDoc)
N.B: Port number may be different if you changed it.

