This is a boilerplate for developing RESTful APIs with Ruby on Rails.
To use the boilerplate, simply clone this repo:
$ git clone git://github.com/pragmarb/pragma-rails-starter.git my-project
$ cd my-project
You will also need to configure the application and the database:
$ cp config/database.example.yml config/database.yml
$ cp config/application.example.yml config/application.yml
Once you're done with the configuration, you can setup the database:
$ rake db:setup
Run the application with:
$ foreman s -f Procfile.development
You can keep the starter up to date even after you start development on the application by adding it as a separate repo:
$ git remote add upstream git://github.com/pragmarb/pragma-rails-starter.git
$ git fetch upstream
$ git merge upstream master
- Ruby 2.3
- PostgreSQL
- Rails 5
The following tools are included and configured in the boilerplate:
- Puma as the web server
- Foreman for process management
- Figaro for configuration management
- Rack::CORS for CORS
- Rack::Attack for rate-limiting
- Pragma for business logic
- Bugsnag for error tracking
- CircleCI for continuous integration
- Docker and Compose for containerization
RSpec is configured for testing. To run the tests:
$ bin/rspec
In the tests, you have access to the #last_response
and #parsed_response
methods which return,
respectively, the last response object and the parsed body of the response.
The application is already configured for deployment on Heroku, including a release command that runs DB migrations.
Provided that you have the Heroku CLI installed, deploying a new app should be as simple as:
$ heroku create
$ figaro heroku
$ git push heroku master
Bug reports and pull requests are welcome on GitHub at https://github.com/pragmarb/pragma-rails-starter.
This software is available as open source under the terms of the MIT License.