Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Bhubaneswar Urban Emission Tracker

A professional, full-stack environmental GIS tool for real-time pollution monitoring and community-verified hotspot reporting in Bhubaneswar, India.

🌍 Project Overview

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

✨ Features

πŸ—ΊοΈ Interactive Pollution Map

  • 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

πŸ“Š Dashboard Analytics

  • Total hotspots monitoring
  • Critical areas tracking (AQI >300)
  • Average city-wide AQI calculation
  • Top emissions list sorted by severity

πŸ“ Community Reporting

  • Citizen science integration
  • Report new pollution hotspots
  • Categorize pollution types (vehicular, industrial, fire, construction, waste)
  • Success notifications with toast messages

πŸ’» Professional UI/UX

  • Dark-themed modern interface
  • Fully responsive design (mobile, tablet, desktop)
  • Shadcn UI components
  • Smooth animations and transitions
  • Interactive sidebar with clickable hotspot cards

πŸ› οΈ Technology Stack

Frontend

  • 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

Backend

  • Next.js API Routes - Serverless API endpoints
  • MongoDB Atlas - Cloud database
  • Mongoose - ODM for MongoDB

GIS & Mapping

  • Leaflet.js - Open-source mapping library
  • OpenStreetMap - Map tiles

πŸ“ Project Structure

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

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • MongoDB Atlas account
  • npm or yarn

Installation

  1. Clone the repository
git clone <repository-url>
cd pollutionx
  1. Install dependencies
npm install --legacy-peer-deps
  1. Set up environment variables Create a .env.local file:
MONGODB_URI=your_mongodb_connection_string
  1. Seed the database
node scripts/seed-data.js
  1. Run the development server
npm run dev
  1. Open the application Navigate to http://localhost:3000

πŸ“‘ API Endpoints

Hotspots API

GET /api/hotspots

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 type
  • minAqi - Minimum AQI filter
  • maxAqi - Maximum AQI filter

Response:

{
  "success": true,
  "data": [...hotspots],
  "pagination": {
    "current": 1,
    "total": 4,
    "count": 10,
    "totalRecords": 31
  }
}

POST /api/hotspots

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"
}

Reports API

GET /api/reports

Retrieve community reports.

POST /api/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"
}

🎨 Design Features

  • 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

πŸ“Š Data Model

Hotspot Schema

{
  name: String,
  lat: Number,
  lng: Number,
  intensity: Number,
  aqi: Number,
  type: 'fire' | 'industrial' | 'vehicular' | 'natural' | 'other',
  source: String,
  recommendation: String
}

Report Schema

{
  locationName: String,
  description: String,
  timestamp: Date
}

πŸ”„ Development Workflow

This project was built using modular development sprints:

  1. Part 1: Foundation (Next.js + MongoDB setup)
  2. Part 2: API Routes & Data Seeding
  3. Part 3: Interactive Mapping with Leaflet
  4. Part 4: Dashboard UI with Shadcn
  5. Part 5: Community Reporting & Final Polish

🌟 Future Enhancements

  • 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

πŸ“ License

This project is built for educational and demonstration purposes.

πŸ‘₯ Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

πŸ“§ Contact

For questions or feedback about this environmental monitoring tool, please open an issue in the repository.


Built with ❀️ for cleaner air in Bhubaneswar

About

Urban carbon emission hotspot mapping

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages