Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • feature/docker
  • feature/presentation
  • dev
4 results

shakemapi

  • Clone with SSH
  • Clone with HTTPS
  • user avatar
    Marius Kriegerowski authored
    722cb7c9
    History

    eGSIM Shakemap Service

    The eGSIM shakemap is comprised of a backend service (api.py) and a front end response site (front-end).

    Requirements

        apt install gmt python3-dev postgresql
    
        pip3 install -r requirements.txt

    vs30 model available at USGS. Export an environment variable VS30PATH pointing to that file. Shortcut: wget https://earthquake.usgs.gov/static/lfs/data/global_vs30_grd.zip

    Furthermore, npm is required for the front-end, as well as the vue command line client. Install the latter with

    npm install -g @vue/cli@latest

    Installation

    The backend build relies on pipenv. To install the frontend a version of Node.js and npm (Node package manager) is required. I recommend serving the final build (front-end/shakemap/dist) through nginx webserver. For further information spawning the development server as well as building the site go to the Readme.md inside front-end.

    Docker

    Alternatively, you can run the shakemap service in a docker container:

    docker build . -t shakemapi:latest
    docker-compose up

    Note, that the front-end is not yet integrated in the docker-compose.yml. This will follow soon.

    Start services

    Spawning the webserver at port 8082:

    python3 api.py

    Starting the front end:

    cd front-end/shakemap
    npm install    # This needs to be done just once or if new dependencies were added
    npm run serve

    Starting the API documentation:

    cd front-end/api_documentation
    git clone https://github.com/swagger-api/swagger-node
    npm start

    Go to open http://localhost:8081/docs

    API

    Either post request QuakeML formatted strings or use get requests on endpoint /shakemap.