How tds2k5/system-monitor works
System Monitor is a Flask web application for viewing live system resource usage. A browser reaches the login page, submits credentials, and—after authentication—opens a dashboard. The dashboard requests updates every five seconds; the server samples CPU, memory, disk, and network usage, applies the CPU/memory warning threshold, and returns JSON for display and chart updates. Session handling and dark-mode preference are supporting concerns. The README mentions historical analysis, but the available source shows live sampling and no historical-data store; templates were not sampled, so their internal structure is not mapped.
Main entry points: app.py Flask routes · index-script.js Data polling · index.html Dashboard page · login.html Login page
Components 14
Web application
- Flask routes
app.py - Login page
templates/login.html - Dashboard page
templates/index.html
Live monitoring
- System sampling
app.py - psutil metrics
- Warning threshold
app.py
Dashboard interface
- Data polling
static/js/index-script.js - Usage charts
static/js/index-script.js - Status display
static/js/index-script.js - Dark mode
static/js/index-script.js
Session and preference state
- Session handling
app.py - Flask-Session
- Browser preference
static/js/index-script.js
Other components
- Browser user
Connections 15
- Browser user → Flask routes: opens app
README.md - Flask routes → Login page: renders login
app.py - Flask routes → Dashboard page: renders dashboard
app.py - Flask routes → Session handling: checks login
app.py - Flask routes → Session handling: sets login
app.py - Flask routes → System sampling: samples metrics
app.py - System sampling → psutil metrics: reads metrics
app.py - Flask routes → Warning threshold: checks threshold
app.py - Flask routes → Flask-Session: configures sessions
app.py - Data polling → Flask routes: requests /data
static/js/index-script.js - Flask routes → Data polling: returns JSON
app.py - Data polling → Usage charts: updates charts
static/js/index-script.js - Data polling → Status display: updates status
static/js/index-script.js - Data polling → Dashboard page: updates page
static/js/index-script.js - Dark mode → Browser preference: stores preference
static/js/index-script.js