Giter Site home page Giter Site logo

sequelizedburger's Introduction

Week 15 Assignment - Burger 2: The Sequel

Overview

In this assignment, you're going to Sequelize the Burger app you made last week. We've split this exercise into three different tiers, all with different tasks and expectations. Finish whichever tier will provide you with the most reasonable challenge.

Remember

  • You will be fully capable of doing this homework by the end of Saturday's class.

Before you Begin

  1. Create a new folder called sequelizedBurger

  2. Copy the contents of your completed assignment from last week.

    • Remove the older git connection with rm -R .git.
    • Then connect this folder with a new github repo.
  3. Run sequelize init to create the neccesary sequel files.

  4. Note: If for any reason you don't have a finished assignment for last week, no problem. Message the instructor, who will provide you will a skeleton file to work of for this week.

Instructions

Put in your best efforts to complete one of these three challenge tiers:

Tier 1: Sequelized! (Basic to Moderate)

  • Remove all references to your vanilla MySQL queries and replace them with Sequelize queries.

  • That means:

    • Replacing your MySQL Burger model with a Sequelized equivalent.

      • Don't forget to edit the model and initial migration file to make the burger's devoured field carry a default value of false -- otherwise you might encounter bugs.

        • There's no option to include that default in the command line, so you'll need to open up Sublime to make this change.
      • Don't forget to sync the models!

      • Edit your new config.json file to include your database configurations. Place your JawsDB details in the production property of your json file; the details of your local database go in the developer property.

      • Remove your old ORM file, as well as any references to it in burgers_controller.js. Replace those references with Sequelize's ORM methods.

  • When you finish, your site should function just like your last one: 1-Sequelized

Tier 2: Customer Associations (Challenge)

  • Add in a Customer association to the project. This will involve creating at least one new Customer model and connecting it with your Burger model.

  • What kind of association you would like to use is up to you. Does a Customer have one Burger? Many Burgers?

  • For example, you could make a site that logs the name of which Customer ate which Burger, where each Customer only gets one Burger. If you can't think of another type of association, try this one!

    3-Associated

  • If you do go select this tier, you must edit the handlebars files and CSS stylesheets to implement some sort of additional feature to the site. We don't want you to just connect two models and submit your project. Make your site do something relevant to this association.

Bonus! (Challenge)

  • Add validations to your models where:

    • A burger's name cannot be null
    • A burger's devoured status is false by default
    • A Customer's name cannot be null
  • Order the Burgers you send back to the user in alphabetical order using the Sequelize "order" option.


One More Thing

If you have any questions about this project or about the material we covered, the instructor and your TAs are only a Slack message away.

Good Luck!

Copyright

Coding Boot Camp (C) 2016. All Rights Reserved.

sequelizedburger's People

Contributors

victrolaface avatar

Watchers

 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.