How lbou55/smart-classroom works
Smart Classroom monitors classroom conditions, predicts near-term temperature, and uses those readings to guide AC control. The main flow runs from ESP32 sensors (or the simulator) through Flask ingestion and prediction to Firebase-backed state and the web dashboard. The web app also provides authentication, historical statistics, chat, account and admin management, translations/themes, and blueprint downloads. Source excerpts confirm selected API and Firebase interactions; other capability links below rely on README descriptions, not inspection of unsampled implementation.
Main entry points: app.py Flask API · admin.js Admin controls · dashboard.js Live dashboard · stat.js Historical statistics
Components 19
Sensing and control
- ESP32 sensors
sketch_mar30a.ino - Sensor simulator
simulate_sensors.py - AC relay
sketch_mar30a.ino
Backend services
- Flask API
app.py - Temperature prediction
app.py - Sessions and accounts
app.py
Web application
- Admin controls
static/js/admin.js - Live dashboard
static/js/dashboard.js - Historical statistics
static/js/stat.js - Private chat
static/js/chat.js - Admin conversations
static/js/admin_conversations.js - User profile
static/js/profile.js - Signup
static/js/signup.js - User management
static/js/Settings.js - Themes and translation
static/js/lang.js - Blueprint downloads
templates/blueprints.html
Persistence and prediction
- Firebase Realtime DB
- Trained regression model
temperature_model.pkl
Other components
- Classroom users
Connections 21
- Classroom users → Live dashboard: views live data
README.md - ESP32 sensors → Flask API: posts sensor data
README.md - Sensor simulator → Flask API: posts readings
simulate_sensors.py - Flask API → Temperature prediction: predicts temperature
README.md - Temperature prediction → Trained regression model: uses model
README.md - Flask API → Firebase Realtime DB: synchronizes state
README.md - Flask API → AC relay: controls AC
- Live dashboard → Flask API: fetches latest readings
static/js/dashboard.js - Classroom users → Historical statistics: consults history
README.md - Historical statistics → Firebase Realtime DB: reads sensor history
- Classroom users → Private chat: exchanges messages
README.md - Private chat → Firebase Realtime DB: reads and writes chats
static/js/chat.js - Admin controls → Firebase Realtime DB: manages AC settings
- Admin controls → AC relay: sets AC mode
- Admin conversations → Firebase Realtime DB: reads conversations
static/js/admin_conversations.js - User profile → Firebase Realtime DB: updates profile
static/js/profile.js - Signup → Sessions and accounts: registers account
- User management → Firebase Realtime DB: manages users
static/js/Settings.js - Classroom users → User profile: edits profile
README.md - Classroom users → Blueprint downloads: downloads plans
README.md - Classroom users → Themes and translation: selects language or theme
README.md