/e-commerce-backend

Backend Server for E Commerce Website

Primary LanguageJavaScriptMIT LicenseMIT

E-Commerce Backend

A Backend for an E-Commerce Application

MIT License badge

e-commerce-demo

----------------------------------------

Backend system written with Node.js using a MySQL database.

The Express, MySql2, Sequelize and dotenv node packages are used.

Description

The E-Commerce Back-End system established API calls for data base manipulation. With the integration of this Back-End system, an E-Commerce application will have the ability to transform and save Category, Product, and Tag data objects for the management of an merchant's inventory.

Table of Contents

Installation

*for this system to work, MySql and Node.js must be installed on your machine

  • download or clone application

  • open terminal in application root directory

  • open ".env TEMPLATE", fill in with user_name and user_pass, rename to .env

  • enter,npm i

  • enter, mysql -u { YOUR MYSQL USERNAME } -p

  • enter, source ./db/schema.sql

  • enter, \quit

  • *for seeding data into database enter, npm run seed

  • watch video tutorial for in depth installation and usage

Usage

npm start

Routes

Category


  • GET Categories: .../api/categories
  • GET Category: .../api/categories/:id
  • POST Category: .../api/categories
{
	"category_name": "Sports Equipment" 
}
  • PUT Category: .../api/categories/:id
{
	"category_name": "Sports Equipment" 
}
  • DEL Category: .../api/categories/:id

Product


  • GET Products: .../api/proudcts
  • GET Product: .../api/proudcts/:id
  • POST Product: .../api/proudcts
{
	"product_name": "New York Yankees Hat",
  "price": 200.00,
  "stock": 3,
	"category_id": 4,
  "tagIds": [1, 2, 3, 4] 
}
  • PUT Product: .../api/tags/:id
{
	"product_name": "Padrs Baseball Hat",
  "price": 200.00,
  "stock": 3,
	"category_id": 4,
  "tagIds": [1, 2, 3, 4] 
}
  • DEL Product: .../api/tags/:id

Tag


  • GET Tags: .../api/tags
  • GET Tag: .../api/tags/:id
  • POST Tag: .../api/tags
{
	"tag_name": "New Wave"
}
  • PUT Tag: .../api/tags/:id
{
	"tag_name": "Salsa"
}
  • DEL Tag: .../api/tags/:id

License

MIT License

Copyright (c) 2021 Anthony Pena

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation fil (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version History

Contributing

Please refer to the Contributor Covenenant for guidelines on contributing on this project.

Testing

API Routes may be tested on Insomnia Core

Questions

For any inquiries or questions, please contact Anthony Pena via:

Acknowledgments

Inspiration, code snippets, etc.