jarrodbb / E-Commerce-Back-End

E-Commerce Back End
MIT License
0 stars 0 forks source link

E-Commerce-Back-End

E-Commerce Back End

Description

Back end for an e-commerce

The application is a functional Express.js API utilising Sequelize to interact with MySql database

Fields and rules have been set with Sequelize to create associations between the tables

The user is able to,

Get all

Get a single

Create a single

Update a single

Delete a single

Table of Contents

Installation

Ensure a package.json file exists

If there is no package.json install one by running npm init

Note:

.gitignore added to include node_modules and .env

Install

Source Schema to ensure the correct db is being used

Seed

Run

server.js

package.json

seeds

routes

models

db

config

Video

YouTube

Mp4

Google Drive

Usage

Open Insomnia

When the application is running on localhost:3001 open Insomnia to check the backend

Category

Get all Categories (Get)

Include associated Products data

/api/categories

Screenshot 2023-08-19 at 12 36 21 pm

Get a single Category by its id (Get)

Include associated Products data

/api/categories/:id

Screenshot 2023-08-19 at 12 36 43 pm

Create a Category (Post)

/api/categories

Include the category_name in the body

Screenshot 2023-08-19 at 12 37 17 pm

Update a single Category by its id (Put)

/api/categories/:id

Screenshot 2023-08-19 at 12 38 16 pm

Delete a single Category by its id (Delete)

/api/categories/:id

Screenshot 2023-08-19 at 12 38 32 pm

Tag

Get all Tags (Get)

Include associated Products data

/api/tags

Screenshot 2023-08-19 at 12 38 43 pm

Get a single Tag by its id (Get)

Include associated Products data

/api/tags/:id

Screenshot 2023-08-19 at 12 38 54 pm

Create a new Tag (Post)

/api/tags

Include the tag_name in the body

Screenshot 2023-08-19 at 12 39 11 pm

Update a single Tag by its id (Put)

/api/tags/:id

Screenshot 2023-08-19 at 12 39 24 pm

Delete a single Tag by its id (Delete)

/api/tags/:id

Screenshot 2023-08-19 at 12 39 39 pm

Product

Get all Products (Get)

Include associated Products and Tag data

/api/products

Screenshot 2023-08-19 at 12 39 49 pm

Get a single Product by its id (Get)

Include associated Products and Tag data

/api/products/:id

Screenshot 2023-08-19 at 12 40 09 pm

Create a Product (Post)

/api/products

Include, product_name: price: stock: tagIds:

Screenshot 2023-08-19 at 12 40 46 pm

Update a single Product by its id (Put)

/api/products/:id

Screenshot 2023-08-19 at 12 41 20 pm

Delete a single Product by its id (Delete)

Screenshot 2023-08-19 at 12 41 37 pm

/api/products/:id

License

Please refer to the licence in the repo.