Git Product home page Git Product logo

shopping-backend-orm's Introduction

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]

shopping-backend-orm's People

Contributors

cyphernyx 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.