This is a very simple example of a website that uses the Aviator front-end router, and ReactJS view system.
- NPM - gets all of the build tools
- grunt - compiles all vendored and local assets for use by the website
- bower - pulls down assets (Aviator, React, ...)
- bundler - pulls down Ruby plugins (gems)
- rack - Ruby webserver
- Ruby - Recommended install through rbenv and
rbenv install
(rbenv and ruby-build for rbenv) - Node - Recommended install through package manager (pacman, brew, apt-get, yum)
-
Installing grunt and bower
sudo npm install -g grunt-cli bower
-
Installing bundler
gem install bundler
-
Installing Ruby gems
bundle install
-
Installing node modules
npm install
-
Getting assets
bower install
-
Compiling assets
grunt
-
Enabling rackup (only needed if using rbenv once)
rbenv rehash
In this directory, run:
rackup
Now: visit http://localhost:9292/
If you want to rebuild the JS/JSX files, run grunt
again. To do this automatically while writing and saving files, run grunt watch
.
If you add new gems to your Gemfile, run bundle install
again to include them.
Adding routes is as simple as extending the list in config.ru
.