Giter Club home page Giter Club logo

e-commerce-back-end's Introduction

E-Commerce Back End

ISC License badge

Description

This project is an e-commerce back-end application that uses Node.js, Express.js, MySQL2, Sequelize, dotenv, and Insomnia Core. This readme contains suggestion for Insomnia Core to verify proper functionality of the app.

Table of Contents

Walkthrough Video

Walkthrough video link image

Installation

To install necessary dependencies run the following command in the root of your project:

npm i

To create the database schema run the following command from a mysql prompt:

source db/schema.sql

To seed the database, exit from the mysql prompt and run this command:

npm run seed

Usage

To launch the app run the following command in the root of your project:

npm start

To run the test routines, you'll need Insomnia Core. The following information explains how to test the application using Insomnia Core.

To test the get all categories route, use the GET method and the following URL:

localhost:3001/api/categories/

To test the get category by id route, use the GET method and the following URL:

localhost:3001/api/categories/2

To test the create category route, use the POST method and the following URL:

localhost:3001/api/categories/

Then use the following JSON data as the body:

{
  "category_name": "Sporting Goods"
}

To test the update category by id route, use the PUT method and the following URL:

localhost:3001/api/categories/5

Then use the following JSON data as the body:

{
  "category_name": "Footwear"
}

To test the delete category by id route, use the DELETE method and the following URL:

localhost:3001/api/categories/3

To test the get all tags route, use the GET method and the following URL:

localhost:3001/api/tags/

To test the get tag by id route, use the GET method and the following URL:

localhost:3001/api/tags/5

To test the create tag route, use the POST method and the following URL:

localhost:3001/api/tags/

Then use the following JSON data as the body:

{
  "tag_name": "orange"
}

To test the update tag by id route, use the PUT method and the following URL:

localhost:3001/api/tags/7

Then use the following JSON data as the body:

{
  "tag_name": "purple"
}

To test the delete tag by id route, use the DELETE method and the following URL:

localhost:3001/api/tags/2

To test the get all products route, use the GET method and the following URL:

localhost:3001/api/products/

To test the get product by id route, use the GET method and the following URL:

localhost:3001/api/products/1

To test the create product route, use the POST method and the following URL:

localhost:3001/api/products/

Then use the following JSON data as the body:

{
  "product_name": "Basketball",
  "price": 200.00,
  "stock": 3,
  "category_id": 6,
  "tagIds": [6, 7, 9]
}

To test the update product by id route, use the PUT method and the following URL:

localhost:3001/api/products/5

Then use the following JSON data as the body:

{
  "product_name": "Bermuda Shorts",
  "price": 24.99,
  "stock": 15,
  "category_id": 2,
  "tagIds": [4, 5, 6]
}

To test the delete tag by id route, use the DELETE method and the following URL:

localhost:3001/api/products/2

Questions

If you have questions about this repo, open an issue or contact me directly at [email protected]. You can find more of my work at tharveyster.

License

ISC

e-commerce-back-end's People

Contributors

tharveyster avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.