Map engine to serve all the people :)
Project description
Good Map
Map engine to serve all the people ;)
Project Structure
This repository is a monorepo containing three parts:
goodmap/(repo root) — the Python backend, built on theplatzkyframework, published to PyPI asgoodmap.frontend/— the React frontend, built and bundled into the PyPI package (seemake build-frontend). Not published as a separate npm package.e2e-tests/— Playwright-based end-to-end tests exercising the backend and frontend together.
Each has its own dependency manager (poetry for the backend and e2e-tests, npm for the frontend) and is set up independently — see each directory's README for details. The root Makefile has convenience targets (make dev, make lint-check-all) that run across all three.
Setup
0. Clone the repo
git clone --recursive
Remember, everytime you want to pull the newest changes, run:
git pull
git submodule update
because goodmap contains a submodule.
#TODO remove all submodule connected instructions after removing platzky submodule (see #157)
1. Use python 3.10
If you have a different version of Python on your system, install python 3.10 alongside. For that, you can use pyenv. Follow the documentation. Useful commands: pyenv help <command>, pyenv install, pyenv shell, pyenv versions.
2. Install poetry in Python 3.10
poetry can create virtual environments associated with a project.
Make sure you are in the Python 3.10 environment and install:
pip install poetry
Useful commands: poetry -h <command>, poetry env list, poetry env info.
3. Install dependencies
poetry install
4. You're ready
When you enter the project directory, you can invoke any commands in your project like this:
poetry run <command>
Running App locally
TL;DR
If you don't want to go through all the configuration, e.g. you just simply want to test if everything works,
you can simply run app with test dataset provided in examples directory:
poetry run flask --app 'goodmap.goodmap:create_app(config_path="./examples/e2e_test_config.yml")' run
Configuration
If you want to serve app with your configuration rename config-template.yml to config.yml and change its contents according to your needs.
Afterwards run it with:
poetry run flask --app 'goodmap.goodmap:create_app(config_path="/PATH/TO/YOUR/CONFIG")' --debug run
| Option | Description |
|---|---|
| USE_LAZY_LOADING | Loads point data only after the user clicks a point. If set to false, point data is loaded together with the initial map. |
| FAKE_LOGIN | If set to true, allows access to the admin panel by simply selecting the role instead of logging in. DO NOT USE IN PRODUCTION! |
| SHOW_ACCESSIBILITY_TABLE | If set as true it shows special view to help with accessing application. |
Database
The database is stored in JSON, in the map section. For an example database see examples/e2e_test_data.json. The first subsection data consists of the actual datapoints, representing points on a map.
Datapoints have fields. The next subsections define special types of fields:
obligatory_fields- here are explicitely stated all the fields that the application assumes are presnt in all datapoints. E.g.
"position",
"name",
"accessible_by"
TODO: obligatory_fields is a new subsection, start using it in the actual application
categories- fields that can somehow be used in the app, for example by which datapoints can be filtered. Every category has a specified list of allowed values. E.g.
"accessible_by": ["bikes", "cars", "pedestrians"]
visible_data- when a datapoint will be rendered as a pin on a map, these fields will be shown in the box when clicking on a pin. E.g.
"name",
"type_of_place"
meta-data- some special data like
"uuid"
You can define the fields in all these subsections. Besides these types of fields, there is no restriction on the number of fields a datapoint can have.
Running E2E Tests
E2E tests use Playwright and require both servers to be running before invoking make e2e-tests:
make run-e2e-backend # generates the e2e config/data, then serves the backend on :5000
make run-frontend # webpack dev server on :8080
make e2e-tests # checks both are up, then runs the tests
make run-e2e-backend regenerates the templated config and a fresh copy of the test data before starting, so no separate setup step is needed. make e2e-tests performs a single-shot check and exits with a helpful message if either server is missing.
Examples
You can find examples of working configuration and database in examples/ directory:
e2e_test_config.yml- Basic configuration examplee2e_test_data.json- Example database with sample location datamongo_e2e_test_config.yml- MongoDB configuration example
final test
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file goodmap-2.0.0a1.tar.gz.
File metadata
- Download URL: goodmap-2.0.0a1.tar.gz
- Upload date:
- Size: 339.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7fa6580d9dbc00727cafae26cf4494c077924404fc35403c76b4787a56525b8
|
|
| MD5 |
e1fc88a5599008a134eddd52855ace0b
|
|
| BLAKE2b-256 |
84b651703eab0962fa0fcf8997a5f0c736c698bde6c3f817415907ee421f07c5
|
Provenance
The following attestation bundles were made for goodmap-2.0.0a1.tar.gz:
Publisher:
release.yml on Problematy/goodmap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
goodmap-2.0.0a1.tar.gz -
Subject digest:
e7fa6580d9dbc00727cafae26cf4494c077924404fc35403c76b4787a56525b8 - Sigstore transparency entry: 2008991118
- Sigstore integration time:
-
Permalink:
Problematy/goodmap@c17da07599aff24e4e273c5ab4cd0b0e15a2cf81 -
Branch / Tag:
refs/heads/next - Owner: https://github.com/Problematy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c17da07599aff24e4e273c5ab4cd0b0e15a2cf81 -
Trigger Event:
push
-
Statement type:
File details
Details for the file goodmap-2.0.0a1-py3-none-any.whl.
File metadata
- Download URL: goodmap-2.0.0a1-py3-none-any.whl
- Upload date:
- Size: 343.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a493905e424d9d72687a1caab645a2d6febc4c32ae4a9cc931fe5def0c857f7
|
|
| MD5 |
6e2f21adbfeb40c5203ccbeca0351714
|
|
| BLAKE2b-256 |
18b69a50c81e1f9c311d03cafe23045fdc1611ea484e89c98d9e349b049934c6
|
Provenance
The following attestation bundles were made for goodmap-2.0.0a1-py3-none-any.whl:
Publisher:
release.yml on Problematy/goodmap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
goodmap-2.0.0a1-py3-none-any.whl -
Subject digest:
7a493905e424d9d72687a1caab645a2d6febc4c32ae4a9cc931fe5def0c857f7 - Sigstore transparency entry: 2008991254
- Sigstore integration time:
-
Permalink:
Problematy/goodmap@c17da07599aff24e4e273c5ab4cd0b0e15a2cf81 -
Branch / Tag:
refs/heads/next - Owner: https://github.com/Problematy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c17da07599aff24e4e273c5ab4cd0b0e15a2cf81 -
Trigger Event:
push
-
Statement type: