Git Product home page Git Product logo

e-commerce-back-end's Introduction

E-commerce Backend

License

Description

This is the backend for an e-commerce website. The application uses Express.js and Sequelize to create a RESTful API that interacts with a MySQL database. The API allows the user to perform CRUD operations on products, categories, and tags, as well as view product tags and category products.

Table of Contents

Installation

To install this application, follow these steps:

  1. Clone the repository from GitHub
  2. Download and install MySQL from the official website if you haven't already done so. Follow the instructions provided to set up MySQL on your local machine.
  3. Download and install Node.js from the official website if you haven't already done so. Follow the instructions provided to install Node.js on your local machine.
  4. Open your terminal and navigate to the root directory of the application.
  5. Install the required dependencies by running npm install, this will install all the necessary packages and libraries required for the application to run.
  6. Create a .env file in the root directory of the application and provide your database credentials. Example:
DB_USER='your_mysql_username'
DB_PASSWORD='your_mysql_password'
DB_NAME='ecommerce_db'
  1. Log in to the MySQL server by running the command mysql -u root -p and entering your password when prompted.
  2. Create the database schema by running the command SOURCE db/schema.sql;..

Please note that steps 8 & 9 should be performed in a separate terminal window or tab from the one running the Node.js application.

Usage

To use this application, follow these steps:

  1. Open a terminal window and navigate to the root directory of the application.
  2. Run the command npm run seed to seed the database with sample data.
  3. Start the application by running npm run start.
  4. Use a tool such as Insomnia or Postman to test the various routes of the API.

For a short demonstration of the application, please refer to the video.

Routes

The following routes are available in the API:

Categories

  • GET /api/categories - get all categories
  • GET /api/categories/:id - get a single category by ID
  • POST /api/categories - create a new category
  • PUT /api/categories/:id - update a category by ID
  • DELETE /api/categories/:id - delete a category by ID

Alt Text

Products

  • GET /api/products - get all products
  • GET /api/products/:id - get a single product by ID
  • POST /api/products - create a new product
  • PUT /api/products/:id - update a product
  • DELETE /api/products/:id - delete a product by ID

Alt Text

Tags

  • GET /api/tags - get all tags
  • GET /api/tags/:id - get a single tag by ID
  • POST /api/tags - create a new tag
  • PUT /api/tags/:id - update a tag
  • DELETE /api/tags/:id - delete a tag by ID

Alt Text

Dependencies

This project requires the following dependencies:

License

This project is licensed under the MIT license. Click here for more information.

Contributing

To contribute to this project, please read the installation section and ensure you have a solid understanding of the codebase. Contributions are welcome via pull requests.

Tests

Currently, there are no automated tests for this application. Testing is performed manually.

Questions

If you have any questions, you can reach out to me on GitHub or contact me directly at [email protected].

e-commerce-back-end's People

Contributors

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