AirNexa is a decentralized smart air purification and hyperlocal monitoring system designed for Delhi NCR. It uses IoT sensors, AI-driven analytics, and real-time dashboards to combat air pollution through low-cost, localized solutions for homes, schools, buses, and communities.
- Real-Time Monitoring: Continuous air quality data from IoT sensors measuring PM2.5, PM10, CO, NOx, SOx, VOCs, temperature, humidity, and more.
- AI-Driven Purification: Smart air purifiers that adapt based on sensor data and environmental conditions.
- Interactive Dashboard: Web-based dashboard with live metrics, trends, pollutant composition, and device status.
- Map Integration: Leaflet-based map showing device locations and AQI heatmaps.
- Auto-Data Generation: Simulated data generation for testing and demonstration.
- Socket.IO Updates: Real-time updates via WebSockets for live data refresh.
- Frontend: React, Chart.js, Leaflet, Socket.IO Client
- Backend: Node.js, Express, Socket.IO
- Database: MongoDB with Mongoose
- Deployment: Docker-ready, environment-based configuration
-
Clone the Repository:
git clone https://github.com/Saurabhtbj1201/AirNexa.git cd airnexa -
Install Dependencies:
- Backend:
cd server && npm install - Frontend:
cd client && npm install
- Backend:
-
Environment Setup:
- Copy
.envfiles and configure:server/.env: SetMONGODB_URI,PORT=4000,CORS_ORIGIN=http://localhost:5173- Ensure MongoDB is running locally or via cloud (e.g., MongoDB Atlas).
- Copy
-
Seed Database:
cd server && npm run seed
-
Run the Application:
- Backend:
cd server && npm start - Frontend:
cd client && npm run dev - Access at
http://localhost:5173
- Backend:
- Home Page: Overview of the system, pollution sources, and interactive map.
- Dashboard: Real-time metrics, charts, and device management.
- API Endpoints: See below for available APIs.
POST /api/devices/register: Register a new device.GET /api/devices: List all devices.GET /api/devices/status: Get device statuses with locations.
POST /api/readings: Ingest sensor readings.GET /api/aqi/live: Get live AQI averages.GET /api/stats/trends: Get AQI trends (last 24h).GET /api/stats/composition: Get pollutant composition averages.GET /api/stats/comparison: Compare AQI before/after purification.GET /api/stats/heatmap: Get heatmap data for devices.GET /api/stats/summary: Get summary stats (devices, online, avg AQI).GET /api/stats/total-readings: Get total readings in last 24h.POST /api/generate-data: Generate random sample data (for testing).
reading:new: Emitted on new readings for real-time updates.
airnexa/
├── client/ # React frontend
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ └── services/
│ └── public/
├── server/ # Node.js backend
│ ├── src/
│ │ ├── models/
│ │ ├── routes/
│ │ └── scripts/
│ └── config/
├── README.md # This file
└── package.json # Root scripts
- Fork the repository.
- Create a feature branch:
git checkout -b feature-name. - Commit changes:
git commit -m 'Add feature'. - Push to branch:
git push origin feature-name. - Open a pull request.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.