Skip to content

Back end for an eCommerce application. Allows users to manage an inventory.

License

Notifications You must be signed in to change notification settings

mtorcellini/ecommerce-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eCommerce Backend

last commit license-badge size

Description

A backend for an eCommerce application. Allows users to manipulate a database of products, categories, and tags. Demonstrates use of the Sequelize package for basic CRUD functionality with a SQL database. Can be accessed and interacted with via an API client such as Postman or Insomnia.

Table of Contents

Installation

  1. Clone this repo. Install dependencies by running npm install.

  2. Create a local database called ecommerce_db by running the schema.sql file from the MySQL shell.

  3. Exit the database and seed it with some starter data by running npm run seed

  4. Create a .env file in the root directory with the following variables:

DB_NAME=ecommerce_db
DB_USER=[your SQL username]
DB_PW=[your SQL password]

Usage

  • Run npm start to start the program.

  • Submit requests to any of the endpoints using an API client.

Routes

/api/products/id

  • id is optional (will return all products by default)
  • GET, POST, UPDATE, DELETE
  • GET returns products and associated categories and tags

Example response from GET:

Product GET

Example request object for POST, PUT:

  • Not all properties required for PUT

Product POST

/api/categories/id

  • id is optional
  • GET, POST, UPDATE, DELETE
  • GET returns categories and associated products

Category GET

/api/tags/id

  • id is optional
  • GET, POST, UPDATE, DELETE
  • GET returns tags and associated products

Tag GET

License

MIT License

About

Back end for an eCommerce application. Allows users to manage an inventory.

Topics

Resources

License

Stars

Watchers

Forks