ludovicdeluna / ddd-json-api

A JSON API in Rails using engines

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

A JSON API in Rails using engines

License:MIT License


Languages

Language:Ruby 97.2%Language:Shell 2.8%