GithubHelp home page GithubHelp logo

jlowry42 / db-recipe-book Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bloominstituteoftechnology/webdb-iv-challenge

0.0 3.0 0.0 63 KB

Migrating and Seeding a Database

JavaScript 100.00%

db-recipe-book's Introduction

Recipe Book

Topics

  • database modeling.
  • migration scripts.
  • seeding.
  • knex.

Assignment

Design the data model for a recipe book application, then use Knex migrations and seeding functionality to build a SQLite3 database based on the model and seed it with test data.

The requirements for the system, as stated by the client are:

  • have a way to manage dishes. A dish is something the client wants to cook like pizza or tacos.
  • have a way to manage recipes. A dish can have different recipes for tacos, like tex-mex or granny's. A recipe belongs only to one dish.
  • have a way to manage ingredients.
  • a recipe could have more than one ingredient and the same ingredient can be used in multiple recipes. Examples are "cup of corn flour" or "gram of butter".
  • when saving the ingredients for a recipe capture the quantity required for that ingredient as a floating number.
  • have a way to save instructions for cooking a recipe.
  • have a way to pick a dish and a recipe and get a shopping list with all the ingredients, and quantity of each, needed to cook the dish.

In addition to the migrations and seeding scripts, write a data access file that exports an object with the following functions:

  • getDishes(): should return a list of all dishes in the database.
  • addDish(dish): should add the dish to the database and return the id of the new dish.
  • getDish(id): should return the dish with the provided id and include a list of the related recipes.
  • getRecipes(): should return a list of all recipes in the database including the dish they belong to.
  • addRecipe(recipe): should add a recipe to the database and return the id of the new recipe.

Organize and name your files anyway you see fit.

Stretch Problems

  • design and build a RESTful API that makes use of your data access file and publishes endpoints that a client application can use to manage all resources.
  • add a method called getRecipe(id) to your data access library that should return the recipe with the provided id. The recipe should include:
    • name of the dish.
    • name of the recipe.
    • the list of ingredients with the quantity.
  • follow the same pattern to add the CRUD operations for other entities in the system.
  • add units of measure support for the ingredients.
  • add a table of unit of measure convertions, so that we can record the quantity for an ingredient using a unit of measure and see the values for other units reading the recipe.
  • design and build a front end client for your API.
  • add a getShoppingList(recipeId) that returns a list of all the recipe's ingredients including the quantity of each.

db-recipe-book's People

Contributors

luishrd avatar jlowry42 avatar szincone avatar

Watchers

James Cloos avatar  avatar  avatar

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.