How mitishraina/dewdrop works
Project type and purpose
• This is a full-stack IoT + AI data-visualization application (“DewDrop”) for harvesting and managing fog-condensed water.
• It integrates custom hardware sensors, a Node.js/Express real-time server, Python-based ML microservices (fog prediction & water-quality analysis), and a React.js frontend dashboard.
File structure
• Top-level “hardware” folder: Arduino (.ino) and a JavaScript serialReader to collect sensor data from pH, TDS, humidity, temperature sensors and ionizer hardware.
• “server” folder: Node.js/Express backend (index.js), REST/WebSocket routes under server/routes for deviceControl and real-time updates.
• “python models” folder: two separate ML services:
– fogpredictionmodel.h5 + main.py (likely a script or micro-service for fog density prediction)
– “water quality” subfolder with app.py serving potable water analysis, using an xgboost_model.joblib.
• “src” folder: React application (Vite config, CSS, components, pages, utility libraries).
• No formal database—data persistence currently via CSVs or in-memory; could be extended later.
README for additional insights
• Describes system workflow:
1. Hardware collects data
2. Ionized dehumidifier condenses water
3. Data flows to website for analysis, visualization, predictions
• Tech stack: React, Node.js/Express, AI/ML (Python).
• Emphasis on real-time analytics (WebSockets) and centralized management for multi-device deployment.
a. Main components
• Hardware Layer: Sensors + Ionizer + Arduino
• Edge Data Collector: serialReader.js (device gateway)
• Backend Server: Node.js/Express
• ML Microservices:
– Fog Prediction Service (Python main.py)
– Water Quality Service (Python app.py)
• Frontend Dashboard: React/Vite app
• Data Stores: CSV files (placeholder), potential future DB
• External Integrations (future): Solar power controller, Web3 registry
b. Relationships & interactions
1. Hardware → serialReader: sensor readings over serial/USB
2. serialReader → Backend: HTTP POST or WebSocket publish
3. Backend → ML Services: REST or child-process calls to Python endpoints
4. ML Services → Backend: JSON responses (predictions, analysis)
5. Backend → Frontend: real-time data via WebSocket; config and control via REST
6. Frontend → Backend: user actions (device control, config changes)
c. Architectural patterns & principles
• Layered architecture: Edge (hardware), Gateway, Application (server), AI microservices, Presentation (frontend)
• Microservice pattern: separate Python services for easy scaling
• Event-driven: WebSocket for live updates
• Component-based UI: React components per domain (device, admin, charts)
d. Key technologies
• Hardware: Arduino C++ (.ino)
• Edge code: Node.js serialport (serialReader.js)
• Server: Node.js, Express.js, ws or socket.io
• ML: TensorFlow/Keras (.h5), XGBoost (.joblib), Flask or FastAPI (app.py)
• Frontend: React.js, Vite, Tailwind CSS