You need to install NodeJS and optionally yarn.
Then inside this repository run:
npm install
# yarn install -- if you installed yarnTo start the development server run
npm run start
# yarn startBuild is required to assemble the code
npm run build
# yarn buildThe result will be a folder called build which contains the HTML page and all the assets.
Configuration is split inside two files, one is /src/constants.js
and the other is in /public/static/config.js. A third file will be produced
inside build/static/config.js when you run build.
Contains the configuration for layers, and configurations that are built inside the bundle. When you change those, you'll have to run again build.
This file allows to inject configurations without rebuilding the whole app. This file should be considered a blueprint and should provide a common environment for development.
This file should be actually modified depending on the environment, for example in a production environment this file should point API endpoints to actual production endpoints.
This file could be modified without requiring a whole rebuild of the webapp.
The app can be accessed at the following url https://wikimedia-osm-disability.web.app/
Data is automatically fetched via Overpass Turbo on install and build, queries that generate layers are .ql files inside the overpass directory.
The resulting data is a GeoJSON file that is placed inside public/static/data/ directory.
Updating data can be done in two steps:
- run
yarn pull-datato actually get the updates - run
yarn update-data-configto replace inside the build folder the layers and the configurations
this could be easily automated using a cron expression like
0 0 * * 0 cd PROJECT-PATH/; yarn pull-data; yarn update-data-config;
NOTES: the example doesn't handle error reporting, yarn could be replaced by npm run.