Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E-Commerce Backend

Description

This project is the backend for an e-commerce site, developed using Node.js, Express.js, and Sequelize, interacting with a MySQL database. It's designed to manage a product catalog including categories, products, and tags.

Table of Contents

  1. Installation
  2. Usage
  3. Database Setup
  4. Seeding the Database
  5. API Routes
  6. Technologies Used
  7. License

Installation

To install the necessary dependencies, execute the following command:

npm install 

Usage

To start the application run:

npm start

Make sure to set up and seed the database before starting the server

Database Setup

1: Create a .env file in the root directory with your MySQL credentials:

DB_NAME='ecommerce_db'
DB_USER='your_mysql_username'
DB_PASSWORD='your_mysql_password'

2: Run schema.sql in the MySQL shell to create your database:

DROP DATABASE IF EXISTS ecommerce_db;
CREATE DATABASE ecommerce_db;

Seeding the Database

To seed the database with initial data, run:

node seeds/index.js

API Routes

Categories

  • GET /api/categories - Retrieves all categories.
  • GET /api/categories/:id - Retrieves a category by ID.

Products

  • GET /api/products - Retrieves all products.
  • GET /api/products/:id - Retrieves a product by ID.

Tags

  • GET /api/tags - Retrieves all tags.

Technologies Used

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

License

This project is licensed under the MIT License.

Contact

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages