Skip to content

This is the backend for an ecommerce web application, built using Express.js and Sequelize ORM to interact with a MySQL database.

License

Notifications You must be signed in to change notification settings

CypherNyx/shopping-backend-orm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shopping Backend Routes - ORM ecommerce site

Module 13 - Object-Relational Mapping (ORM) Challenge: E-commerce Back End

License: MIT

This is the backend for an ecommerce web application, built using Express.js and Sequelize ORM to interact with a MySQL database.

Table of Contents

Demo

Challenge.13.-.shopping.backend.ORM.mp4

Description

The database uses Sequelize as an ORM to interact with a MySQL database. Models and associations are defined to represent the database structure.

The API provides routes for managing and accessing data for products, categories, and tags.

The routes implement full CRUD functionality using REST conventions:

  • GET all and single items
  • POST to create new items
  • PUT to update existing items by id
  • DELETE to remove items by id

Installation

  1. Clone this GitHub repository to your local machine.
git clone https://github.com/CypherNyx/shopping-backend-orm.git
  1. Open a terminal or command prompt and navigate to the cloned repository's directory.
  2. Run npm i to install the necessary dependencies.
  3. Configure .env with your DB credentials
  4. Run node seeds/index.js to seed the DB (optional)
  5. Run npm start to start the server on localhost

Technologies:

  • Node.js
  • Express
  • Sequelize ORM
  • MySQL
  • dotenv
  • mysql2

Usage

The API can be tested locally using a REST client like Insomnia or Postman. The routes can be accessed from the defined base URL.

Some key routes include:

  • GET /api/products
  • GET /api/categories
  • POST /api/products
  • PUT /api/categories/1
  • DELETE /api/tags/1
  • Seed data is provided to prepopulate the database with products, categories and tags.

Contributing

Pull requests are welcome. Please open an issue first to discuss any proposed changes or additions.

License

License: MIT

https://opensource.org/licenses/MIT
This project is open source and available under the MIT License.


Questions

GitHub CypherNyx
Email: [email protected]

About

This is the backend for an ecommerce web application, built using Express.js and Sequelize ORM to interact with a MySQL database.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published