Skip to content

Performing CRUD functions on products, product categories, and product tags in a fictional database for learning purposes.

Notifications You must be signed in to change notification settings

blindsweatyhansolo/e-commerce-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ORM: E-Commerce Back End

Table of Contents

E-Commerce Back End is a Node application for performing CRUD (create, read, update, delete) functions on products, product categories, and product tags in a fictional database for learning purposes. Focusing on using Sequelize to create Models, associations/relationships between Models, and creating GET, PUT, POST, and DELETE routes for API use.

User Story:

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

This is a back-end application with no front-end implementation, but requires MySQL. Please ensure you have MySQL installed on your machine. For information on how to install MySQL please click here

  1. Clone this repository onto your machine with git clone
  2. From the root directory, install dependencies with npm install
  3. Open a connection to MySQL in the root directory, and create the database with source db/schema.sql
  4. Return to the command line and run command npm run seed to seed the database with provided data

Walkthrough Videos:

  1. Installation
  2. Models & Associations Breakdown
  3. GET Routes
  4. POST Routes
  5. PUT / DELETE Routes

Once dependencies have been installed, make a copy of the .envEXAMPLE file, drop the EXAMPLE portion in the name, and fill in the required fields with your MySQL username and password (note: username is usually root if working on your own machine):

Picture of env example

Start the database connection and server from the command line with npm start, then you can use a REST Client (Insomnia used in examples) to test endpoints:

Finding all Categories, Products, Product Tags:

Demo gif of GET all routes

Finding individual Categories, Products, Product Tags using ids (PrimaryKeys):

Demo gif of GET single routes

Create new instances of Categories, Products, Product Tags:

Demo gif of POST routes

Update Categories, Products, Product Tags:

Demo gif of PUT routes

Delete Categories, Products, Product Tags using ids (PrimaryKeys):

Demo gif of DELETE routes

As seen above, test API endpoints with a REST Client such as Insomnia or Postman

Contributions always welcome!

Technologies Used:

Noteable Packages Used:

If you have any questions about the application, or would like to become a contributor, please contact me using the information below:

GitHub

About

Performing CRUD functions on products, product categories, and product tags in a fictional database for learning purposes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published