GithubHelp home page GithubHelp logo

quantified-self's Introduction

Colleen Ward and Josh Thompson built a sweet calorie tracking application.

Front-end available live at

API documentation

This is the API endpoints for the backend of this quantified self application.

The backend is live on Heroku: https://quantified-self-backend.herokuapp.com/

View the repo: https://github.com/caward12/quantified-self

Foods

GET /foods

Returns array of all active food objects, sorted in descending order based on id

[
  {
    id: 19,
    name: "burger",
    calories: 367,
    created_at: "2017-07-12T23:09:14.295Z",
    active: true
  },
  {
    id: 18,
    name: "popcorn",
    calories: 50,
    created_at: "2017-07-12T23:06:53.148Z",
    active: true
  }
]

GET /foods/:id

Returns specific food object

  {
    id: 18,
    name: "popcorn",
    calories: 50,
    created_at: "2017-07-12T23:06:53.148Z",
    active: false
  }

POST /foods/

Requires name and calories in body

{
  name: food_name,
  calories: food_calories
}

If successful, returns created food object and 202

PUT /foods/:id

accepts name or calories in body, returns 202 if successful { name: food_name, calories: food_calories }

DELETE /foods/:id

Delete's specific food, if successful returns 200

Meals

GET /:meal

Returns foods associated with meal name. Responds to:

/breakfast
/lunch
/dinner
/snack

Returns list of food objects:

[
  {
    food_id: 6,
    food_name: "cheerios",
    food_calories: 190
  },
  {
    food_id: 1,
    food_name: "banana",
    food_calories: 55
  }
]

PUT /:meal

Requires existing food id in message body:

{
  id: 2
}

Adds food item to specified meal, returns 202 if successful.

DELETE /:meal

Requires existing food id in message body:

{
  id: 2
}

Removes food from specified meal. Returns 202 if successful.

quantified-self's People

Contributors

caward12 avatar josh-works avatar

Watchers

 avatar  avatar

Forkers

josh-works

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.