{"id":22144173,"url":"https://github.com/mikeheft/bread_shop","last_synced_at":"2025-03-24T12:14:22.968Z","repository":{"id":91386391,"uuid":"122110583","full_name":"mikeheft/bread_shop","owner":"mikeheft","description":"Rails API that takes in recipe information and calculates the baker's percentage to return a family for that recipe. With the family set, a user can see a basic procedure to make and bake that recipe for the family of bread. Also it will calculate new totals based on the desired amount of bread.","archived":false,"fork":false,"pushed_at":"2018-07-31T14:44:49.000Z","size":384,"stargazers_count":0,"open_issues_count":14,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-01-29T17:13:33.487Z","etag":null,"topics":["baking","bakingapp","bread","bread-baking"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikeheft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-02-19T19:32:51.000Z","updated_at":"2019-08-27T13:03:26.000Z","dependencies_parsed_at":"2024-04-19T13:09:29.880Z","dependency_job_id":null,"html_url":"https://github.com/mikeheft/bread_shop","commit_stats":null,"previous_names":["mikeheft/bread_shop"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeheft%2Fbread_shop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeheft%2Fbread_shop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeheft%2Fbread_shop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeheft%2Fbread_shop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikeheft","download_url":"https://codeload.github.com/mikeheft/bread_shop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245267559,"owners_count":20587459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["baking","bakingapp","bread","bread-baking"],"created_at":"2024-12-01T22:19:28.487Z","updated_at":"2025-03-24T12:14:22.943Z","avatar_url":"https://github.com/mikeheft.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bread Shop API [![Build Status](https://travis-ci.org/mikeyduece/bread_shop.svg?branch=master)](https://travis-ci.org/mikeyduece/bread_shop)\n\n[![Waffle.io - Columns and their card count](https://badge.waffle.io/mikeyduece/bread_shop.svg?columns=all)](https://waffle.io/mikeyduece/bread_shop)\n\n\n##### Versions\n\n\u003csup\u003eRuby 2.5.0\u003c/sup\u003e \u003csup\u003e/\u003c/sup\u003e \u003csup\u003eRails 5.1.5\u003c/sup\u003e\n\n---\n\n### Endpoints\nAll requests require token from client app to be sent in the params. If no token is present, the request will be denied.\n\nBase URL for all requests is `https://bread-shop-api.herokuapp.com/api/v1`\n\n`GET /users/:id/recipes?token=token` - Returns list of recipes that a user has created.\n\n```ruby\n[\n  {\n    :id=\u003e1,\n    :name=\u003e\"1Recipe\",\n    :tags=\u003e[],\n    :total_percent=\u003enil,\n    :ingredient_list=\u003e\n     { \n      :\"9Ingredient\"=\u003e{:amount=\u003e8.64, :bakers_percentage=\u003enil}, \n      :\"8Ingredient\"=\u003e{:amount=\u003e6.01, :bakers_percentage=\u003enil},\n      :\"7Ingredient\"=\u003e{:amount=\u003e3.38, :bakers_percentage=\u003enil} \n    },\n    :family=\u003e\"Sweet\",\n    :created_at=\u003e\"Created on 24 JUL '18 at 16:57\",\n    :user=\u003e{:id=\u003e1, :name=\u003e\"Jamis\", :email=\u003e\"giovanna@kleinmurray.info\", :uid=\u003e\"1uid\", :zipcode=\u003e\"53370-1675\"}\n  },\n  ...\n]\n```    \n\n`POST /users/:id/recipes?token=token` - Creates a new `Recipe` with associated `Ingredient` and `RecipeIngredient` records\n\nExample payload sent to endpoint:\n```ruby\n  {\n    {\n      name: 'baguette',\n      ingredients: [\n        { name: 'flour', amount: 1.00 },\n        { name: 'water', amount: 0.62 },\n        { name: 'yeast', amount: 0.02 },\n        { name: 'salt', amount: 0.02 }\n      ]\n    }\n```\n\nThe response from the the `POST` request contains the submitted information along with baker's percentage and `total_percentage`. As seen below with the `GET` for a single recipe.\n\n`GET /users/:id/recipes/:recipe_id?token=token` - Returns specific recipe.\nExample JSON response\n\n```ruby\n  {\n    :id=\u003e1,\n    :name=\u003e\"1Recipe\",\n    :tags=\u003e[\"awesome\", \"bread\"],\n    :total_percent=\u003e441.48,\n    :ingredient_list=\u003e\n     {\n       :\"51Ingredient\"=\u003e{:amount=\u003e1.37, :bakers_percentage=\u003e20.66},\n       :\"50Ingredient\"=\u003e{:amount=\u003e6.9, :bakers_percentage=\u003e104.07},\n       :\"49Ingredient\"=\u003e{:amount=\u003e2.36, :bakers_percentage=\u003e35.6},\n       :\"48Ingredient\"=\u003e{:amount=\u003e7.14, :bakers_percentage=\u003e107.69},\n       :\"47Ingredient\"=\u003e{:amount=\u003e0.81, :bakers_percentage=\u003e12.22},\n       :\"46Ingredient\"=\u003e{:amount=\u003e4.06, :bakers_percentage=\u003e61.24},\n       :flour=\u003e{:amount=\u003e6.63, :bakers_percentage=\u003e100.0} \n     },\n   :family=\u003e\"Rich\",\n   :created_at=\u003e\"Created on 24 JUL '18 at 16:54\"\n  }\n```\n\n`GET /families?family_name=:family_name\u0026token=token` Returns a list of all recipes that are associated with that family_name.\n\n```ruby\n{\n  :name=\u003e\"Soft\",\n  :recipes=\u003e\n  [\n    {\n      :id=\u003e1,\n      :name=\u003e\"1Recipe\",\n      :tags=\u003e[],\n      :total_percent=\u003enil,\n      :ingredient_list=\u003e\n       {\n         :\"9Ingredient\"=\u003e{:amount=\u003e3.94, :bakers_percentage=\u003enil},\n         :\"8Ingredient\"=\u003e{:amount=\u003e0.15, :bakers_percentage=\u003enil},\n         :\"7Ingredient\"=\u003e{:amount=\u003e4.1, :bakers_percentage=\u003enil}\n       },\n      :family=\u003e\"Soft\",\n      :created_at=\u003e\"Created on 24 JUL '18 at 17:00\"\n    },\n    ...\n  ]\n}\n```\n\n`GET /recipes/:recipe_id/new_totals` Given a request with a recipe and amounts, the request params would look like so.\n\n```Ruby\n  {\n    recipe: {\n      name: 'baguette',\n      ingredients: {\n        'flour' =\u003e { amount: 1.00, bakers_percentage: 100.0 },\n        'water' =\u003e { amount: 0.62, bakers_percentage: 62.0  },\n        'yeast' =\u003e { amount: 0.02, bakers_percentage: 2.0 },\n        'salt'  =\u003e { amount: 0.02, bakers_percentage: 2.0 }\n      },\n      total_percentage: 166.0,\n      new_dough_weight: 10.0\n    }\n  }\n```\n\nThe return from the previous request would be the recipe with the new amounts.\n```Ruby\n{\n  :id=\u003e\"5\",\n  :name=\u003e\"baguette1\",\n  :tags=\u003e[\"\"],\n  :total_percent=\u003e\"166.0\",\n  :ingredient_list=\u003e\n    {\n      :salt=\u003e{:amount=\u003e0.04, :bakers_percentage=\u003e\"2.0\"},\n      :yeast=\u003e{:amount=\u003e0.04, :bakers_percentage=\u003e\"2.0\"},\n      :water=\u003e{:amount=\u003e1.24, :bakers_percentage=\u003e\"62.0\"},\n      :flour=\u003e{:amount=\u003e2.0, :bakers_percentage=\u003e\"100.0\"}\n    },\n :family=\u003e\"Lean\",\n :created_at=\u003e\"Created on 24 JUL '18 at 17:02\"\n}\n```\n\n##### Likes\n`POST /users/:id/like/:recipe_id` \n\u003eAllows one user to like another users recipes\n\n`DELETE /users/:id/unlike/:recipe_id` \n\u003eAllows a user to unlike a recipe that they previously 'liked'.\n\n\n---\n### Activity Feed\n#### Follows\n\n`POST /users/:id/follow/:target_id` \n\n\u003eAllows one user to follow another. Once the follow record is persisted, the target user is sent a notification.\n\n`DELETE /users/:id/unfollow/:target_id`\n\n\u003eAllows a user to unfollow a user if already followed.\n\n#### Notification\n\n`GET /users/:id/feeds/notification`\n\n\u003eSends the notification to the user when followed. Also sends notification to the user who initiated the follow, of when the target user creates a new recipe or when someone likes one of their recipes.\n\n#### Flat Feed\n\n`GET /users/:id/feeds/flat`\n\n\u003eGets the feed for a given user. So far, showing when another user (that the current user follows) creates a new recipe\n\n#### Nutrition Label\nAnalysis of recipe information provided by [Edamam](https://www.edamam.com/)\n\n\n`GET /recipes/:recipe_id/label?token=token`\n\nJSON return is formatted as follows:\n\n```ruby\n{:uri=\u003e\"http://www.edamam.com/ontologies/edamam.owl#recipe_214022f9049e45f08add17c376e94174\",\n :yield=\u003e\"6.0\",\n :calories=\u003e\"1134\",\n :totalWeight=\u003e\"366.9477944061093\",\n :dietLabels=\u003e\"[\\\"LOW_FAT\\\"]\",\n :healthLabels=\u003e\"[\\\"SUGAR_CONSCIOUS\\\", \\\"VEGAN\\\", \\\"VEGETARIAN\\\", \\\"PEANUT_FREE\\\", \\\"TREE_NUT_FREE\\\", \\\"ALCOHOL_FREE\\\"]\",\n :cautions=\u003e\"[]\",\n :totalNutrients=\u003e\n  \"{:ENERC_KCAL=\u003e{:label=\u003e\\\"Energy\\\", :quantity=\u003e1134.6358003197763, :unit=\u003e\\\"kcal\\\"}, :FAT=\u003e{:label=\u003e\\\"Fat\\\", :quantity=\u003e7.236244240028524, :unit=\u003e\\\"g\\\"}, :FASAT=\u003e{:label=\u003e\\\"Saturated\\\", :quantity=\u003e1.0187089435831413, :unit=\u003e\\\"g\\\"}, :FAMS=\u003e{:label=\u003e\\\"Monounsaturated\\\", :quantity=\u003e2.89822568212125, :unit=\u003e\\\"g\\\"}, :FAPU=\u003e{:label=\u003e\\\"Polyunsaturated\\\", :quantity=\u003e1.0689896390453246, :unit=\u003e\\\"g\\\"}, :CHOCDF=\u003e{:label=\u003e\\\"Carbs\\\", :quantity=\u003e221.158655373815, :unit=\u003e\\\"g\\\"}, :FIBTG=\u003e{:label=\u003e\\\"Fiber\\\", :quantity=\u003e23.620539579684102, :unit=\u003e\\\"g\\\"}, :SUGAR=\u003e{:label=\u003e\\\"Sugars\\\", :quantity=\u003e0.6919551575150892, :unit=\u003e\\\"g\\\"}, :PROCNT=\u003e{:label=\u003e\\\"Protein\\\", :quantity=\u003e51.581050685490524, :unit=\u003e\\\"g\\\"}, :NA=\u003e{:label=\u003e\\\"Sodium\\\", :quantity=\u003e848.4708254170117, :unit=\u003e\\\"mg\\\"}, :CA=\u003e{:label=\u003e\\\"Calcium\\\", :quantity=\u003e58.96385049716603, :unit=\u003e\\\"mg\\\"}, :MG=\u003e{:label=\u003e\\\"Magnesium\\\", :quantity=\u003e90.39350476839596, :unit=\u003e\\\"mg\\\"}, :K=\u003e{:label=\u003e\\\"Potassium\\\", :quantity=\u003e867.3025375480865, :unit=\u003e\\\"mg\\\"}, :FE=\u003e{:label=\u003e\\\"Iron\\\", :quantity=\u003e4.352621896354764, :unit=\u003e\\\"mg\\\"}, :ZN=\u003e{:label=\u003e\\\"Zinc\\\", :quantity=\u003e6.73028187609825, :unit=\u003e\\\"mg\\\"}, :P=\u003e{:label=\u003e\\\"Phosphorus\\\", :quantity=\u003e672.2664257899635, :unit=\u003e\\\"mg\\\"}, :VITC=\u003e{:label=\u003e\\\"Vitamin C\\\", :quantity=\u003e0.1862563717977682, :unit=\u003e\\\"mg\\\"}, :THIA=\u003e{:label=\u003e\\\"Thiamin (B1)\\\", :quantity=\u003e7.13072737908717, :unit=\u003e\\\"mg\\\"}, :RIBF=\u003e{:label=\u003e\\\"Riboflavin (B2)\\\", :quantity=\u003e2.5859301658243297, :unit=\u003e\\\"mg\\\"}, :NIA=\u003e{:label=\u003e\\\"Niacin (B3)\\\", :quantity=\u003e28.161849920507834, :unit=\u003e\\\"mg\\\"}, :VITB6A=\u003e{:label=\u003e\\\"Vitamin B6\\\", :quantity=\u003e1.0440449216950036, :unit=\u003e\\\"mg\\\"}, :FOLDFE=\u003e{:label=\u003e\\\"Folate equivalent (total)\\\", :quantity=\u003e1519.4324188944154, :unit=\u003e\\\"µg\\\"}, :FOLFD=\u003e{:label=\u003e\\\"Folate (food)\\\", :quantity=\u003e1519.4324188944154, :unit=\u003e\\\"µg\\\"}, :VITB12=\u003e{:label=\u003e\\\"Vitamin B12\\\", :quantity=\u003e0.04345982008614591, :unit=\u003e\\\"µg\\\"}, :TOCPHA=\u003e{:label=\u003e\\\"Vitamin E\\\", :quantity=\u003e0.1537678127811309, :unit=\u003e\\\"mg\\\"}, :VITK1=\u003e{:label=\u003e\\\"Vitamin K\\\", :quantity=\u003e1.0171808929693453, :unit=\u003e\\\"µg\\\"}}\",\n :totalDaily=\u003e\n  \"{:ENERC_KCAL=\u003e{:label=\u003e\\\"Energy\\\", :quantity=\u003e56.731790015988814, :unit=\u003e\\\"%\\\"}, :FAT=\u003e{:label=\u003e\\\"Fat\\\", :quantity=\u003e11.13268344619773, :unit=\u003e\\\"%\\\"}, :FASAT=\u003e{:label=\u003e\\\"Saturated\\\", :quantity=\u003e5.093544717915707, :unit=\u003e\\\"%\\\"}, :CHOCDF=\u003e{:label=\u003e\\\"Carbs\\\", :quantity=\u003e73.71955179127167, :unit=\u003e\\\"%\\\"}, :FIBTG=\u003e{:label=\u003e\\\"Fiber\\\", :quantity=\u003e94.4821583187364, :unit=\u003e\\\"%\\\"}, :PROCNT=\u003e{:label=\u003e\\\"Protein\\\", :quantity=\u003e103.16210137098105, :unit=\u003e\\\"%\\\"}, :NA=\u003e{:label=\u003e\\\"Sodium\\\", :quantity=\u003e35.352951059042155, :unit=\u003e\\\"%\\\"}, :CA=\u003e{:label=\u003e\\\"Calcium\\\", :quantity=\u003e5.896385049716603, :unit=\u003e\\\"%\\\"}, :MG=\u003e{:label=\u003e\\\"Magnesium\\\", :quantity=\u003e22.59837619209899, :unit=\u003e\\\"%\\\"}, :K=\u003e{:label=\u003e\\\"Potassium\\\", :quantity=\u003e24.7800725013739, :unit=\u003e\\\"%\\\"}, :FE=\u003e{:label=\u003e\\\"Iron\\\", :quantity=\u003e24.181232757526466, :unit=\u003e\\\"%\\\"}, :ZN=\u003e{:label=\u003e\\\"Zinc\\\", :quantity=\u003e44.868545840654996, :unit=\u003e\\\"%\\\"}, :P=\u003e{:label=\u003e\\\"Phosphorus\\\", :quantity=\u003e96.03806082713764, :unit=\u003e\\\"%\\\"}, :VITC=\u003e{:label=\u003e\\\"Vitamin C\\\", :quantity=\u003e0.3104272863296137, :unit=\u003e\\\"%\\\"}, :THIA=\u003e{:label=\u003e\\\"Thiamin (B1)\\\", :quantity=\u003e475.381825272478, :unit=\u003e\\\"%\\\"}, :RIBF=\u003e{:label=\u003e\\\"Riboflavin (B2)\\\", :quantity=\u003e152.11353916613703, :unit=\u003e\\\"%\\\"}, :NIA=\u003e{:label=\u003e\\\"Niacin (B3)\\\", :quantity=\u003e140.80924960253918, :unit=\u003e\\\"%\\\"}, :VITB6A=\u003e{:label=\u003e\\\"Vitamin B6\\\", :quantity=\u003e52.20224608475018, :unit=\u003e\\\"%\\\"}, :FOLDFE=\u003e{:label=\u003e\\\"Folate equivalent (total)\\\", :quantity=\u003e379.85810472360384, :unit=\u003e\\\"%\\\"}, :VITB12=\u003e{:label=\u003e\\\"Vitamin B12\\\", :quantity=\u003e0.7243303347690985, :unit=\u003e\\\"%\\\"}, :TOCPHA=\u003e{:label=\u003e\\\"Vitamin E\\\", :quantity=\u003e0.7688390639056546, :unit=\u003e\\\"%\\\"}, :VITK1=\u003e{:label=\u003e\\\"Vitamin K\\\", :quantity=\u003e1.2714761162116817, :unit=\u003e\\\"%\\\"}}\"}\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeheft%2Fbread_shop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikeheft%2Fbread_shop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeheft%2Fbread_shop/lists"}