Skip to content

LukeSwenson06/waste_no_more-be

Repository files navigation

Info

Have you ever gone to your fridge excited to cook a meal and find all your food is expired? Has it really been a week since you got them? This application can help you.

About the Project

Waste No More is an application dedicated to help people reduce food waste at home by tracking food items, expiration dates, and help locate the nearest donation centers for food close to expiring. Resources are provided to educate users on food waste management, food storage and how to donate food. This project was created for the 2203 Backend Program Module 3 Consultancy Project.

Built With

RoR pgsql heroku

Gems

rspec shoulda capybara simplecov VCR webmock figaro spring faker factory bot faraday jsonapi-serializer

Set Up

  • Clone this repo
  • bundle install
  • rails s

Database Creation

  • `rails db:{create,migrate}``

Database Structure

Database

Testing Instructions

  • Clone this repo
  • in terminal (apple or integrated)
    • bundle install
    • bundle exec rspec

Deployment Instructions

End Points

Add item to fridge

get https://waste-no-more-fe.herokuapp.com/api/v1/items/create
{
  "data": {
        "id": "2511",
        "type": "item",
        "attributes" : {
          "name": "apple",
          "expiration": "2112-12-21"
        }
  }
}

Add item to fridge

get https://waste-no-more-fe.herokuapp.com/api/v1/items/delete
{
  "data": {
        "id": "2511",
        "type": "item",
        "attributes" : {
          "name": "apple",
          "expiration": "2012-12-21"
        }
  }
}

Show a User

get https://waste-no-more-fe.herokuapp.com/api/v1/users/show
{
  "data": {
      "id": "2112",
      "type": "user",
      "attributes" : {
        "name": "Geddy",
        "email": "[email protected]"
      }
    }
}

Create a User

get https://waste-no-more-fe.herokuapp.com/api/v1/users/create
{
  "data": {
      "id": "2112",
      "type": "user",
      "attributes" : {
        "name": "Geddy",
        "email": "[email protected]"
      }
    }
}

Get User's Items

get https://waste-no-more-be.herokuapp.com/api/v1/users/item

{:data=>
  [{:id=>"49",
    :type=>"item",
    :attributes=>{:id=>49, :name=>"honey dew", :expiration=>"2022-08-04", :days_til_expiration=>nil}},
   {:id=>"44",
    :type=>"item",
    :attributes=>{:id=>44, :name=>"milk", :expiration=>"2022-08-10", :days_til_expiration=>nil}}]}

Get User's Groceries

get https://waste-no-more-be.herokuapp.com/api/v1/groceries

{:data=>
  [{:id=>"18", :type=>"grocery", :attributes=>{:id=>18, :name=>"bananas"}},
   {:id=>"19", :type=>"grocery", :attributes=>{:id=>19, :name=>"cold brew"}}]}

Create Grocery

get https://waste-no-more-be.herokuapp.com/api/v1/groceries

{:data=>
  [{:id=>"18", :type=>"grocery", :attributes=>{:id=>18, :name=>"bananas"}},
   {:id=>"19", :type=>"grocery", :attributes=>{:id=>19, :name=>"cold brew"}}]}

Contributions

🔥@amsalmeron Github:https://github.com/amsalmeron LinkedIn: https://linkedin.com/in/antonio-salmeron

🚀@caden-jarrett Github: https://github.com/caden-jarrett LinkedIn: https://www.linkedin.com/in/caden-jarrett-0655051b6/

🏅@DrewProebstel Github: https://github.com/caden-jarrett LinkedIn: https://www.linkedin.com/in/drew-proebstel/

🎊@LukeSwenson06 Github: https://github.com/LukeSwenson06 Linkedin: https://www.linkedin.com/in/luke-swenson

✨@ross-ian28 Github:https://github.com/ross-ian28 Linkedin: https://www.linkedin.com/in/ross-ian28/

🎉@tjhaines-cap Github:https://github.com/tjhaines-cap LinkedIn: https://www.linkedin.com/in/thomas-haines-9b93451a0/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published