A JSON API in Rails using engines
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
components
config
db
.gitignore
.ruby-version
.travis.yml
Gemfile
Gemfile.lock
LICENSE
Procfile
README.md
Rakefile
build.sh
config.ru
deploy_app.sh

README.md

Json-Api

A simple set of JSON RESTful endpoints using the repository pattern and Rails engines.

About

This app lives at json-api.herokuapp.com and responds to requests at /api/movies.

There are two things which make this otherwise plain app interesting:

  1. Any interaction with ActiveRecord is hidden behind a repository interface. I have written about the rationale of doing this here.
  2. The app uses engines and has no app folder in the top level. For some context on why this is valuable, see the talk by Stephan Hagemann, Component-based Architectures in Ruby and Rails. If you prefer reading about the topic, there is also a book.

For an introduction to how this app's API was written, see the post here.

If you would like to practice using curl while interacting with the app, see the post here.

JavaScript Clients

See here for an AngularJS client.