Google Summer of Code 2025 Project for OpenStreetMap Foundation
A comprehensive system for collecting and disseminating temporary road closure information, designed to enhance OSM-based navigation applications with real-time closure data and intelligent routing capabilities.
OpenStreetMap provides excellent static map data, but temporary road closures (construction, accidents, events) are often not captured quickly enough for navigation apps. This project bridges that gap by creating an open platform where:
- Community members can report temporary road closures in real-time through a user-friendly web interface
- Navigation applications can query closure data and calculate closure-aware routes
- OpenLR integration ensures cross-platform compatibility across different map providers
- OSM ecosystem benefits from enhanced real-time data and intelligent routing
- πΊοΈ Interactive Web Application: Next.js-based frontend for easy closure reporting and visualization
- π Closure-Aware Routing: Intelligent route calculation that avoids temporary road closures
- π΄ββοΈ Multi-Modal Support: Transportation-specific routing for cars, bicycles, and pedestrians
- π OpenLR Integration: Map-agnostic location references for universal compatibility
- π Secure Authentication: OAuth2 + JWT with Google/GitHub integration
- π Real-time Analytics: Live statistics and closure status tracking
- π― Geometry Support: Both point closures (intersections) and road segment closures
- π± Mobile Responsive: Optimized interface for field reporting on any device
temporary-road-closures/
βββ backend/ # FastAPI backend service β
β βββ app/ # Application code with OpenLR integration
β βββ docker-compose.yml # Development environment
β βββ requirements.txt # Python dependencies
β βββ README.md # Detailed backend documentation
βββ frontend/ # Next.js web application β
β βββ app/ # Next.js 15 App Router structure
β βββ components/ # React components for UI
β βββ services/ # API clients and utilities
β βββ context/ # State management
β βββ public/ # Static assets
β βββ package.json # Node.js dependencies
β βββ README.md # Detailed frontend documentation
βββ docs/ # Project documentation
βββ LICENSE # GNU AGPL v3.0 license
βββ README.md # This file
Complete FastAPI backend featuring:
- Database: PostgreSQL 15 + PostGIS 3.5 for advanced geospatial operations
- REST API: Comprehensive endpoints with OpenAPI/Swagger documentation
- Authentication: OAuth2 Password Bearer + JWT tokens with Google/GitHub integration
- OpenLR Service: Complete encoding/decoding for cross-platform compatibility
- Spatial Queries: Advanced geospatial filtering, bounding box searches, and route analysis
- Security: Rate limiting, CORS, input validation, and role-based access control
π View Detailed Backend Documentation
Complete Next.js web application featuring:
- Interactive Mapping: Leaflet.js-based map interface with OpenStreetMap tiles
- Closure Reporting: Multi-step guided forms for accurate closure submission
- Real-time Visualization: Live closure status with color-coded indicators
- Mobile Responsive: Touch-optimized interface for field reporting
- Authentication: JWT-based login with demo mode for testing
- Edit Capabilities: Update and delete your own closure reports
- Statistics Dashboard: Real-time analytics and closure insights
π View Detailed Frontend Documentation
Advanced routing system featuring:
- Transportation Modes: Car, bicycle, and pedestrian routing with mode-specific closure filtering
- Valhalla Integration: Open-source routing engine for accurate path calculation
- Smart Avoidance: Automatically avoid closures relevant to your transportation mode
- Route Comparison: Side-by-side comparison of direct vs. closure-aware routes
- Real-time Processing: Live calculation of optimal routes considering current closures
π View Routing Documentation
- Docker & Docker Compose (recommended for full setup)
- Node.js 18+ (for frontend development)
- Python 3.11+ (for backend development)
- Git
git clone https://github.com/Archit1706/temporary-road-closures
cd temporary-road-closurescd backend
# Copy environment configuration
cp .env.example .env
# Start all services with Docker
docker-compose up -d
# Verify services are running
docker-compose pscd frontend
# Install dependencies
npm install
# Configure environment
cp .env.example .env.local
# Start development server
npm run devAvailable Services:
- π Frontend Application: http://localhost:3000
- π Interactive Documentation: http://localhost:3000/docs
- π Backend API: http://localhost:8000
- π API Documentation: http://localhost:8000/api/v1/docs
- ποΈ Database Admin: http://localhost:8080 (Adminer)
# Health check
curl http://localhost:8000/health
# Try the web application
open http://localhost:3000
# Explore closure-aware routing
open http://localhost:3000/closure-aware-routingFor detailed setup instructions and development guides: π Backend Setup Guide π Frontend Setup Guide
- Server: Ubuntu 20.04+ or similar Linux distribution
- Docker & Docker Compose: Latest stable versions
- Domain Names: DNS configured for your domains (e.g., closures.osm.ch)
- SSL Certificates: Let's Encrypt (automated setup included)
The application includes automated SSL certificate management using Let's Encrypt:
-
Initial Certificate Setup:
# Install certbot on the host system sudo apt-get update sudo apt-get install certbot # Obtain certificates for your domains sudo certbot certonly --standalone \ -d closures.osm.ch \ -d api.closures.osm.ch \ --email [email protected] \ --agree-tos
-
Automated Renewal:
The
docker-compose.prod.ymlincludes a certbot service that automatically renews certificates twice daily.Alternatively, use the provided renewal script:
sudo ./scripts/renew_ssl.sh
-
Troubleshooting Expired Certificates:
If you see
ERR_CERT_DATE_INVALIDor similar SSL errors:# Renew certificates immediately sudo ./scripts/renew_ssl.sh # Or manually with certbot sudo certbot renew docker exec osm_closures_nginx_prod nginx -s reload
π Complete SSL Certificate Setup Guide
-
Clone and Configure:
git clone https://github.com/Archit1706/temporary-road-closures cd temporary-road-closures cp .env.prod.example .env.prod # Edit .env.prod with your production settings
-
Deploy Application:
./scripts/deploy_prod.sh
-
Verify Services:
docker-compose -f docker-compose.prod.yml ps curl https://closures.osm.ch curl https://api.closures.osm.ch/health
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Next.js Web β β Closure-Aware β β Navigation β
β Application βββββΊβ Routing βββββΊβ Apps β
β [Frontend] β β [Frontend] β β [Integration] β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
β
βββββββββββββββββββ
β FastAPI API β β β
**Complete**
β + OpenLR β
β + OAuth2 β
βββββββββββββββββββ
β
βββββββββββββββββββ
β PostgreSQL + β β β
**Complete**
β PostGIS β
βββββββββββββββββββ
Frontend (β Complete)
- Framework: Next.js 15 with TypeScript and App Router
- Mapping: Leaflet.js with React-Leaflet integration
- Styling: Tailwind CSS v4 with responsive design
- State Management: React Context API with useReducer
- Forms: React Hook Form with multi-step validation
- Icons: Lucide React icon library
- HTTP Client: Axios with interceptors
Backend (β Complete)
- API Framework: FastAPI with async support and automatic documentation
- Database: PostgreSQL 15 + PostGIS 3.5 for geospatial operations
- Authentication: OAuth2 + JWT with Google/GitHub integration
- Geospatial: PostGIS + GeoAlchemy2 for spatial queries
- Location Encoding: OpenLR integration for cross-platform compatibility
- Caching: Redis for performance optimization
- Containerization: Docker + Docker Compose for easy deployment
Routing Integration (β Complete)
- Routing Engine: Valhalla open-source routing service
- Transportation Modes: Auto, bicycle, and pedestrian support
- Spatial Processing: Automatic closure filtering based on transportation mode
- Route Optimization: Point exclusion and intelligent path finding
Scenario: Morning commute to work during construction season
- Check Route: Use closure-aware routing to plan your commute
- Select Mode: Choose "Auto" for car-based routing
- Compare Options: See direct route vs. closure-aware route
- Make Decision: Choose route that avoids construction delays
Scenario: Chicago Department of Transportation reporting water main repair
- Login: Authenticate with city credentials
- Report Closure: Use multi-step form to report road closure
- Set Details: Specify location, duration, and closure type
- Monitor: Track closure status and community feedback
Scenario: Bike commuter planning route through downtown
- Select Bicycle Mode: Choose transportation type for relevant filtering
- Route Planning: System automatically avoids car-only restrictions
- Bike Lane Awareness: Get notified of bike lane closures
- Safe Routing: Receive routes optimized for cycling safety
Scenario: Local resident spotting unexpected road closure
- Open App: Access the mobile-responsive web interface
- Quick Report: Submit closure report with location and photo
- Help Others: Contribute to community navigation knowledge
- Real-time Impact: Immediate availability for other users
Google Summer of Code 2025 - Completed Successfully:
- β Weeks 1-2: Project setup, database design, and initial API structure
- β Weeks 3-5: Core API implementation with authentication and CRUD operations
- β Weeks 6-7: OpenLR integration and advanced spatial query capabilities
- β Week 8: Midterm evaluation - Backend API complete and documented
- β Weeks 9-10: Frontend web application with interactive mapping and reporting
- β Weeks 11-12: Closure-aware routing implementation with Valhalla integration
- β Weeks 13-15: Testing, documentation, deployment guides, and project finalization
- 25+ API Endpoints with comprehensive OpenAPI documentation
- Real-time Geospatial Queries with PostGIS optimization
- OpenLR Integration for cross-platform location referencing
- OAuth2 Authentication with multiple provider support
- Rate Limiting and security best practices
- Docker Containerization for easy deployment
- Interactive Mapping with Leaflet.js and OpenStreetMap tiles
- Multi-step Forms with validation and progress tracking
- Responsive Design optimized for mobile field reporting
- Real-time Updates with live closure status calculation
- Demo Mode with 25+ sample closures for testing
- Closure-Aware Routing with transportation mode filtering
- Open Source: All code available under AGPL-3.0 license
- Standards Compliant: OpenLR, GeoJSON, and OSM compatibility
- Scalable Architecture: Designed for community growth
- Documentation: Comprehensive guides for users and developers
- Frontend Documentation - Complete web application guide
- Backend Documentation - API and development documentation
- Live Demo - Try the application locally
- API Interactive Docs - Swagger UI documentation
- Closure-Aware Routing - Advanced routing demo
- GSoC Project Page - Official Google Summer of Code listing
- OSM Diary Updates - Development blog and progress updates
- GitHub Repository - Complete source code
- OpenLR Specification - Location referencing standard
- Valhalla Routing - Open-source routing engine
- PostGIS Documentation - Spatial database capabilities
- FastAPI Documentation - Modern Python web framework
- Next.js Documentation - React-based frontend framework
This project welcomes contributions from the OpenStreetMap community and developers worldwide!
- Fork the repository on GitHub
- Clone your fork locally
- Setup Backend: Follow instructions in
./backend/README.md - Setup Frontend: Follow instructions in
./frontend/README.md - Create a feature branch:
git checkout -b feature/awesome-feature - Make your changes and add comprehensive tests
- Document your changes in relevant README files
- Submit a pull request with detailed description
- Bug Reports: GitHub Issues
- Feature Requests: GitHub Discussions
- Documentation: Improvements and clarifications always welcome!
- Security Issues: Email directly to [email protected]
- OSM Forum: community.openstreetmap.org
- OSM Mailing Lists: lists.openstreetmap.org
- GitHub Discussions: Project Discussions
- Developer Contact: [email protected]
- Backend Development: API enhancements, performance optimization, new endpoints
- Frontend Development: UI/UX improvements, new features, mobile optimization
- Documentation: User guides, API documentation, setup instructions
- Testing: Integration tests, performance testing, user acceptance testing
- Localization: Multi-language support for international OSM community
- Integration: Connections with other OSM tools and navigation applications
-
π§βπ» Student Developer: Archit Rathod (University of Illinois Chicago)
- Email: [email protected]
- GitHub: @Archit1706
- LinkedIn: Archit Rathod
- Portfolio: archit-rathod.vercel.app
-
π§ Primary Mentor: Simon Poole (OpenStreetMap Foundation)
-
πΊοΈ Secondary Mentor: Ian Wagner (Stadia Maps)
- Supporting open geographic data and collaborative mapping
- Enabling navigation innovation through open standards
- Fostering community-driven geospatial solutions
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
- Free Software: Always free to use, modify, and distribute
- Copyleft: Modifications must be shared under AGPL-3.0
- Network Use: Server-side modifications must be disclosed
- Commercial Use: Permitted with license compliance
- Community Driven: Open development and transparent governance
- Google Summer of Code for funding and program support
- OpenStreetMap Foundation for hosting, mentorship, and community
- University of Illinois Chicago for academic support and research opportunities
- PostGIS Team for powerful geospatial database capabilities
- FastAPI Team for the excellent Python web framework
- Next.js Team for the outstanding React framework
- Valhalla Project for open-source routing capabilities
- TomTom for OpenLR specification and reference implementations
- OSM Community Worldwide for feedback, testing, and real-world validation
- OsmAnd Developers for navigation integration discussions
- OpenLR Working Group for location referencing standards
- Chicago Department of Transportation for testing data and use cases
- React and TypeScript Communities for development best practices
- Open Source Contributors who made this project possible
Ready to explore the Temporary Road Closures system?
- Setup the Backend - Complete development environment
- Setup the Frontend - Web application development
- Explore the API - Interactive documentation
- Join the Community - Connect with other contributors
- Learn About the Project - OSM diary updates
- Try the Web App - Experience the complete interface
- Test Closure-Aware Routing - Advanced routing features
- Provide Feedback - Help shape the future
- Review Integration Examples - Connect your systems
- Understand OpenLR - Cross-platform compatibility
- Explore API Capabilities - Integration possibilities
- Contact the Team - Discuss your specific use case
- Visit the Application - Start reporting closures
- Try Demo Mode - No login required for testing
- Learn Closure-Aware Routing - Better route planning
- Read User Guide - Comprehensive documentation
This Google Summer of Code 2025 project has successfully delivered:
- Production-ready FastAPI with comprehensive documentation
- PostgreSQL + PostGIS database with optimized spatial queries
- OpenLR integration for cross-platform compatibility
- OAuth2 authentication with multiple providers
- Rate limiting, security, and monitoring capabilities
- Next.js 15 web application with TypeScript
- Interactive mapping with closure visualization
- Multi-step closure reporting forms
- Real-time status tracking and analytics
- Mobile-responsive design for field use
- Closure-aware route calculation
- Transportation mode filtering (auto, bicycle, pedestrian)
- Valhalla routing engine integration
- Real-time route comparison and optimization
- Open-source solution for the OSM ecosystem
- Standards-compliant implementation (OpenLR, GeoJSON)
- Comprehensive documentation for users and developers
- Foundation for future navigation app integration
π Star this repository if you find it useful for the OpenStreetMap ecosystem!
π’ Follow development progress in the OSM diary and GitHub discussions.
π Try the live demo by following the Quick Start guide above.
Building the future of open navigation data, one closure at a time. πΊοΈβ¨
"Temporary closures, permanent solutions" - Making OSM navigation smarter for everyone.