AirGuard: Building an Air-Quality-Aware Route Recommendation System
Introduction
Air pollution is a growing concern in urban areas. When travelling from one location to another, people usually focus on travel time and distance, but air quality can also be an important factor.
To explore this problem, I developed AirGuard, a web application that combines current air-quality information with travel-route data to help users compare different travel options.
As a solo developer, I worked on the project from development to deployment, gaining practical experience in full-stack development, API integration, and cloud deployment.
What Is AirGuard?
AirGuard is an air-quality-aware route recommendation system designed to help users make more informed travel decisions.
The application allows users to enter their starting point and destination and explore available travel options, including driving, public transit, and walking.
Its key features include:
- Air-quality monitoring: Retrieves current air-quality information, including the Air Quality Index (AQI).
- Route comparison: Retrieves route information, including estimated travel time and distance.
- Recommendation engine: Calculates illustrative scores using air quality, journey duration, and assumed travel-mode factors.
- Interactive interface: Provides a user interface for exploring air-quality information and comparing travel options.
Technology Stack
I used the following technologies to build AirGuard:
Technology | Purpose |
|---|
React | Frontend development |
TypeScript | Type-safe frontend development |
Python | Backend logic |
FastAPI | Backend API development |
Open-Meteo API | Air-quality data |
Google Routes API | Travel-route information |
GitHub | Source-code management |
Render | Backend deployment |
How Does It Work?
AirGuard connects the frontend, backend, and external APIs to provide route comparisons.
Step 1: User input
The user enters an origin and destination through the application interface.
Step 2: Air-quality data
The backend retrieves current air-quality information from Open-Meteo.
Step 3: Route information
The application requests route information from the Google Routes API for supported travel modes.
Step 4: Recommendation calculation
The backend combines current city-level AQI, route duration, and assumed travel-mode factors to calculate illustrative comparison scores.
Step 5: Results
The application returns the available routes and recommendation results to the frontend for display.
Note: The scores are illustrative estimates, not measurements of personal pollution exposure or route-specific pollution forecasts.
Challenges I Faced
Developing AirGuard involved several practical challenges.
1. API integration
Connecting external APIs required handling requests, responses, errors, and missing data.
2. Frontend and backend communication
I worked on connecting the React frontend with FastAPI endpoints and ensuring the application could retrieve and display backend responses.
3. Deployment and debugging
Deploying the backend on Render helped me understand environment variables, dependency management, deployment logs, and troubleshooting production issues.
4. Recommendation logic
I developed a rule-based scoring approach to compare available travel options. This also highlighted the importance of distinguishing illustrative scores from scientifically measured pollution exposure.
What I Learned
Building AirGuard helped me gain practical experience with:
- Full-stack web application development.
- REST API development using FastAPI.
- Integrating third-party APIs.
- Managing dependencies and environment variables.
- Deploying and debugging a backend application.
- Developing rule-based recommendation logic.
- Understanding the limitations of data-driven systems.
Working independently also helped me improve my problem-solving skills and take responsibility for the complete development process.
Future Improvements
There are several ways I would like to improve AirGuard:
- Incorporate more location-specific pollution data.
- Explore pollution forecasts for different departure times.
- Improve recommendation scoring using reliable environmental data.
- Enhance map visualization and route comparisons.
- Evaluate AWS services for future deployment and additional capabilities.
These improvements could make the application more informative and help users better understand the relationship between travel choices and air quality.
Conclusion
AirGuard started with a simple idea: What if air quality could be considered alongside travel time when comparing routes?
Building this project allowed me to turn that idea into a deployed web application while learning about APIs, backend development, frontend integration, recommendation systems, and deployment.
This project is an important step in my journey as an AI and Data Science engineering student, and I look forward to developing more practical applications that combine software engineering with data-driven problem-solving.
Project: AirGuard — Air-Quality-Aware Route Recommendation System
Technologies: React, TypeScript, Python, FastAPI, Open-Meteo, Google Routes API, and Render.
Loading article