Skip to content

Instantly share code, notes, and snippets.

@onggunhao
Last active November 16, 2017 14:00
Show Gist options
  • Save onggunhao/1f6571163b4678ca56e17dc98a623c65 to your computer and use it in GitHub Desktop.
Save onggunhao/1f6571163b4678ca56e17dc98a623c65 to your computer and use it in GitHub Desktop.

Deploying React VR

Overall Process

  1. npm run bundle on the ReactVR project. It creates a new folder in vr/build. The exported files should be self-sufficient when uploaded to a web server.

  2. Copy static_assets folder into the vr/build directory. (Heroku errors on this, which is why it needs the static_asset filenames in the index.html file). We may be able to resolve this by using a remote CDN to host the static_assets, and passing in the assetRoot argument to ReactVR.init. See the ReactVR deployment instructions here.

Deploying to AWS S3

TODO: Write instructions or screencast here. This is a lot easier than Heroku.

Deploying to Github Pages

TODO: Write instructions or screencast here. This is a lot easier than Heroku.

Deploying to Heroku

  1. Evans Wang's article on Deploying ReactVR to Heroku in minutes
  2. Kany's gist on deploying ReactVR to Heroku

Our problems with the Heroku Deploy process

  1. The "deploy to Heroku" process is tedious, and requires a lot of manual work.

  2. An example of tedious work is having to copy all the names of the static_assets one by one into index.html.

  3. The Heroku deploy process relies on "tricking" Heroku into believe the ReactVR app is a PHP app

  4. Heroku forces HTTPS, which causes our site to break (coincap's API is HTTP-only). This could be solved by making Heroku default to a HTTP connection.

Possible Solutions

  1. Spend 2 days writing up an automatic build script (e.g. npm run bundle:heroku) that will automate the heroku deploy process, that we can subsequently open source?

  2. Spend 1 day figuring out a deploy process to Amazon AWS (normal server) or Amazon S3 that is more in line with Facebook's deployment documentation.

  3. This should be taken together with implementing other best practices on Bitcoin-VR, such as an automated testing framework (Continuous Integration), and automated deploy process.

Deploying to Amazon AWS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment