Goal: to be an easy-to-use tool to help users figure out what to eat. Users input their preferences (and rate recipes as they go along) and then are shown, based on time- and preference-backed criteria, a short list of recipes to choose from.
For requirements, see the requirements documents.
For standups, see the standup records. (NB: the most recent standups are located on the development branch.)
This application mounts side-by-side
- A Sinatra app that serves an Angular app at the root path, as well as the assets necessary for that app. It also depends on the Grape-backed API offered via the Rails app (see below). (client)
- A Rails app (server), that includes
- The database-backed models necessary for the front- and back-facing site to function.
- A simple admin interface for editing recipes, etc.
- A Grape API
- Follow the setup instructions in the client README.
- Follow the setup instructions in the server README.
Note: Client assets need to be compiled via Gulp in some fashion before running the application. (All compiled assets are excluded from git.) There are three ways to handle this.
- The simplest is to use
$ ./serve.sh
to run the app. This simple shell script runs the gulp precompilation and starts the server. - Alternatively, you can manually
$ cd client
and compile the assets. After the assets have been compiled, you can simply run$ bundle exec rackup
.
$ gulp
will download prerequisite libraries and compile the assets.$ gulp watch
will watch for changes in dependencies or libraries and recompile asset files as needed.
- Large swathes of the authentication system are adaptations of or strict copying from the DeviseTokenAuth gem, revised to work without Devise.
Setup an Amazon ec2 instance. Remember, while setting it up, to open up port 80 to HTTP.
$ sudo yum install git
$ gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
(to get the rvm key)$ curl -L get.rvm.io | bash -s stable
- Run
$ source /home/ec2-user/.rvm/scripts/rvm
- Finally, run
$ export rvmsudo_secure_path=1
Next, install the prerequisites for getting and setting up node.js:
$ sudo yum install gcc-c++ make openssl-devel libcurl-devel
$ git clone git://github.com/joyent/node.git
$ cd node
$ git checkout v0.10.32
$ ./configure
$ make
. This will take about 30 min.$ sudo make install
$ echo 'export PATH=$PATH:/usr/local/bin' >> $HOME/.bashrc
Now enter the sudo terminal ($ sudo su
), open /etc/sudoers
, and add /usr/local/bin
to the end of the default secure_path
. :wq! and exit su.
To install npm:
$ git clone https://github.com/isaacs/npm.git
$ cd npm
$ sudo make install
To setup the Ruby environment further:
- Clone the repo:
$ git clone https://github.com/posgarou/whatsfordinner.git
- Go into
~/whatsfordinner
. RVM will prompt the installation of the correct Ruby version. Follow the command it gives. (Remember to$ cd .
afterwards.) $ gem install bundler
To setup the frontend:
$ cd client
$ npm install
$ sudo npm install -g gulp-cli karma-cli
Next, you need to setup Passenger and nginx. Passenger should be included via the Gemfile.
In the terminal run: $ rvmsudo passenger-install-nginx-module
To finish this installation, you need to set up a swap file.
$ sudo dd if=/dev/zero of=/swap bs=1M count=1024
$ sudo mkswap /swap
$ sudo swapon /swap
To run nginx, run $ /opt/nginx/sbin/nginx
.