All Projects → Hawatel → Rails5 Api Starter

Hawatel / Rails5 Api Starter

RESTful API Starter Kit based on Rails 5

Programming Languages

ruby
36898 projects - #4 most used programming language

Labels

Projects that are alternatives of or similar to Rails5 Api Starter

Ordinalize full
Turns a number into an ordinal string such as first, second, third or 1st, 2nd, 3rd.
Stars: ✭ 6 (-75%)
Mutual labels:  rails
Administrate Field Ckeditor
A plugin for adding CKEditor support to Administrate
Stars: ✭ 17 (-29.17%)
Mutual labels:  rails
Foundation Datetimepicker Rails
foundation-datetimepicker-rails
Stars: ✭ 22 (-8.33%)
Mutual labels:  rails
Procourse Memberships
Allow users to purchase access to a user group on Discourse.
Stars: ✭ 16 (-33.33%)
Mutual labels:  rails
Decidim
The participatory democracy framework. A generator and multiple gems made with Ruby on Rails
Stars: ✭ 894 (+3625%)
Mutual labels:  rails
Api schema
DSL for describing APIs and generate swagger json
Stars: ✭ 18 (-25%)
Mutual labels:  rails
Activerecordextended
Adds additional postgres functionality to an ActiveRecord / Rails application
Stars: ✭ 830 (+3358.33%)
Mutual labels:  rails
Milog
Milog 是一基于 Ruby on Rails 的个人博客网站
Stars: ✭ 24 (+0%)
Mutual labels:  rails
Leaky Gems
A list of Ruby gems that have known memory leaks (and issues)
Stars: ✭ 895 (+3629.17%)
Mutual labels:  rails
Rails Api And Angularjs
Integration between rails and angularjs which includes rspec tests.
Stars: ✭ 22 (-8.33%)
Mutual labels:  rails
Capybara error intel
🐛 Ruby gem for heuristic error messages in Capybara based Page Objects
Stars: ✭ 16 (-33.33%)
Mutual labels:  rails
Denite Rails
denite-rails is a Denite.nvim source for Rails.
Stars: ✭ 17 (-29.17%)
Mutual labels:  rails
Libraries.io
📚 The Open Source Discovery Service
Stars: ✭ 903 (+3662.5%)
Mutual labels:  rails
Bh
Bootstrap Helpers for Ruby
Stars: ✭ 834 (+3375%)
Mutual labels:  rails
Partially useful
📑 👀 Helps identifying partials in verbose HTML source code.
Stars: ✭ 23 (-4.17%)
Mutual labels:  rails
Colourmatch
Search by Colour. Find photos with matching palettes.
Stars: ✭ 6 (-75%)
Mutual labels:  rails
Rails5 application template
Rails Application Template
Stars: ✭ 17 (-29.17%)
Mutual labels:  rails
Best Practices Badge
🏆Core Infrastructure Initiative Best Practices Badge
Stars: ✭ 928 (+3766.67%)
Mutual labels:  rails
Datagrid
Gem to create tables grids with sortable columns and filters
Stars: ✭ 921 (+3737.5%)
Mutual labels:  rails
Redis Rails
Redis stores for Ruby on Rails
Stars: ✭ 904 (+3666.67%)
Mutual labels:  rails

Rails 5 API starter

Rails 5 API starter is a boilerplate which helps you build fast, secure and efficient API for applications. Template based on automatically generated structure of directory and settings which are default delivered by --api switch. Additional to settings are added and initially configure useful Gems, which are often used in Rails stack application.

Features

Installation process

Requirements

Boilerplate based on Docker container. To start using them, first, we have to make sure that Docker Engine and Docker compose tool are installed.

  • Compose 1.6.0+
  • Docker Engine 1.10.0+
Build
$ git [email protected]:Hawatel/rails5-api-starter.git
$ docker-compose build
$ docker-compose run web bundle
$ docker-compose run web rails db:create
$ docker-compose run web rails db:migrate

Getting Started

To start the server you only need to run the following magic command:

$ docker-compose up

Rename project

It is only necessary from the perspective of the framework to change the application name in config/application.rb file.

...
module HawatelApi5Starterkit                      # CHANGE HERE                      
  class Application < Rails::Application
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    # Only loads a smaller set of middleware suitable for API only apps.
    # Middleware like session, flash, cookies can be added back manually.
    # Skip views, helpers and assets when generating a new resource.
    config.api_only = true

    # Use Rack Attack
    config.middleware.use Rack::Attack
  end
end

Update Gemset

To avoid install gems from scratch in each time when Gemfile will be updated, boilerplate has implemented persistent, cross-container dedicated volume for gems. Now in case when new entry to Gemfile is added, just run below command to update state:

$ docker-compose run web bundle

Debugging

Rails in Chrome

RailsPanel is a Chrome extension for Rails development that will end your tailing of development.log. Have all information about your Rails app requests right there in the Developer Tools panel. To use this you will need to install Chrome extension from this link .

RSpec

Running your test suite is done quite easily. You have to just set RAILS_ENV to test and execute rspec command the same way you would run your tests locally:

$ docker-compose run -e "RAILS_ENV=test" rspec

In case when you need initialize or migrate database in test env call rails db:create or db:migrate:

$ docker-compose run -e "RAILS_ENV=test" web rails db:create
$ docker-compose run -e "RAILS_ENV=test" web rails db:migrate

API Documentation based on rspec-api-documentation

$ docker-compose run -e "RAILS_ENV=test" web rake docs:generate

License

The Starter Kit is available as open source under the terms of the MIT License.

Useful links

Design API

TODO

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].