https://github.com/freifunk/openwifimap-api
OpenWiFiMap database and its api
https://github.com/freifunk/openwifimap-api
Last synced: 9 months ago
JSON representation
OpenWiFiMap database and its api
- Host: GitHub
- URL: https://github.com/freifunk/openwifimap-api
- Owner: freifunk
- Created: 2013-05-09T14:44:43.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2021-11-17T00:58:06.000Z (over 4 years ago)
- Last Synced: 2024-03-26T00:12:40.521Z (over 2 years ago)
- Language: Python
- Size: 37.1 KB
- Stars: 35
- Watchers: 12
- Forks: 12
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# openwifimap-api (Python)
OpenWiFiMap is a database and map for free network WiFi routers (freifunk and others, too!).
This is the database/backend part of the openwifimap.
Make sure to also take a look at its web frontend, the [openwifimap HTML5 app](https://github.com/freifunk/openwifimap-html5).
The original backend was written in Javascript using CouchDB.
Since maintaining that was problematic, it was rewritten in 2020/2021 to use Python/FastAPI/PostgreSQL.
# API
See the Swagger API docs at `/docs` on the running backend (at [api.openwifimap.net/docs](https://api.openwifimap.net/docs), for example).
The somewhat more verbose old API doc can be found in the [old API.md](https://github.com/freifunk/openwifimap-api/blob/f9001452f4f4a72c4dbd59dd736436b6c5733775/API.md).
# License
openwifimap is licensed under the [MIT license](http://opensource.org/licenses/MIT).
# Development info
The backend is basically keeping a list of JSON documents on disk which can get queried and updated via a web API.
The database is used as search index only.
PostgreSQL is total overkill for this but ¯\_(ツ)_/¯
The interesting part of the code is in [restapi.py](/backend/backend/restapi.py).
In case you wonder, endpoint definitions are a bit complicated (BaseModel, response_model, Field, Query, ...) since FastAPI can generate nice Swagger API docs from this.
## Dev notes
* sudo docker run --name owm_psql -p 127.0.0.1:5432:5432 -e POSTGRES_PASSWORD= -e POSTGRES_USER=owmuser -e POSTGRES_DB=owmdb -d postgres:latest
* PostgreSQL earthdistance extension: https://postindustria.com/postgresql-geo-queries-made-easy/ (not used yet)