A desktop dashboard for monitoring and managing a UniFi home network.
Built for my AQA A Level Computer Science NEA (2026), achieving 70/75.
OpenHaven connects to a local UniFi console through the official UniFi Network API, stores what it collects in a local SQLite database, and presents it as a desktop app. It aims to give a household a clearer view of its network than the stock controller UI: who is connected, to which access point, and how much traffic is flowing.
It was written as my Non-Exam Assessment for AQA A Level Computer Science, so the code is heavily commented to explain the reasoning behind each decision.
- Overview: headline stats, clients per access point and traffic over time
- Devices: connected clients and access points, plus a live network topology graph
- Admin actions: restart an access point, or show/hide a Wi-Fi network's SSID
- Audit logs: a record of every admin action and who performed it
- User accounts: admin and member access levels, with passwords hashed using Argon2 and checked against complexity rules
- Data retention: automatically delete history older than 7, 30 or 90 days, or keep it forever
- Auto-refresh: fetches new data from the console every 60 seconds, with a manual refresh option
flowchart LR
subgraph app["OpenHaven desktop app (pywebview)"]
direction LR
ui["<b>Frontend</b><br/>HTML · CSS · JS SPA<br/><i>served by Express on :3000</i>"]
api["<b>Python backend</b><br/>Api class<br/><i>src/index.py</i>"]
ui <-- "JS bridge" --> api
end
subgraph services["backend/services"]
direction TB
collect["collectData +<br/>unifi_api"]
admin["adminActions"]
db["database +<br/>dataRetention"]
users["user_service"]
end
api --> collect & admin & db & users
unifi[("UniFi console<br/>Network API")]
sqlite[("SQLite<br/>data/database.db")]
collect -- "fetch every 60s" --> unifi
admin -- "restart AP · toggle SSID" --> unifi
db --> sqlite
users -- "Argon2 hashes" --> sqlite
- Desktop shell: pywebview opens a native
window and exposes the Python
Apiclass to JavaScript. - Frontend: a vanilla JS single-page app with one class per view, styled with Appwrite Pink. The topology graph uses vis-network.
- Backend services (
backend/services/):unifi_api.py: HTTP client for the UniFi Network APIcollectData.py: turns API responses into model objectsdatabase.py: writes those objects to SQLiteadminActions.py: restarts access points and toggles SSID broadcastsuser_service.py: handles accounts and authenticationdataRetention.py: deletes outdated records
- Database schema:
data/schema.sql
- A UniFi console (e.g. a Cloud Gateway or Dream Machine) running UniFi Network with the Integration API available, and an API key for it
- Python 3.13+ and uv
- Node.js 18+
cp .env.example .envFill in API_KEY, CONSOLE_IP, SITE_ID and CONSOLE_ID in .env.
uv sync
cd frontend && npm install && cd ..uv run scripts/init_db.pyStart the frontend server in one terminal:
node frontend/server.jsThen launch the desktop app in another:
uv run src/index.pyThe first time you open it, create an admin account. You can add member accounts from the Users page afterwards.
backend/
config/ # loads .env and shared constants
models/ # model classes (devices, clients, traffic samples…)
services/ # API client, data collection, DB, users, admin actions
data/schema.sql # SQLite schema
frontend/ # Express server + single-page app (views in static/js/views)
scripts/ # database initialisation
src/index.py # entry point: pywebview window + Api bridge
testing/ # ad-hoc scripts used during development
- OpenHaven is a student project designed for a trusted home network, not a hardened production tool.
- TLS certificate verification is turned off for requests to the console, because UniFi consoles use self-signed certificates on the local network.
- The scripts in
testing/were used during development and may need small import path changes to run against the current layout.
- The
setIntervalhelper insrc/index.pyis taken from pywebview-react-boilerplate (BSD 3-Clause). - Other sources and tutorials are credited in comments where they were used.
OpenHaven is released under the MIT License. Third-party code is credited in comments where it is used and remains under its original licence.