The purpose of this application is to provide a back-end, including an SQL database, for an e-commerce platform that is able to track products in the catalog, including relating them to specific categories and tags. The application supports all CRUD operations for the management of products, categories, and tags.
The application is built using the following tools & packages:
- MySQL
- Sequelize
- Express
- Dotenv
The application is able to perform the following functions:
- Manage products in the database with the following parameters:
- Product Name
- Price
- Stock
- Category (from Categories table)
- Manage categories in the database with the following parameters:
- Category Name
- Manage tags in the database with the following parameters:
- Tag Name
- Perform all CRUD operations for products, categories, and tags
The following video shows a demonstration of the application being used!
To use this application, you will need to have Node.js and MySQL installed and configured.
To install the application:
- Fork the repository.
- Execute
npm install
in the command line. - Create a
.env
file in the root directory and populate it with the following process variables:
i.DB_NAME = ecommerce_db
ii.DB_USER =
Your MySQL Username
iii.DB_PW =
Your MySQL Password\ - In the MySQL shell, execute
SOURCE db/db.sql;
.
To use this application, perform the following in the console:
- If you want to seed the database with the pre-populated seed data, execute
npm run seed
. - Execute
npm start
to start the server. - Using an API client (or a configured front-end), execute any of the following requests, as necessary, to manage the database data:
i. POST request to create a new item
ii. GET request to return either an array of all items or a specific item, queried by id
iii. PUT request to update an item
iv. DELETE request to delete an item\ - When database management is complete, stop the server.
- MySQL: https://www.mysql.com/
- Sequelize: https://sequelize.org/
- Express: https://expressjs.com/
- Dotenv: https://www.npmjs.com/package/dotenv