GithubHelp home page GithubHelp logo

dahlia-lemonade-stand's Introduction

  • Folder: 07-ORM-To-Sequelize/Unsolved

  • INSTRUCTIONS:

    1. Create a new local MYSQL database called 'todolist', but don't create any tables.

    2. Notice how there are no config or models folders?

    3. In terminal, run npm i

    4. In terminal, run npm i --save-dev sequelize-cli

    5. In terminal, run npm i -g npx (You'll only have to do this once, ever, on this machine). More on npx: https://github.com/npm/npx https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b

    6. In terminal, type in the following commands (hit enter after each):

      1. npx sequelize init:models
      2. npx sequelize init:config
    7. Step 6 should have created a config and a models folder for us. Navigate to the config folder, open config.json, and modify as per instructor's instructions to use .env file.

    8. Navigate to the models folder and create a new file called todo.js. Along with instructor, create a Todo model with columns for "text" (DataTypes.STRING), and "complete" (DataTypes.BOOLEAN).

    9. Navigate to the server.js file and require all of our models by requiring the models folder. Save this to a variable and name it "db".

    10. Sync the models by running db.sequelize.sync() after we start the express server.

    11. In your terminal, run npm run watch. Check MYSQL Workbench to see if a Todos table was created. If so, you were successful. If not, check your terminal for any errors.

    12. Now let's complete the routes/api-routes.js file to make the app work.

dahlia-lemonade-stand's People

Contributors

cnrudd avatar

Watchers

James Cloos 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.