This repository contains both the server and user interface code for the Easy Bazaar web application. Easy Bazaar is an online marketplace where users can browse, manage, and purchase products and categories. The backend is built using Node.js, Express.js, and MongoDB, with authentication handled via JWT (JSON Web Tokens). The frontend is built using React.js, providing a user-friendly interface for customers.
-
Clone the repository:
git clone https://github.com/your-username/easy-bazar-server.git cd easy-bazar-server
-
Install the dependencies:
npm install
-
Set up the environment variables as described in the Environment Variables section.
-
Start the server:
npm start
Create a .env
file in the root directory of your project and add the following environment variables:
PORT=your_port_number
DB_URI=your_mongodb_uri
To start the server, run:
npm start
The server will be running on the port specified in the .env
file.
-
Create Category
POST /categories
- Request Body:
{ "name": "Category Name" }
- Response: JSON object of the created category
-
Get All Categories
GET /categories
- Response: Array of categories
-
Create Product
POST /products
- Headers:
{ "Authorization": "Bearer <token>" }
- Request Body:
{ "name": "Product Name", "price": 100, "categoryId": "categoryId" }
- Response: JSON object of the created product
-
Update Product
PATCH /products/:id
- Headers:
{ "Authorization": "Bearer <token>" }
- Request Body:
{ "name": "Updated Product Name", "price": 150 }
- Response: JSON object of the updated product
-
Delete Product
DELETE /products/:id
- Headers:
{ "Authorization": "Bearer <token>" }
- Response: JSON object with deletion status
-
Get All Products
GET /products
- Response: Array of products
-
Get Product by ID
GET /products/:id
- Response: JSON object of the product
-
Create User
POST /users
- Request Body:
{ "email": "user@example.com", "password": "password" }
- Response: JSON object with creation status and token
-
Get All Users
GET /users
- Response: Array of users
-
Get User by Email
GET /users/:email
- Response: JSON object of the user
-
Update User
PATCH /users/:email
- Headers:
{ "Authorization": "Bearer <token>" }
- Request Body:
{ "name": "Updated User Name" }
- Response: JSON object of the updated user
This project is licensed under the MIT License. See the LICENSE file for details.
- Browse products by category
- Search for specific products
- Smooth search with results shown below without changing the page
- See all products
- Add new products
- Edit existing products
- Delete products
- View user details
- Edit user details
- Manage cart products using local storage
-
Clone the repository:
git clone https://github.com/your-username/easy-bazaar-ui.git cd easy-bazaar-ui
-
Install dependencies:
npm install
-
Start the development server:
npm start
- React.js
- HTML
- CSS
- JavaScript
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
For any questions or inquiries, please contact the project team at mynul.sakil@gmail.com.