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.
To install the necessary dependencies, execute the following command:
npm install To start the application run:
npm startMake sure to set up and seed the database before starting the server
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;To seed the database with initial data, run:
node seeds/index.js- GET /api/categories - Retrieves all categories.
- GET /api/categories/:id - Retrieves a category by ID.
- GET /api/products - Retrieves all products.
- GET /api/products/:id - Retrieves a product by ID.
- GET /api/tags - Retrieves all tags.
- Node.js
- MySQL
- Express.js
- Sequelize ORM
This project is licensed under the MIT License.
- github URL - https://github.com/jishyk/Object-Relational-Mapping