This app is based on Express.js API and use Sequelize to interact with a MySQL database.
View Demo Part1
·
View Demo Part2
·
Report Bug
·
Request Feature
Table of Contents
Internet retail, also known as e-commerce, is the largest sector of the electronics industry, generating an estimated $29 trillion in 2019. E-commerce platforms like Shopify and WooCommerce provide a suite of services to businesses of all sizes. Due to their prevalence, understanding the fundamental architecture of these platforms will benefit you as a full-stack web developer.
This task aims to configure a working Express.js API to use Sequelize to interact with a MySQL database.
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 following dependencies/resources have been used:
- Node must be installed
- mySQL must be installed
- Install all necessary dependencies
- sequelize, dotenv, mysql2, and cli-table must be installed
npm i
- Point the terminal to the main directory and run the following command
npm start
-
Point the terminal to the main directory
-
Run the following command in mySQL CLI
SOURCE db/schema.sql
-
Quit mySQL command line
quit;
-
Populate the database with your own data or use the seed provided in the package
npm run seed
-
Initiate the server
npm run start
Heran Yang- LinkedIn
Project Link: https://github.com/heranyang93/team-profile-generator