Overview
Discover what makes OpenStreetMap powerful
`openstreetmap-website` is the core Ruby on Rails application that powers the public OpenStreetMap web site, its editing API (v0.6), and the integrated iD editor. From a developer’s standpoint it is a full‑stack web platform that exposes both user‑facing features (diary, messaging, GPX uploads) and a robust RESTful API for programmatic access to OSM data. The application is intentionally decoupled from the heavy map‑tile rendering and geocoding services; those are provided by separate, specialized components (e.g., TileServer‑PHP, Mapnik, or commercial services), allowing developers to focus on the API and user interface layers.
API v0.6
iD Editor Integration
GPX Handling
User Management
Overview
openstreetmap-website is the core Ruby on Rails application that powers the public OpenStreetMap web site, its editing API (v0.6), and the integrated iD editor. From a developer’s standpoint it is a full‑stack web platform that exposes both user‑facing features (diary, messaging, GPX uploads) and a robust RESTful API for programmatic access to OSM data. The application is intentionally decoupled from the heavy map‑tile rendering and geocoding services; those are provided by separate, specialized components (e.g., TileServer‑PHP, Mapnik, or commercial services), allowing developers to focus on the API and user interface layers.
Key Features
- API v0.6 – XML/JSON endpoints for reading and writing OSM objects (nodes, ways, relations) with authentication via OAuth1.0a.
- iD Editor Integration – A client‑side JavaScript editor embedded in the Rails views, exposing a rich set of events and hooks for custom workflows.
- GPX Handling – Upload, parse, and serve GPX tracks with support for conversion to OSM objects.
- User Management – Account creation, email confirmation, password reset, and two‑factor authentication.
- Community Tools – Local chapter listings pulled from the
osm-community-indexrepository, with translation support via Translatewiki.
Technical Stack
| Layer | Technology | Rationale |
|---|---|---|
| Web Framework | Ruby on Rails (v6+) | Convention‑over‑configuration, mature ecosystem, built‑in testing framework. |
| Database | PostgreSQL (with PostGIS) | Spatial extensions for efficient geospatial queries; used by the API and GPX services. |
| Background Jobs | Sidekiq (Redis) | Handles long‑running tasks such as GPX import, email delivery, and cache invalidation. |
| Search | ElasticSearch or PostgreSQL full‑text | Powers the search UI for users and OSM objects. |
| Asset Pipeline | Webpacker / Sprockets | Bundles JavaScript (iD, Leaflet) and CSS for the browser front‑end. |
| Testing | RSpec, Capybara | Extensive unit and integration tests covering API behavior and UI flows. |
The application follows Rails’ MVC pattern but also exposes a set of internal services (e.g., Geo::TileFetcher) that can be reused in other Ruby projects. The codebase is heavily documented, with inline comments and a dedicated API documentation section that mirrors the official OSM wiki.
Deployment & Infrastructure
Self‑hosting requires a standard LAMP/LEMP stack with PostgreSQL and Redis. The repository ships with Docker Compose files that spin up Rails, Postgres, Redis, and a development tile server. For production, the recommended architecture is:
- Rails app behind an Nginx reverse proxy (SSL termination).
- PostgreSQL + PostGIS on a dedicated database server or managed service.
- Redis for Sidekiq queues and session storage.
- Tile rendering service (e.g., Mapnik or TileServer‑PHP) serving PNG/JPEG tiles.
- Geocoding via Nominatim or a third‑party service for reverse lookups.
Horizontal scaling is straightforward: Rails instances can be load‑balanced, while Sidekiq workers scale with additional Redis queues. The API rate limits are enforced via middleware that can be tuned per deployment.
Integration & Extensibility
Developers can extend the platform through several mechanisms:
- Rails Engines – Add new routes or views without modifying core code.
- ActiveRecord Callbacks – Hook into object creation to trigger external services (e.g., webhook notifications).
- Webhooks – The API supports “hook” URLs that are called after a commit, enabling CI/CD pipelines to react to map changes.
- iD Plugin API – Custom tools can be added to the iD editor, exposing new toolbar buttons or data layers.
- OAuth – Third‑party applications can obtain delegated access to user accounts for read/write operations.
The modular design means that a developer can replace the map‑tile backend with any OSM-compatible tile server, or swap out PostGIS for a different spatial database if needed.
Developer Experience
The codebase follows Rails best practices, with comprehensive RSpec test suites and a continuous‑integration pipeline that enforces linting and coverage thresholds. Documentation is split into three layers:
- README & INSTALL – Quick start for contributors.
- API Docs – Mirrors the OSM wiki, with example payloads and error codes.
- Developer Wiki – Guides on adding features, database migrations, and deployment recipes.
Community support is robust: a dedicated mailing list (rails-dev@openstreetmap.org), IRC channel #osm-dev, and an active issue tracker ensure that questions are answered quickly. Licensing under GPLv2 encourages open collaboration while protecting the integrity of the code.
Use Cases
- Custom OSM Front‑ends – Build a localized mapping site that reuses the OpenStreetMap API and authentication flow.
- Enterprise GIS Platforms – Deploy an internal OSM instance with enterprise‑grade authentication and audit logging.
- Educational Tools – Provide students with a sandboxed OSM environment to learn about geospatial data and open‑source software.
- Data‑Driven Applications – Combine OSM data with proprietary datasets in a
Open SourceReady to get started?
Join the community and start self-hosting OpenStreetMap today
Related Apps in other
Immich
Self‑hosted photo and video manager
Syncthing
Peer‑to‑peer file sync, no central server
Strapi
Open-source headless CMS for modern developers
reveal.js
Create stunning web‑based presentations with HTML, CSS and JavaScript
Stirling-PDF
Local web PDF editor with split, merge, convert and more
MinIO
Fast, S3-compatible object storage for AI and analytics
Weekly Views
Repository Health
Information
Explore More Apps
GNUnet
Secure, distributed network protocol stack for privacy‑preserving apps
Expressa
Build APIs fast with JSON‑schema powered middleware
Cockpit CMS
Headless content platform for any front‑end
Tox
Secure, serverless instant messaging for all devices
Dropserver
Your personal web app platform
Uguu
Fast, lightweight temporary file hosting