-
git clone https://github.com/9mmedia/charcutio-web.git
-
Use latest Ruby using ruby-build and rbenv. If you just did a fresh Ruby install run the following commands:
gem update --system gem update gem install bundler rake foreman rails mailcatcher --no-rdoc --no-ri
-
Create Heroku account, install Toolbelt and login using heroku CLI
-
Set a Heroku git remote. You can name it something else but examples in other sections will use
heroku
as the remote name.git remote add heroku [email protected]:charcutio-web.git
-
Install Homebrew
-
brew update
-
brew install postgresql
-
Follow any post installation instructions given by Homebrew
-
Move
/usr/local/bin
so our PostgreSQL install is used over the system install (OSX) and reload the current bash session since we updated the PATH variable.echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile source ~/.bash_profile
-
gem uninstall pg
since if previously installed, gem might continue to use the wrong PostgreSQL installation -
bundle install
-
createuser -d -r -S charcutio
-
createdb -O charcutio charcutio_development
-
createdb -O charcutio charcutio_test
-
bundle exec rake db:migrate
-
bundle exec rake db:test:prepare
-
foreman start
to start the server
-
(Optional) Run migrations and prepare test environment database
bundle exec rake db:migrate && bundle exec rake db:test:prepare
-
Start the server using
foreman start
-
bundle exec rspec
-
Client side tests use QUnit through qunit-rails gem. Go to http://localhost:5000/qunit to see and run the QUnit Test Runner.
Simple implementation to get started with data pushing.
Create a new box, returns box id.
POST /boxes {"api_key": "API_KEY", "name": "Box Name"}
Report data point
POST /boxes/:id/report {"api_key": "API_KEY", "type": "temp", "value": 55.6}
Get temperature/humidity set points
GET /boxes/:id/set_points {"api_key": "API_KEY"}
Tweet a photo.
POST /boxes/:id/photo {"api_key": "API_KEY", "image_file": multipart_file}