Zum Hauptinhalt springen

Setup

So wird die lokale Entwicklungsumgebung eingerichtet.

Voraussetzungen

  • git
  • npm - min. v9.2.0
  • node.js - min. v18.0.0
  • nvm (optional)

Installation (Beispiel Debian)

$ sudo apt-get install npm
$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Da Debian in der Regel veraltete Pakete verwendet, muss für eine neuere Version folgendes ausgeführt werden:

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
$ export NVM_DIR="$HOME/.nvm"
$ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
$ nvm install 18.19.0

Ggf. müssen Proxy-Einstellungen gesetzt werden: in der normalen shell UND in der Admin-shell (git-shell als Admin ausführen).

$ npm config set proxy <proxy-url:port>
$ npm config set https-proxy <proxy-url:port>
$ git config --global http.proxy <proxy-url:port>
$ git config --global https.proxy <proxy-url:port>

Git clone

$ git clone https://git.geobasis-bb.de/kartenviewer-api/kartenviewer-api.git

$ cd ./kartenviewer-api/
$ git checkout main
$ rm -rf ./addons

$ git clone https://git.geobasis-bb.de/kartenviewer-api/addons.git
$ npm i

Install npm libraries

$ npm i
$ bash ./install-addons.sh

Viewer lokal starten

$ npm start -- --host=0.0.0.0 --port=9001

Build erstellen

API

$ npm run buildapi

Standalone

$ npm run buildstandalone