The goal of this assignment was to create a back end for an ecommerce site using mysql and sequelize along with insomnia.
- Ran npm init to initialize project and npm install to install necessary packages.
- Created connection.js file to configure database connection and used sequelize to create connection with stored credentials in .env file.
- Created models for category, product, tag, and prodcut tag.
- Created api routes for models and implemented CRUD operations for each route.
- Created seed script to populate database with the initial data
- In server.js, configured sequelize to sync models to the mysql database on server start.
-
Tested api routes in Insomnia to make sure CRUD operations were working.
-
GitHub Link: https://github.com/veryjohn1991/john-object-relation-mapping-work.git
-screencastify video link; https://drive.google.com/file/d/1eJGS75EX5qLnxn9WV9Bn5tNXnGVkEaMF/view
Note: Got assistance from one of my Friend and used chatgpt and google for some questions.