A professional, full-stack environmental GIS tool for real-time pollution monitoring and community-verified hotspot reporting in Bhubaneswar, India.
This application addresses urban air quality monitoring by:
- Displaying real-time pollution hotspots on an interactive map
- Enabling community-verified pollution reporting
- Providing actionable insights for environmental action
- Supporting data-driven urban planning decisions
- Real-time visualization of 31+ pollution hotspots across Bhubaneswar
- Color-coded markers based on AQI levels (Green <200, Orange 200-300, Red >300)
- Dynamic pan and zoom functionality
- Detailed popup information for each hotspot
- Total hotspots monitoring
- Critical areas tracking (AQI >300)
- Average city-wide AQI calculation
- Top emissions list sorted by severity
- Citizen science integration
- Report new pollution hotspots
- Categorize pollution types (vehicular, industrial, fire, construction, waste)
- Success notifications with toast messages
- Dark-themed modern interface
- Fully responsive design (mobile, tablet, desktop)
- Shadcn UI components
- Smooth animations and transitions
- Interactive sidebar with clickable hotspot cards
- Next.js 14 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- Shadcn UI - High-quality component library
- React Leaflet - Interactive maps
- Sonner - Toast notifications
- Next.js API Routes - Serverless API endpoints
- MongoDB Atlas - Cloud database
- Mongoose - ODM for MongoDB
- Leaflet.js - Open-source mapping library
- OpenStreetMap - Map tiles
pollutionx/
βββ src/
β βββ app/
β β βββ api/
β β β βββ hotspots/route.ts # Hotspots CRUD API
β β β βββ reports/route.ts # Reports submission API
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Main dashboard
β β βββ globals.css # Global styles
β βββ components/
β β βββ Map.tsx # Interactive map component
β β βββ ReportHotspotDialog.tsx # Report modal
β β βββ ui/ # Shadcn UI components
β βββ hooks/
β β βββ useHotspots.ts # Data fetching hook
β βββ lib/
β β βββ db.ts # MongoDB connection
β β βββ utils.ts # Utility functions
β βββ models/
β βββ Hotspot.ts # Hotspot schema
β βββ Report.ts # Report schema
βββ scripts/
β βββ seed-data.js # Database seeding script
βββ bhubaneswar-hotspots.json # Initial data
βββ package.json
- Node.js 18+
- MongoDB Atlas account
- npm or yarn
- Clone the repository
git clone <repository-url>
cd pollutionx- Install dependencies
npm install --legacy-peer-deps- Set up environment variables
Create a
.env.localfile:
MONGODB_URI=your_mongodb_connection_string- Seed the database
node scripts/seed-data.js- Run the development server
npm run dev- Open the application
Navigate to
http://localhost:3000
Retrieve pollution hotspots with optional filtering and pagination.
Query Parameters:
limit- Number of results (default: 10)page- Page number (default: 1)type- Filter by pollution typeminAqi- Minimum AQI filtermaxAqi- Maximum AQI filter
Response:
{
"success": true,
"data": [...hotspots],
"pagination": {
"current": 1,
"total": 4,
"count": 10,
"totalRecords": 31
}
}Create a new hotspot (bulk or single).
Request Body:
{
"name": "Location Name",
"lat": 20.2961,
"lng": 85.8245,
"aqi": 285,
"intensity": 0.88,
"type": "vehicular",
"source": "Traffic congestion",
"recommendation": "Traffic management"
}Retrieve community reports.
Submit a new pollution report.
Request Body:
{
"locationName": "Bhubaneswar Railway Station",
"description": "vehicular: Heavy diesel emissions from buses",
"timestamp": "2026-01-01T12:00:00Z"
}- Dark Theme: Professional environmental monitoring aesthetic
- Color-Coded AQI: Immediate visual feedback on air quality
- Responsive Grid: Adapts to all screen sizes
- Interactive Elements: Hover states, animations, and transitions
- Accessible: WCAG-compliant contrast ratios and keyboard navigation
{
name: String,
lat: Number,
lng: Number,
intensity: Number,
aqi: Number,
type: 'fire' | 'industrial' | 'vehicular' | 'natural' | 'other',
source: String,
recommendation: String
}{
locationName: String,
description: String,
timestamp: Date
}This project was built using modular development sprints:
- Part 1: Foundation (Next.js + MongoDB setup)
- Part 2: API Routes & Data Seeding
- Part 3: Interactive Mapping with Leaflet
- Part 4: Dashboard UI with Shadcn
- Part 5: Community Reporting & Final Polish
- Real-time data updates with WebSockets
- Historical AQI trends and charts
- User authentication and report verification
- Mobile app (React Native)
- AI-powered pollution prediction
- Multi-city support
- Export data as CSV/PDF reports
- Integration with government air quality APIs
This project is built for educational and demonstration purposes.
Contributions are welcome! Please feel free to submit issues or pull requests.
For questions or feedback about this environmental monitoring tool, please open an issue in the repository.
Built with β€οΈ for cleaner air in Bhubaneswar