Lightweight FastAPI + Leaflet web app for editing and monitoring bicycle infrastructure using plain GeoJSON files.
Simple civic mapping app to manage bike-lane and cycling-issue layers with a QGIS-friendly, file-based workflow.
This project is intentionally simple:
- FastAPI backend
- Leaflet + Leaflet.draw frontend
- No database
- No authentication
- GeoJSON files as the source of truth
The app starts with Palermo data, but switching to another city only requires updating config.json and replacing the two GeoJSON files.
- Single map view with two editable layers:
- bicycle lanes (
cycle_segments.geojson) - issues (
cycle_issues.geojson)
- bicycle lanes (
- Create, edit, and delete geometries on the map
- Edit feature properties from a collapsible sidebar
- Preserve unknown properties when updating features
- Save edits back to GeoJSON files
- Export GeoJSON files for download
app.py
config.json
requirements.txt
README.md
LICENSE
data/
cycle_segments.geojson
cycle_issues.geojson
backend/
config_store.py
geojson_store.py
feature_utils.py
static/
index.html
styles.css
app.js
- Create and activate a virtual environment.
- Install dependencies:
pip install -r requirements.txt
- Start the app:
uvicorn app:app --reload
- Open
http://127.0.0.1:8000.
- Install dependencies with
pip install -r requirements.txt. - Start the server:
uvicorn app:app --host 0.0.0.0 --port 8000
- Persist the
data/directory, because edits are written back to files.
- Put this repository content at the Space root (or set it as the app directory).
- Install dependencies from
requirements.txt. - Launch command:
uvicorn app:app --host 0.0.0.0 --port 7860
- Ensure the Space has write access to
data/so save actions work.
- Edit
config.json:city_namedefault_centeranddefault_zoom- optional
bounding_box - file names for
cycle_segments_fileandcycle_issues_file
- Replace the two GeoJSON files with your city data.
- Keep GeoJSON as
FeatureCollectionfor QGIS compatibility.
Viktor Balashov
Licensed under the Apache License, Version 2.0. See LICENSE.