A simple set of JSON RESTful endpoints using the repository pattern and Rails engines.
This app lives at json-api.herokuapp.com and responds to requests at
There are two things which make this otherwise plain app interesting:
- Any interaction with ActiveRecord is hidden behind a repository interface. I have written about the rationale of doing this here.
- The app uses engines and has no
appfolder 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.
See here for an AngularJS client.