Bewakoof Clone is a full-stack e-commerce web application that allows users to browse, purchase, and review products. Admins can manage products, users, and orders efficiently.
- Frontend: React, React Router, Redux Toolkit
- Backend: Node.js, Express.js, MongoDB
- Authentication: JWT (JSON Web Token) & Refresh Token Mechanism
- Image Uploads: Multer, Cloudinary
- Authorization & Access Control: Role-based access (Admin, User)
| Method | Endpoint | Description |
|---|---|---|
| POST | /register |
User Registration |
| POST | /login |
User Login |
| POST | /refresh-token |
Refresh Access Token using Refresh Token |
| POST | /logout |
Logout User (Requires Authentication) |
| GET | /profile |
Get User Profile (Requires Authentication) |
| PATCH | /update-profile |
Update User Profile (Requires Authentication) |
| DELETE | /delete/:id |
Delete User (Admin Only) |
The refresh token mechanism helps maintain user authentication without requiring frequent logins.
- When a user logs in, both an access token and a refresh token are generated.
- The access token is used for authentication but expires after a short period.
- The refresh token allows the user to obtain a new access token without re-entering credentials.
- The refresh token is stored securely and sent only when requesting a new access token.
- On logout, the refresh token is invalidated to prevent unauthorized access.
| Method | Endpoint | Description |
|---|---|---|
| POST | /add-product |
Add New Product (Admin Only) |
| GET | / |
Get All Products |
| GET | /:id |
Get Product by ID (Requires Authentication) |
| PUT | /update/:id |
Update Product (Admin Only) |
| DELETE | /delete/:id |
Delete Product (Admin Only) |
| Method | Endpoint | Description |
|---|---|---|
| POST | /add |
Add Product to Cart (User & Admin) |
| GET | / |
View Cart (User & Admin) |
| POST | /remove |
Remove Item from Cart (User & Admin) |
| DELETE | /clear |
Clear Entire Cart (User & Admin) |
| Method | Endpoint | Description |
|---|---|---|
| POST | /add |
Add Review (Requires Authentication) |
| GET | /:productId |
Get Reviews for a Product |
| DELETE | /:reviewId |
Delete Review (Requires Authentication) |
| Path | Component |
|---|---|
/ |
Homepage |
/login |
LoginPage |
/profile |
ProfilePage |
/add-product |
AddProduct |
/add-to-cart |
AddToCart |
/product-detail/:id |
ProductDetail |
/products/:string |
ProductPage |
β
User authentication & authorization
β
Secure Refresh Token Implementation
β
Product CRUD (Admin only)
β
Shopping cart functionality
β
Product reviews & ratings
β
Secure API with JWT authentication
β
Image upload support
β
Responsive frontend
# Clone the repository
git clone https://github.com/Shkmr07/Bewakoof.git
# For Frontend
cd Frontend/bewakoof
# For Backend
cd Backend
# Install dependencies
npm install # For backend
yarn install # For frontend
# Start backend
npm run server
# Start frontend
yarn startFeel free to contribute to this project by submitting a pull request. Let's build something amazing together! π
This project is licensed under the MIT License.