Developing and building the back end for an e-commerce site. The application will use an Express.js API and configured to use Sequelize to interact with the MySQL database. The application will be ran using the command line below:
node start
Requirments
Node.js | MySQL | Sequelize | dotenv | Express
Once Installed:
- Clone the Repository on to your machine.
- Open the terminal and ensure you are in the right file path.
- Run the command
npm install
to download the packages. - Log into my sequel and run the command
source db/schema.sql
to create the database. - Run the command
npm run seed
to seed the database. - Then run the command
node start
to run the software. - The application will then begin to run locally.
AS A manager at an internet retail company
I WANT a back end for my e-commerce website that uses the latest technologies
SO THAT my company can compete with other e-commerce companies
GIVEN a functional Express.js API
WHEN I add my database name, MySQL username, and MySQL password to an environment variable file
THEN I am able to connect to a database using Sequelize
WHEN I enter schema and seed commands
THEN a development database is created and is seeded with test data
WHEN I enter the command to invoke the application
THEN my server is started and the Sequelize models are synced to the MySQL database
WHEN I open API GET routes in Insomnia for categories, products, or tags
THEN the data for each of these routes is displayed in a formatted JSON
WHEN I test API POST, PUT, and DELETE routes in Insomnia
THEN I am able to successfully create, update, and delete data in my database
The image below displays the database using the software Insomnia. In this case, we are using, 'GET', to recieve information from the database.
A link to the Video Part 1. The video demonstrates on how to run the schema, seed the database, as well as start the server:
https://watch.screencastify.com/v/eB2igGHhc6KG4C9z3QdT
A link to the Video Part 2. The video demonstrates the POST, PUT, DELETE, and GET routes using the application, Insomnia.
https://watch.screencastify.com/v/CeIjkqOH2JsQzYoTtQTo
A link to the code:
https://github.com/jgarcia45/e-commerce-back-end
Copyright (c) Juan Garcia. All rights reserved.
Licensed under the MIT license.