Skip to content

E-commerce Backend: Building a secure and scalable back end for an e-commerce platform using Express.js and Sequelize for data management and interaction with a MySQL database. This project aims to provide a solid foundation for businesses to succeed in the competitive world of online retail.

License

Notifications You must be signed in to change notification settings

MartinCespedes/E-Commerce_Back_End

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Object-Relational Mapping (ORM) E-Commerce Back End

Contents

Description

Installation

Usage

Resources & Credit

Features

Application Screenshot Preview

Description

  • Internet retail, also known as e-commerce, is the largest sector of the electronics industry, having generated an estimated US$29 trillion in 2017 (Source: United Nations Conference on Trade and Development). E-commerce platforms like Shopify and WooCommerce provide a suite of services to businesses of all sizes. Due to the prevalence of these platforms, developers should understand the fundamental architecture of e-commerce sites.

  • My task is to build the back end for an e-commerce site. I will be using Express.js API and configure it to use Sequelize to interact with a MySQL database.

Installation

  1. Cloning the Repository
  • First, clone the repository containing the functional Express.js API:
git clone <repository-url>
cd <repository-folder>
  1. Setting up Environment Variables
  • Create a .env file in the root of the project folder and add your MySQL database credentials:
DB_NAME=<your-database-name>
DB_USER=<your-mysql-username>
DB_PASSWORD=<your-mysql-password>
  • This will enable you to connect to the database using Sequelize.

Usage

  1. Creating and Seeding the Development Database
  • Install the required dependencies:
npm install
  1. Run the schema and seed commands & start the server with:
npm run seed
npm start
  1. Testing API GET Routes
  • Open API GET routes in Insomnia (or any API client of your choice) for categories, products, or tags:
GET http://localhost:3001/api/categories
GET http://localhost:3001/api/products
GET http://localhost:3001/api/tags

  • The data for each of these routes will be displayed in a formatted JSON.
  1. Testing API POST, PUT, and DELETE Routes:
  • Test API POST, PUT, and DELETE routes in Insomnia to create, update, and delete data in your database:

  • Categories

POST http://localhost:3001/api/categories
PUT http://localhost:3001/api/categories/:id
DELETE http://localhost:3001/api/categories/:id

  • Products
POST http://localhost:3001/api/products
PUT http://localhost:3001/api/products/:id
DELETE http://localhost:3001/api/products/:id

  • Tags
POST http://localhost:3001/api/tags
PUT http://localhost:3001/api/tags/:id
DELETE http://localhost:3001/api/tags/:id

Resources/Credit

Features

  • Express.js
  • MySQL
  • Sequelize
  • JavaScript

Application Screenshot Preview (Insomnia)

E-Commerce_SQL

E-Commerce_SQL

License

License

Copyright (c) 2023 Martin Cespedes. All rights reserved.

About

E-commerce Backend: Building a secure and scalable back end for an e-commerce platform using Express.js and Sequelize for data management and interaction with a MySQL database. This project aims to provide a solid foundation for businesses to succeed in the competitive world of online retail.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published