How mateusrondon/monitoramento-cardiaco works
Project type and purpose
• This is an IoT + web‐based full-stack monitoring system (“SystemBPM”) that uses an ESP32 + MAX30100/30102 sensor to measure heart rate (BPM) and SpO2, presenting results via a responsive web UI and persisting data in Firebase.
File structure
• /back-end: Arduino/ESP32 sketches ( .ino and .cpp ) that initialize Wi-Fi, read sensor, run an internal WebServer, define HTTP routes (/bpm, /spo2), and push data to Firebase.
• /Integracao-Web/project: A modern web client (Vite + React + TypeScript + Tailwind) containing components (Dashboard, VitalChart, Login, etc.), contexts (AuthContext, SensorContext), and build/config files.
• README.md: high-level description, flowchart of the ESP32 logic, tech stack.
Key insights from README
• ESP32 runs a WebServer exposing sensor data as JSON on HTTP routes.
• The web client consumes those JSON endpoints and also writes to Firebase for long-term storage.
• System flow: sensor → ESP32 → serve JSON → React UI → Firebase.
• IoT Device (ESP32 + MAX30100/30102 sensor)
• Internal WebServer on ESP32 (routes /, /bpm, /spo2)
• React Frontend (Vite app)
• Authentication Context (AuthContext)
• Sensor Context (SensorContext)
• Firebase (Realtime DB or Firestore)
• (Optional) Serial Monitor for local logging
1. Hardware sensor → ESP32 (I²C data reads)
2. ESP32 WebServer → serves static UI (index.html + JS) over Wi-Fi
3. React UI → polls /bpm, /spo2 endpoints on ESP32
4. SensorContext → distributes fetched data through React component tree
5. UI Components (Dashboard, VitalChart) → render real-time metrics
6. ESP32 → pushes measurement JSON to Firebase (HTTP POST)
7. AuthContext → manages user sessions if any backend auth layer exists
8. Firebase → serves as historical data store for future retrieval
c. Architectural patterns & design principles:
• IoT edge computing: sensor data processed on-device
• Client-server: ESP32 as minimal HTTP API provider
• React Context for state management (separate Auth & Sensor concerns)
• Single Page Application served as static assets
• External service integration (Firebase) for persistence
d. Key technologies & frameworks:
• ESP32 C++ (WebServer.h)
• Arduino-CLI
• MAX30100/30102 sensor library
• React + TypeScript + Vite + Tailwind CSS
• Firebase (Realtime Database or Firestore)
• Optional: ESLint, PostCSS, tsconfig