How peera-exe/wifi-human-detection works
This Flask Wi-Fi sensing demo serves role-based user and admin dashboards. The main workflow polls simulated room-sensing state, displays occupancy and movement, and records detection history; administrators can also configure scenarios, thresholds, calibration, and dataset recording. Login events and detection records are stored in SQLite. The sensing source is a simulator rather than a demonstrated hardware integration; the UI mentions LINE alerts, but no alert service is evidenced. Relationships reflect the sampled app and JavaScript excerpts.
Main entry points: app.py Status and controls API · admin.js Admin panel client · login.html Login page · database.py SQLite records
Components 14
Web interface
- Login page
templates/login.html - User dashboard
templates/user_dashboard.html - User dashboard client
static/js/user.js - Admin panel
templates/admin_panel.html - Admin panel client
static/js/admin.js
Application server
- Flask routes
server/app.py - Login and sessions
server/app.py - Status and controls API
server/app.py - History API
server/app.py
Sensing simulation
- Scenario sensing simulator
server/data_source.py - Dataset capture
server/data_source.py
Persistence
- SQLite records
server/database.py
Other components
- User
- Admin
Connections 23
- User → Login page: opens
- Admin → Login page: opens
- Login page → Login and sessions: submits login
- Login and sessions → Flask routes: routes to dashboards
server/app.py - Flask routes → Login page: renders
server/app.py - Flask routes → User dashboard: renders
server/app.py - Flask routes → Admin panel: renders
server/app.py - User → User dashboard: uses
- Admin → Admin panel: uses
- User dashboard client → Status and controls API: polls status
static/js/user.js - User dashboard client → Status and controls API: sets security
static/js/user.js - User dashboard client → History API: loads and clears
static/js/user.js - Admin panel client → Status and controls API: polls status
static/js/admin.js - Admin panel client → Status and controls API: sets controls
static/js/admin.js - Admin panel client → History API: loads and clears
static/js/admin.js - Admin panel client → Login and sessions: loads login logs
static/js/admin.js - Status and controls API → Scenario sensing simulator: reads state
server/app.py - Status and controls API → Scenario sensing simulator: sets scenario and controls
server/app.py - Status and controls API → SQLite records: writes detection logs
server/app.py - History API → SQLite records: reads and clears history
server/app.py - Login and sessions → SQLite records: records and reads login logs
server/app.py - Scenario sensing simulator → Dataset capture: captures frames when recording
server/data_source.py - Dataset capture → SQLite records: saves frames
server/data_source.py