Smart Routing for a Greener Future.
Calculate routes based on fuel efficiency, CO2 emissions, and environmental factors—not just travel time.
EcoRoute Optimizer is an intelligent navigation and simulation platform designed to minimize carbon footprints. Unlike traditional GPS applications that prioritize the fastest path, this system performs a multi-dimensional analysis of elevation gradients, real-time weather conditions, and traffic patterns to identify the most fuel-efficient route.
The project features a high-performance FastAPI backend for complex physics-based cost modeling, an interactive Leaflet.js web dashboard, and a sophisticated Autonomous Agent that simulates dynamic environment changes and performs real-time re-routing.
Watch the full explanation and walkthrough of the project here:
(Link to be updated)
The system is built with a modular architecture, ensuring clear separation between core logic, API services, and the simulation agent.
- Frontend: Interactive web UI built with HTML5, Bootstrap, and Leaflet Maps for real-time visualization.
- API Engine: FastAPI-powered backend providing RESTful endpoints for route calculation and TTS generation.
- Autonomous Agent: A CLI-based simulation engine (
autonomous_agent.py) that demonstrates the system's ability to react to dynamic environmental shifts. - Neural Voice Service: Integration with Microsoft Edge TTS for high-quality, natural-sounding route guidance.
The application follows a rigorous data pipeline to convert raw geographic data into environmental insights:
- Weather Service: Fetches live data from Open-Meteo API.
- Elevation Service: Analyzes terrain profiles via Open-Elevation API.
- Traffic Service: Infers road conditions using OSRM duration deltas and historical patterns.
- Cost Model: A physics-based engine that calculates fuel consumption (L) and CO2 (kg) by weighing distance, ascent, and external resistance factors.
- 🌱 Eco-Routing: Prioritizes routes with the lowest environmental impact.
- ⛰️ Terrain Awareness: Incorporates elevation gain into fuel consumption calculations.
- 🌤️ Dynamic Weather: Adjusts estimates based on real-time precipitation and wind speed.
- 🤖 Autonomous Rerouting: Agent-driven simulation that switches routes as conditions evolve.
- 🗣️ AI Voice Guidance: Crystal-clear neural voice summaries of trip metrics.
- 🔑 API Key Free: Utilizes open-source and free-tier APIs (Open-Meteo, Open-Elevation, OSRM, Edge TTS) for zero-cost operation.
- Backend: FastAPI (Python 3.9+)
- Frontend: HTML5, CSS3, JavaScript (Leaflet.js, Bootstrap 5)
- Simulation: Custom Autonomous Agent (Python)
- Voice AI: Microsoft Edge Neural TTS
- Data APIs:
- Routing: OSRM (Open Source Routing Machine)
- Weather: Open-Meteo
- Elevation: Open-Elevation
- Deployment: Docker, Docker Compose, Vercel, Render
.
├── assets/ # Documentation diagrams
├── backend/ # Containerized backend service
├── frontend/ # Containerized frontend service
├── autonomous_agent.py # CLI Autonomous Simulation Agent
├── main.py # FastAPI Application Entry Point
├── core.py # Shared logic and environmental services
├── requirements.txt # Python dependencies
└── docker-compose.yml # Multi-container orchestration
- Python 3.9+
- Internet connection (for OSRM, Weather, and Elevation APIs)
-
Clone the repository
git clone https://github.com/yourusername/ecoroute-optimizer.git cd ecoroute-optimizer -
Install Dependencies
pip install -r requirements.txt
-
Run the Web Application
uvicorn main:app --reload
Access the UI at
http://localhost:8000. -
Run the Autonomous Agent
python autonomous_agent.py
Run the entire stack using Docker Compose:
docker-compose up --buildThis project is licensed under the MIT License.

