GithubHelp home page GithubHelp logo

hyper-recipes's Introduction

Introduction

This is the backend for the Hyper Recipes app. To be able to use it, you will need an access token that your contact inside Hyper will provide you with when you begin your quest. This is helpful so other applicants don't modify your recipes in any way.

The base HTTP endpoints is: http://hyper-recipes.herokuapp.com

Retrieve recipes

GET: /recipes

Sample:

[
  {
    "id": 437,
    "name": "Strawberries and Cream Cake",
    "description": "Makes an elegant presentation without too much fuss.",
    "instructions": "eee",
    "favorite": false,
    "difficulty": 3,
    "created_at": "2014-09-29T10:43:00.072Z",
    "updated_at": "2014-11-26T11:53:58.451Z",
    "photo": {
      "url": "https://hyper-recipes.s3.amazonaws.com/uploads/recipe/photo/437/Strawberries_and_Cream_Cake.jpg",
      "thumbnail_url": "https://hyper-recipes.s3.amazonaws.com/uploads/recipe/photo/437/thumbnail_Strawberries_and_Cream_Cake.jpg"
    }
  }
]

In Curl it would be something like that:

curl -H 'Authorization: Token token="replace-with-token"' http://hyper-recipes.herokuapp.com/recipes

Create recipes

POST: /recipes

  • name:string (obligatory field)
  • difficulty:integer (obligatory field) [Valid values: 1, 2 and 3]
  • description:text
  • instructions:text
  • favorite:boolean
  • recipe[photo]:image == Multipart form request

Sample:

{
  "recipe": {
    "name": "New name",
    "difficulty": 1
  }
}

In Curl it would be something like that:

curl -H 'Authorization: Token token="2e3e72bbbcfd13eb27f4"' -d "recipe[name]=Meatballs" -d "recipe[difficulty]=1" http://hyper-recipes.herokuapp.com/recipes

Update recipes

PUT or PATCH: /recipes/:id

  • name:string (obligatory field)
  • difficulty:integer (obligatory field) [Valid values: 1, 2 and 3]
  • description:text
  • instructions:text
  • favorite:boolean
  • recipe[photo]:image == Multipart form request

Sample:

{
  "recipe": {
    "name": "New name",
    "difficulty": 1
  }
}

In Curl it would be something like that:

curl -H 'Authorization: Token token="0b71145b7474d575632b"' -d "recipe[name]=Meatballzz" -d "recipe[difficulty]=2" -X PUT http://hyper-recipes.herokuapp.com/recipes/22

Delete recipes

DELETE: /recipes/:id In Curl it would be something like that:

curl -H 'Authorization: Token token="0b71145b7474d575632b"' -X DELETE http://hyper-recipes.herokuapp.com/recipes/22

hyper-recipes's People

Contributors

3lvis avatar ealmdahl avatar jgorset avatar karimmtarek avatar nselvis avatar t0ggah avatar timkurvers avatar zenangst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hyper-recipes's Issues

Simplify thumbnail JSON structure

Should something like this be better?

photo: {
  "url": "https://hyper-recipes.s3.amazonaws.com/uploads/recipe/photo/11/PeachCobbler.jpg",
  "thumbnail_url": "https://hyper-recipes.s3.amazonaws.com/uploads/recipe/photo/11/thumbnail_PeachCobbler.jpg"
}

Current is:

photo: {
  "url": "https://hyper-recipes.s3.amazonaws.com/uploads/recipe/photo/11/PeachCobbler.jpg",
  "thumbnail": {
    "url": "https://hyper-recipes.s3.amazonaws.com/uploads/recipe/photo/11/thumbnail_PeachCobbler.jpg"
  }
}

Should instructions be an array instead?

Or maybe have an array with ingredients?
"ingredients": [ "4 apples", "3 diamonds", "a pinch of thyme"]
or
"ingredients": [{"name": "apples", "amount" : "4"}, {"name" : "diamonds", "amount" : "3"}, {"name" : "thyme", "amount" : "a pinch of"}]

Have a field for time

We should have a field for how much time each recipe would take, in minutes. Like
time: 45

Login Endpoint

Hi,
There is a API for user registration but I don't see any end point for user login. :)
Thanks :)

Isolate the data set

A lot of applicants use this API in their applications, which means that things could randomly change. One applicant might delete all of the recipes, for example, and somewhere else in the world another might wonder why his application suddenly "stopped working".

It would be pretty neat if applicants could work on their own isolated data set somehow. We might accomplish that with a prefix to the path (like hyper-recipes.herokuapp.com/jgorset/recipes), or perhaps a header of some sort (like X-Namespace: jgorset) โ€” or maybe something else entirely!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.