Decora is a backend service for a home decor e-commerce platform. It provides RESTful endpoints for managing products, brands, reviews, categories, and other entities. The API is built using Node.js, Express.js, and Sequelize with a MySQL database. Testing has been performed using Postman.
- Node.js
- Express.js
- MySQL
- Sequelize ORM
- Postman (for API testing)
The application consists of the following tables:
- Product
- Brand
- Review
- Category
- Customer
- User
- Country
- Department
- State Region
- Roles
- Roles permissions
- Employees
- State
- Country State
- Brand
- Category
- Review
- Product
Each table has five standard controllers:
- Find All (
GET /{table}) - Find by Primary Key (ID) (
GET /{table}/:id) - Create (
POST /{table}) - Update (
PUT /{table}/:id) - Delete (
DELETE /{table}/:id)
- Node.js (>= 14.x)
- MySQL database
-
Clone the repository:
git clone https://github.com/yourusername/Decora.git cd Decora -
Install dependencies:
npm install
-
Configure environment variables: Create a
.envfile and add your database credentials:DB_HOST=localhost DB_USER=root DB_PASSWORD=yourpassword DB_NAME=decora_db DB_DIALECT=mysql PORT=5000
-
Start the server:
npm start
-
Test the API with Postman: Import the Postman collection and make requests to the API endpoints.
- Use Postman to send
GET,POST,PATCH, andDELETErequests to test the API. - Ensure proper request body formatting for
POSTandPATCHmethods. - Verify the responses and database updates.
This project is licensed under the MIT License.