This simple application includes ruby/rails technology which we use at FlatStack for new REST API projects.
Application currently based on Rails 4 stable branch and Ruby 2.1
Status of the API could be checked at http://localhost:5000/docs
- Decent Exposure for DRY controllers
- Rollbar for exception notification
- Thin as rails web server
- Foreman for managing development stack with Procfile
- Letter Opener for preview mail in the browser instead of sending
- Mail Safe keep ActionMailer emails from escaping into the wild during development
- Bullet gem to kill N+1 queries and unused eager loading
- Rails Best Practices code metric tool
- Brakeman static analysis security vulnerability scanner
- Bundler Audit Patch-level verification for Gems
- Factory Girl for easier creation of test data
- RSpec for awesome, readable isolation testing
- Shoulda Matchers for frequently needed Rails and RSpec matchers
- Email Spec Collection of rspec matchers and cucumber steps for testing emails
- Rspec Api Documentation Generate pretty API docs for your Rails APIs
01_config.rb
- shortcut for getting application config withapp_config
mailer.rb
- setup default hosts for mailer from configurationrequires.rb
- automatically requires everything in lib/ & lib/extensions
bin/bootstrap
- setup required gems and migrate db if neededbin/quality
- runs rubocop, brakeman, rails_best_practices and bundle-audit for the appbin/ci
- should be used in the CI or locallybin/server
- to run server locally
Clone application as new project with original repository named "rails-base-api"
git clone git://github.com/fs/rails-base-api.git --origin rails-base-api [MY-NEW-PROJECT]
Create your new repo on GitHub and push master into it. Make sure master branch is tracking origin repo.
git remote add origin git@github.com:[MY-GITHUB-ACCOUNT]/[MY-NEW-PROJECT].git
git push -u origin master
Run bootstrap script
bin/bootstrap
Make sure all test are green
bin/ci
Run app
bin/server
Do not forget to update this file!
mv doc/README_TEMPLATE.md README.md
# update README.md
git commit -am "Update README.md"
Please check how to build API endpoints and test them properly in the examples branch