Bug reports, feature requests and pull requests are welcome but please bear in mind that there may be some delay before I have time to respond to these.
If planning a pull request you may wish to open an issue first to discuss your modifications. Please try to stick to the guidelines below. There are also instructions on setting up a development environment.
The following tools are used in this project:
With the exception of importing OpenStreetMap data and producing statistics/graphs, the backend is written in Python.
- OpenStreetMap import: Imposm 3
- Database: PostGIS
- Object Relational Mapper: SQLAlchemy (with GeoAlchemy2)
- Web framework: Flask
- Storage for rate limiting: Redis
- Statistics: written in R using tidyverse packages
The frontend is written in JavaScript (ES6).
- Mapping: Leaflet
- Unit testing: unittest
- Please follow PEP 8 and use pylint to check your code e.g. using
docker-compose run python scripts/run_pylint.sh
- Please use double quotes (") for strings
- Feel free to break up sections of code with a blank line
- Please put two blank lines between class and method definitions
- Please follow the Airbnb style guide with the modifications configured in
package.json
and use eslint to check your code e.g. usingdocker-compose run node npm run lint
- Please use double quotes (") for strings
- Code lines should be 79 characters or less, unless they contain a URL or finish with a coverage/pylint/eslint comment
- Python docstring lines should be 72 characters or less
- Please separate Python standard library, third-party and local imports with a line break, and within each block import in alphabetical order of package
- In Python code, in general please use the
from x import y
style
These are a work in progress but please do write unit tests for any new code (apart from that which downloads external data) and check coverage.
- You can find unit tests in
tests/
with a file per class per module docker-compose run python scripts/run_tests.sh
will run the tests and provide a coverage report incoverage/python
- You can find unit tests in
fhodot/app/ui/src
docker-compose run node npm run test
will run the tests in Chromium Headless using Karma and provide a coverage report incoverage/javascript
- Tests can also be run in a browser (
http://127.0.0.1:5000/tests.html
) once bundled withdocker-compose up node
ordocker-compose run node npm run build