naveda89 / showtime

REST API in Ruby of a Multimedia store

Home Page:http://onshowtime.herokuapp.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

showtime (live demo)

REST API in Ruby of a Multimedia store

A live demo is available at onshowtime.herokuapp.com.

Usage

git clone git@github.com:naveda89/showtime.git
cd showtime
bundle install
rake db:reset
foreman start

Testing

Run rspec on terminal.

Source available at spec directory.

Resources endpoints

All results are paginated

Example of results from /api/v1/contents

{
  contents: [
    {
      type: "movies",
      slug: "peyton-wyman",
      title: "Peyton Wyman",
      plot: "Aliquam similique id ut sit ipsa pariatur sed. Aspernatur id inventore dolorem veniam quod sunt. Quia dolor error repellat omnis architecto. Eligendi dolorum nesciunt velit aut nihil quo. Maxime asperiores ex sint fugit impedit corporis.",
      content_purchase_options: [
        {
          id: 1,
          price: "8.03",
          quality: "hd"
        },
        {
          id: 2,
          price: "4.13",
          quality: "sd"
        }
      ]
    },
    ...
  ]
}

Movies

  • GET /api/v1/movies
  • GET /api/v1/movies/:id

Seasons / Episodes

  • GET /api/v1/seasons
  • GET /api/v1/seasons/:id
  • GET /api/v1/seasons/:season_id/episodes/:id

Purchases

user_id parameter required!

  • GET /api/v1/purchases
  • GET /api/v1/purchases/:id
  • POST /api/v1/content_purchase_options/:content_purchase_option_id/purchase - Create a purchase

Pagination

In route pagination:

Or query string pagination:

Caching

  • Stored into a redis database.
  • Fragment caching of serializers.
  • Set to 3 hours on almost all resources.

About

REST API in Ruby of a Multimedia store

http://onshowtime.herokuapp.com


Languages

Language:Ruby 84.0%Language:HTML 13.2%Language:CSS 2.0%Language:JavaScript 0.7%