Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

1) Installation and build

fatal69100 edited this page Jul 21, 2022 · 12 revisions

Requirements

  • Node 16
  • NPM 8

If you're using nvm - you can simply use the following command after cloning the project

> nvm use

Clone the project

  • Clone the Erdapfel repository from Github: https://github.com/Qwant/erdapfel

  • Add a .env file in the root folder to set up the environment variables.

  • The env file below is for Github contributors:

TILEVIEW_mapStyle_baseMapUrl=["https://www.qwant.com/maps/tiles/ozbasemap/{z}/{x}/{y}.pbf"]
TILEVIEW_mapStyle_poiMapUrl=["https://www.qwant.com/maps/tiles/ozpoi/{z}/{x}/{y}.pbf"]
TILEVIEW_services_geocoder_url=https://www.qwant.com/maps/detail/v1/autocomplete
TILEVIEW_services_idunn_url=https://www.qwant.com/maps/detail
TILEVIEW_system_baseUrl=/
TILEVIEW_direction_enabled=true
TILEVIEW_direction_service_api=mapbox
TILEVIEW_direction_service_apiBaseUrl=https://api.mapbox.com/directions/v5/mapbox/
TILEVIEW_direction_service_token={Add your mapbox token}
TILEVIEW_direction_publicTransport_enabled=false
TILEVIEW_category_enabled=true
TILEVIEW_covid19_enabled=false
TILEVIEW_services_geocoder_useNlu=true
TILEVIEW_userFeedback_enabled=true
TILEVIEW_burgerMenu_products=true
TILEVIEW_server_unsupportedBrowsers_redirect=true
TILEVIEW_survey_surveyApiUrl=https://api.qwant.com/v2/api/ux/surveys
  • The business env files (dev, prod) are available on Confluence, and are only useable by Qwant's employees.

Build the project

  • Open a terminal (on Windows 10, use WSL2):
> npm install 
> npm run build
  • Open a second terminal:
> npm run start

FAQ

How to make a "dev" build?

With code watcher:

> npm run watch

Without code watcher:

> webpack --config build/webpack.config.js --mode=development

More generally, you can see all the available build scripts in package.json

How to fix end-of-line errors on the whole project?

> npm run prettier:write

(It will also prettify/lint all the source code of the project)

Having trouble when building the project using Mac M1 (ARM architecture)

You can still install and build the project using Intel arch with Rosetta 2.
I recommend you using a copy of your Terminal app (iTerm for example) - you can find a tutorial here.