How mery1738/sprint0 works
Project Type and Purpose
• This is an end-to-end BLE-based IoT measurement system (full-stack + hardware) that:
• Captures sensor data on an Arduino iBeacon device via BLE
• Uses an Android app to receive BLE data and forward it via HTTP
• Hosts a Node.js/Express REST API that persists measurements in SQLite
• Provides a web client (HTML/CSS/JS) to display the latest measurement
Main Components
a. Hardware & Firmware (Arduino)
• Sketch files under src/arduino/HolaMundoIBeacon (.ino & .h)
• Emits BLE advertisements with measurement payloads
b. Mobile App (Android)
• Java code in src/telefono/app/src/main/java/com/example/mery/beaconapp
• Listens for BLE adverts, builds JSON payloads, issues HTTP POST to /medicion
c. Backend / REST API
• src/servidor/servidorREST/mainServidorREST.js (Express server)
• src/servidor/servidorREST/ReglasREST.js (route definitions)
• src/servidor/logica/Logica.js (DB logic layer)
d. Database (SQLite)
• src/servidor/bd/datos.db (actual DB file)
• src/servidor/bd/crearTablas.sql (schema)
e. Web Client
• src/cliente/index.html, style.css, LogicaFake.js
• Polls GET /ultimaMedicion, updates UI
f. Tests (Mocha/Chai/jsdom/Supertest)
• Organized under servidor/logica/test and servidor/servidorREST/test
Interactions & Data Flows
1. BLE (Bluetooth LE)
• Arduino iBeacon → Android App scanner
2. HTTP POST /medicion
• Android App → REST API (Express)
3. Persistence
• Express → SQLite via Logica.js
4. HTTP GET /ultimaMedicion
• Web Client → REST API → returns JSON
5. UI Rendering
• Web Client parses JSON, updates HTML
Architectural Patterns & Design Principles
• Layered architecture:
• Presentation Layers (Mobile, Web)
• API Layer (Express controllers/routes)
• Business Logic Layer (Logica.js)
• Data Layer (SQLite)
• Separation of concerns: hardware code, mobile UI/logic, server API/logic, client UI
• Single-responsibility modules: each folder/file holds one concern
Detailed Capturing of Architectural Elements
• Drill down into server: show “ReglasREST.js” feeding into “Logica.js”
• SQLite file path under “SQLite Database”
• Test harness components off to the side
• Network configuration note: Android’s endpoint configurable (e.g., 10.0.2.2)