Giter Site home page Giter Site logo

fleker / git-recipes Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 2.0 499 KB

Recipe host site that uses Git as the hosting mechanism and allows for smarter recipe management

Home Page: http://dishout.recipes

HTML 1.96% JavaScript 68.62% CSS 0.56% Shell 0.64% TypeScript 15.11% EJS 13.11%
recipe recipe-json servings

git-recipes's Introduction

Recipes.tech

This is a service which allows users to share recipes, hosted through GitHub.

Using git for recipes makes it easy for individuals to modify their recipes while maintaining version history. Plus, it's easy for others to fork the recipe, make adjustments, and then file a pull request to update it.

Hosting

Cookbook

All recipes should be defined in a global manifest file called .recipes.json. This maps a given key to the relative filepath of your recipe JSON file.

The collections key allows one to browse a list of all recipes by visiting the /g/{username}/{reponame} URL.

{
    "recipes": {
        "potato-candy": "desserts/potatos/candy.json",
        "caramel-apple": "caramel-apple.json"
    },
    "collections": {
        "desserts": {
            "recipes": [{
                "key": "potato-candy",
                "label": "Potato Candy"
            }, {
                "key": "caramel-apple",
                "label": "Caramel Apple"
            }]
        }
    }
}

Then, the URL /g/{username}/{reponame}/potato-candy would look for a file in the GitHub repo called desserts/potatos/candy.json

Alternatively, each recipe can be hosted in individual repos. In that case, the URL /g/{username}/{reponame} would look for a file in the repo called .recipe.json

Recipe JSON

Each recipe exists as a JSON file which is placed in a GitHub repository. The specification is below.

{
    "author": "Nick Felker",
    "recipe": "Potato Candy",
    "spec": "v0.1.0",
    "tags": "potato, candy",
    "servings": 24,
    "prelude": {
        "description": "Potato candy is...",
        "images": [{
            "src": "http://example.com/potato1.png",
            "description": "Potato"
        }],
        "videos": [{
            "youtube": "youtubeid"
        }]
    },
    "steps": [{
        "description": "Cut the potato",
        "ingredients": [{
            "item": "Russet potato",
            "amount": 1,
            "unit": ""
        }],
        "equipment": [{
            "item": "Potato slicer"
        }],
        "prepTime": {
            "amount": 5,
            "unit": "minutes"
        },
        "cookTime": {
            "amount": 0,
            "unit": ""
        },
        "images": [{
            "src": "http://example.com/potato2.png",
            "description": "Sliced potato"
        }],
        "videos": [{
            "youtube": "youtubeid"
        }]
    }, {
        "description": "Mix in powdered sugar until mxied well",
        "ingredients": [{
            "item": "Powdered sugar",
            "min": 4,
            "max": 6,
            "unit": "cups"
        }],
        "equipment": [{
            "item": "Mixing bowl"
        }, {
            "item": "Wooden spoon"
        }],
        "prepTime": {
            "amount": 3,
            "unit": "minutes"
        },
        "cookTime": {
            "amount": 0,
            "unit": ""
        },
        "images": [{
            "src": "http://example.com/potato3.png",
            "description": "Mixed potato"
        }],
        "videos": [{
            "youtube": "youtubeid"
        }]
    }]
}
  • author - Display name for the recipe author
  • recipe - The name of the recipe
  • spec - The JSON specification version. This can help preserve backwards compatibility if it changes.
  • tags - Comma-separated tags that may aid for searches
  • servings - The number of servings the recipe will make
  • prelude - The information that may appear at the top of the recipe
    • description - A description of what the recipe may be, such as flavor or history
    • images - An array of photographs or images with a src and a description of that image
    • videos - An array of videos. Only YouTube is supported at the moment, with youtube and the YouTube ID
  • steps - The series of steps to make this recipe. Information from each step will be compiled at the top to present the list of ingredients, equipment, and other metadata.
    • description - A description of what the recipe will do
    • ingredients - An array of ingredients. Only populate this array if you are introducing a new ingredient
      • item - The name of the ingredient
      • amount - The exact amount of this ingredient
      • min/max - Alternatively, you can specify a range of a particular ingredient
      • units - The units of this ingredient
    • equipment - An array of equipment for a given task. This should be populated in every step if applicable
      • item - The name of the equipment
    • prepTime - The time it takes for this step
      • amount - The exact amount of time
      • units - The time unit
    • cookTime - The time it takes for cooking in a given step
      • amount - The exact amount of time
      • units - The time unit
    • images/videos - Like above, you can add images and videos in each step

Why

I tried using a few different recipe websites, but I had a few issues with using them:

  • The websites were cluttered with ads and was slow. I wanted a clean navigation and design.
  • There was a recipe that I followed mostly, but with one change. I wanted a way to literally fork the recipe and add a small patch.
  • The recipes often list what ingredients you need, but not which equipment. When reading a recipe ahead of time, I realized that I needed a baking pan.
  • Recipes often provided enough servings for a whole family. I wanted to be able to easily adjust measurements for my own needs.

The goal of this website is to remedy those issues.

Setup

Here's how you can set up the project for yourself

  • yarn
  • yarn build - Will build
  • yarn serve - Will build and serve locally

git-recipes's People

Contributors

fleker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

git-recipes's Issues

Support search

Log successful entries and use them to populate a search mechanism. As such, provide a way to opt-out (a private flag?)

Optional steps?

Make some steps optional, like adding milk to hot chocolate?

localStorage favorite

Favorite things, cookbooks / recipes, in a localStorage blob so the show up when loading the PWA.

Support sections

There may be a benefit to supporting sections of a recipe. For something like donuts, you may want to break up instructions into creating the dough, the glaze, and the powdered coating.

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.