Skip to content
Example Winding Tree hotel explorer
JavaScript CSS Shell Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
management chore: Takes ETH_NETWORK_PROVIDER from envvars Jul 1, 2019
src fix: Disables potential HTML injection via markdown interpretation Jun 30, 2019
test
webpack feat(#133): Replaces uglify with terser May 31, 2019
.babelrc feat(19-signed-booking): sign requests when configured May 30, 2019
.eslintignore feat: Initial setup, mainly copied over from crypto-booking Aug 29, 2018
.eslintrc chore(environment): update gitignore Sep 27, 2018
.gitignore chore(package, gitignore): updated wt-ui dep, edited gitignore Dec 3, 2018
.npmignore
.nvmrc feat(env): Relaxes minimal node version Oct 15, 2018
.travis.yml chore: Adds LISBON_ETH_NETWORK_PROVIDER Jul 1, 2019
Dockerfile fix: Docker build Jun 28, 2019
LICENSE Initial commit Aug 29, 2018
README.md fix: README for running from npm May 31, 2019
package-lock.json Merge branch 'develop' Jul 31, 2019
package.json 0.11.4 Jul 31, 2019
superstatic.json feat(env): Switches http-server for superstatic that properly handles… Nov 15, 2018
webpack.config.js feat: Initial setup, mainly copied over from crypto-booking Aug 29, 2018

README.md

Greenkeeper badge

Winding Tree hotel explorer

Example web application showcasing what the Winding Tree platform is capable of. This is not meant as a real life application.

Requirements

  • NodeJS >= 10

Running locally

To run this app locally, use npm start command. It will be connected to the playground environment and you can happily develop with HMR enabled. It will be available on http://localhost:3001.

Docker

You can also run this app from a docker container. Please note that there are two sets of environment variables. The NODE_ENV and GIT_REV have to be provided at build time.

The WT_READ_API and WT_SEARCH_API have to be provided for the container runtime.

$ docker build --build-arg NODE_ENV=production --build-arg GIT_REV=`git rev-parse --short HEAD` -t windingtree/wt-hotel-explorer .
$ docker run -p 8080:8080 -e WT_READ_API=https://playground-api.windingtree.com -e WT_SEARCH_API=https://playground-search-api.windingtree.com windingtree/wt-hotel-explorer

In a similar fashion, you can build and run the docker image in a production-like environment.

NPM

You can install and run this from NPM as well:

$ npm install -g @windingtree/wt-hotel-explorer superstatic
$ WT_READ_API=https://playground-api.windingtree.com WT_SEARCH_API=https://playground-search-api.windingtree.com wt-hotel-explorer

You can customize the behaviour of the explorer by setting environment variables upon deploy. These are:

- `WT_READ_API` - wt-read-api instance url
- `WT_SEARCH_API` - wt-search-api instance url
- `WT_SIGN_BOOKING_REQUESTS` - Sign outgoing booking and cancellation requests when set to `true` (an actual string 'true', a strict comparison is used in the app).
- `ETH_NETWORK_PROVIDER` - Address of an Ethereum node, for example `https://ropsten.infura.io/v3/my-project-id`

Experimental build for Swarm

If you run npm run build-for-swarm-playground, you will get a slightly different build that can be uploaded to and served from Swarm.

It uses a different react router (hash-based) to circumvent the limitations of running the app not from a root domain (such as https://example.com/) but from a relative path (such as https://swarm.example.com/bzz:/0xsupersecrethash).

You can’t perform that action at this time.