Skip to content
API boilerplate project for Ruby On Rails 5
Branch: master
Clone or download
Latest commit 806435d Feb 27, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci add codeclimate Jan 14, 2019
.github Add Github recommended community standards Oct 23, 2017
app Update the versions of all linters Feb 26, 2019
bin Added delayed job Oct 27, 2016
config
db Install Active Storage Nov 2, 2018
lib Update the versions of all linters Feb 26, 2019
log First commit Oct 10, 2016
public First commit Oct 10, 2016
spec
tmp First commit Oct 10, 2016
.codeclimate.yml
.gitignore Install Active Storage Nov 2, 2018
.pryrc
.reek.yml Update the versions of all linters Feb 26, 2019
.rubocop.yml Update the versions of all linters Feb 26, 2019
.ruby-version
.slugignore Ignore test files for the heroku slug Mar 1, 2017
CHANGELOG.md
Gemfile Update the versions of all linters Feb 26, 2019
Gemfile.lock
LICENSE.md Fix api docs and add license Sep 15, 2017
Procfile Run migrations automatically in heroku Dec 4, 2017
README.md add codeclimate Jan 14, 2019
Rakefile First commit Oct 10, 2016
apiary.apib By default a user can only see/update it's data Jan 25, 2019
config.ru First commit Oct 10, 2016

README.md

Rails API Template

CircleCI Code Climate Test Coverage

Rails Api Base is a boilerplate project for JSON RESTful APIs. It follows the community best practices in terms of standards, security and maintainability, integrating a variety of testing and code quality tools. It's based on Rails 5 and Ruby 2.3.

Finally, it contains a plug an play Administration console (thanks to ActiveAdmin).

Features

This template comes with:

  • Schema
    • Users table
    • Admin users table
  • Endpoints
    • Sign up with user credentials
    • Sign in with user credentials
    • Sign out
    • Reset password
    • Get and update user profile
  • Administration panel for users
  • Rspec tests
  • Code quality tools
  • API documentation following https://apiblueprint.org/

How to use

  1. Clone this repo
  2. Install PostgreSQL in case you don't have it
  3. Create your database.yml and application.yml file
  4. bundle install
  5. Generate a secret key with rake secret and paste this value into the application.yml.
  6. rake db:create
  7. rake db:migrate
  8. rspec and make sure all tests pass
  9. rails s
  10. You can now try your REST services!

Gems

Optional configuration

  • Set your frontend URL in config/initializers/rack_cors.rb
  • Set your mail sender in config/initializers/devise.rb
  • Config your timezone accordingly in application.rb.

Api Docs

http://docs.railsapibase.apiary.io

Code quality

With rake code_analysis you can run the code analysis tool, you can omit rules with:

  • Rubocop Edit .rubocop.yml
  • Reek Edit config.reek
  • Rails Best Practices Edit config/rails_best_practices.yml
  • Brakeman Run brakeman -I to generate config/brakeman.ignore
  • Bullet You can add exceptions to a bullet initializer or in the controller

Configuring Code Climate

  1. After adding the project to CC, go to Repo Settings
  2. On the Test Coverage tab, copy the Test Reporter ID
  3. Replace the current value of CC_TEST_REPORTER_ID on the config.yml file (.circleci/config.yml) with the one you copied from CC

Credits

Rails Api Base is maintained by Rootstrap with the help of our contributors.

You can’t perform that action at this time.