{"id":23073859,"url":"https://github.com/pawan8085/full-stack-ecommerce-application","last_synced_at":"2025-06-19T00:02:32.948Z","repository":{"id":267753204,"uuid":"902238248","full_name":"Pawan8085/Full-Stack-Ecommerce-Application","owner":"Pawan8085","description":"A complete E-commerce platform built with Spring Boot (backend) and a responsive front-end. It features user authentication, product search, filtering, sorting, cart management, payment gateway integration, and admin management functionalities. Advanced features include email OTP verification, JWT-based security and pagination.","archived":false,"fork":false,"pushed_at":"2025-02-12T16:31:20.000Z","size":111,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T11:34:06.597Z","etag":null,"topics":["java","jwt-authentication","payment-gateway","springboot","springsecurity","sql"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pawan8085.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-12T07:17:35.000Z","updated_at":"2025-02-12T16:31:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"1a51834f-1a7f-4497-8846-3bf05976f7ea","html_url":"https://github.com/Pawan8085/Full-Stack-Ecommerce-Application","commit_stats":null,"previous_names":["pawan8085/full-stack-ecommerce-application"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Pawan8085/Full-Stack-Ecommerce-Application","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pawan8085%2FFull-Stack-Ecommerce-Application","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pawan8085%2FFull-Stack-Ecommerce-Application/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pawan8085%2FFull-Stack-Ecommerce-Application/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pawan8085%2FFull-Stack-Ecommerce-Application/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pawan8085","download_url":"https://codeload.github.com/Pawan8085/Full-Stack-Ecommerce-Application/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pawan8085%2FFull-Stack-Ecommerce-Application/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260654613,"owners_count":23042670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","jwt-authentication","payment-gateway","springboot","springsecurity","sql"],"created_at":"2024-12-16T08:19:51.533Z","updated_at":"2025-06-19T00:02:27.910Z","avatar_url":"https://github.com/Pawan8085.png","language":"Java","readme":"\n# E-Commerce Application\n\nAn end-to-end E-Commerce application built using **Spring Boot** and **RESTful APIs** with advanced features for security, usability, and performance.\n\n---\n\n## 🚀 Features\n\n### **Public Functionalities**\n- 🔍 **Search Products**: Search for products using keywords.\n- 🛒 **Filter \u0026 Sort Products**:\n  - Filter by **minimum/maximum price** and **rating**.\n  - Sort products by **price ascending** or **descending**.\n- 📂 **View Categories**: Explore product categories.\n- 📝 **Product Reviews**: View reviews and ratings for products.\n- 🔑 **Password Reset with Email OTP Verification**: Secure password recovery process.\n- 🔐 **User Sign-In**: JWT-based authentication for secure access.\n\n### **Admin Functionalities**\n- 🛠️ **Product \u0026 Category Management**:\n  - Add, update, and manage products and categories.\n- 📊 **User Analytics**: View the total number of registered users.\n\n### **Customer Functionalities**\n- 🛒 **Cart Management**:\n  - Add/remove items from the cart.\n  - Update item quantities.\n- 💳 **Buy Products**: Secure product checkout and payment.\n- ⭐ **Add Reviews**: Post reviews for purchased products.\n- 📦 **Order History**: View order and cart history.\n\n---\n\n## 🌟 Advanced Features\n\n### 🔒 **JWT-Based Authentication**\n- Role-based access control for users (Admin/Customer/Public).\n- Token expiration and refresh handling.\n\n### 🔑 **Two-Step Verification**\n- Added security with **email OTP verification** for sensitive actions like password changes.\n\n### ⏳ **Backend Scheduling**\n- Automated deletion of expired OTPs using Spring Scheduler.\n\n### 💳 **Payment Gateway Integration**\n- Integrated **RazorPay** for seamless and secure payments during checkout.\n\n### 📄 **Pagination \u0026 Sorting**\n- Optimized product search results with pagination and sorting for a better user experience.\n\n### 📤 **Robust API Design**\n- RESTful endpoints with proper request validation and error handling.\n- Standardized response structure for consistent data delivery.\n\n---\n- 🎥 **Project Overview Video**:  [click here](https://drive.google.com/file/d/1XXhl1-LW8z3Q9iWlPymOpFeuIzd-KmGe/view?usp=sharing).\n- 🎥 **Project Demo Video**:  [click here](https://drive.google.com/file/d/1t2BASf5sNGW4Nak7Cm05eEaErl4flt8H/view?usp=sharing).\n---\n\n## 🛠️ **Tech Stack**\n- **Backend**: Spring Boot, Spring Security, Hibernate, MySQL.\n- **Frontend**: HTML, CSS, JavaScript.\n- **Security**: JWT Authentication, Email OTP Verification.\n- **Payment**: RazorPay Payment Gateway.\n- **Scheduling**: Spring Scheduler for task automation.\n\n---\n\n## 📂 **Project Structure**\n```\nEcommerce\n├── src\n│   └── main\n│       ├── java\n│       │   └── com\n│       │       └── app\n│       │           ├── config               # Configuration package\n│       │           ├── controller           # REST controllers package\n│       │           ├── dtos                 # Data Transfer Objects package\n│       │           ├── exceptions           # Custom exceptions package\n│       │           ├── model                # JPA entities package\n│       │           ├── repo                 # Repositories package\n│       │           ├── services             # Service layer package\n│       │           └── utils                # Utility classes package\n│       └── resources\n│           └── application.properties       # Application configuration\n├── src\n│   └── test                                 # Test package\n└── pom.xml                                  # Maven build configuration\n\n```\n\n---\n\n\n# API Documentation\n###  User Sign-In\n\n- **URL**: `/app/signIn`\n- **Method**: `GET`\n- **Description**: Authenticate any user (e.g., customer, admin) using Basic Authentication and provide a token for secure access.\n\n### Request Headers\n\n```http\nAuthorization: Basic base64encoded(email:password)\n```\n---\n## Customer Endpoints\n\n### 1. Customer Registration\n\n- **URL**: `/app/customer/register`\n- **Method**: `POST`\n- **Description**: Create a customer account.\n\n#### Request Body\n\n```json\n{\n  \"name\": \"username\",\n  \"email\": \"user@gmail.com\",\n  \"password\": \"user1234\",\n  \"city\": \"usercity\"\n} \n```\n### 2. Customer Profile\n\n- **URL**: `/app/customer/profile`\n- **Method**: `GET`\n- **Description**: Fetches the profile details of the authenticated customer.\n- **Authentication**: Requires JWT token in the request header for authentication.\n\n\n#### Request Headers\n\n| Key           | Type   | Description                    |\n|---------------|--------|--------------------------------|\n| `Authorization` | `JWT Token` | Bearer token for authentication |\n\n\n\n## 3. Customer Change Password Process\n\nThis process involves two steps to securely change a customer's password.\n\n---\n\n### STEP 1: Request OTP for Password Change\n\n- **URL**: `/app/customer/change-password`\n- **Method**: `POST`\n- **Description**: Verifies the current password. If the password is valid, sends otp to user's registered email for verification.\n- **Authentication**: Requires JWT token in the request header for authentication.\n\n#### Request Headers\n\n| Key             | Type        | Description                      |\n|-----------------|-------------|----------------------------------|\n| `Authorization` | `JWT Token` | Bearer token for authentication  |\n\n#### Request Body\n\n```json\n{\n  \"oldPassword\": \"userOldPassword\"\n}\n```\n\n### STEP 2: Verify OTP and Change Password\n\n- **URL**: `/app/customer/change-password/verify-otp`\n- **Method**: `POST`\n- **Description**: This request verifies the OTP and changes the customer's password. The request requires the old password, new password and otp\n- **Authentication**: Requires JWT token in the request header for authentication.\n\n#### Request Headers\n\n| Key             | Type        | Description                      |\n|-----------------|-------------|----------------------------------|\n| `Authorization` | `JWT Token` | Bearer token for authentication  |\n\n#### Request Body\n\n```json\n{\n  \"oldPassword\": \"userOldPassword\",\n  \"newPassword\": \"userNewPassword\",\n  \"otp\": \"123456\"\n}\n```\n\n\n\n\n\n### 4. Create Order\n\n- **URL**: `app/customer/order/create`\n- **Method**: `POST`\n- **Description**: Allows a customer to create order.\n- **Authentication**: Requires JWT token in the request header for authentication.\n\n#### Request Headers\n\n| Key           | Type   | Description                    |\n|---------------|--------|--------------------------------|\n| `Authorization` | `JWT Token` | Bearer token for authentication |\n\n#### Request Body\n\n```json\n{\n  \"productId\": \"12345\",\n  \"quantity\": 1,\n  \"paymentType\": \"CASH_ON_DELIVERY\"\n}\n\n```\n### Note\n\n- **`paymentType`**: Accepted values are:\n  - `\"CASH_ON_DELIVERY\"`\n  - `\"ONLINE\"`\n\n\n### 5. Confirm Order\n\n- **URL**: `app/customer/product/buy`\n- **Method**: `POST`\n- **Description**: Allows a customer to Confirm and buy the Product.\n- **Authentication**: Requires JWT token in the request header for authentication.\n\n#### Request Headers\n\n| Key           | Type   | Description                    |\n|---------------|--------|--------------------------------|\n| `Authorization` | `JWT Token` | Bearer token for authentication |\n\n#### Request Body\n\n```json\n{\n  \"orderId\" : 235\n}\n\n```\n\n### 6. Product Review\n\n- **URL**: `/app/customer/product/rating/{productId}`\n- **Method**: `POST`\n- **Description**: Allows customer to add review of product.\n- **Authentication**: Requires JWT token in the request header for authentication.\n\n#### Request Headers\n\n| Key           | Type   | Description                    |\n|---------------|--------|--------------------------------|\n| `Authorization` | `JWT Token` | Bearer token for authentication |\n\n#### Request Parameters\n\n| Parameter | Type     | Required | Description                                                      |\n|-----------|----------|----------|------------------------------------------------------------------|\n| `productId`       | `long` | Yes      | The ID of the product to which the review will be added.          |\n\n\n#### Request Body\n\n```json\n{\n  \"rating\": 5,\n  \"description\": \"user review...\"\n}\n\n```\n\n### 7. Add to Cart \n\n- **URL**: `/app/customer/cart/{productId}`\n- **Method**: `POST`\n- **Description**: Allows customer to add products to cart.\n- **Authentication**: Requires JWT token in the request header for authentication.\n\n#### Request Headers\n\n| Key           | Type   | Description                    |\n|---------------|--------|--------------------------------|\n| `Authorization` | `JWT Token` | Bearer token for authentication |\n\n#### Request Parameters\n\n| Parameter | Type     | Required | Description                                                      |\n|-----------|----------|----------|------------------------------------------------------------------|\n| `productId`       | `long` | Yes      | The ID of the product to be added to the cart.          |\n\n\n### 8. Get all cart items\n\n- **URL**: `/app/customer/cart`\n- **Method**: `GET`\n- **Description**: Retrieve cart items of authenticated customer.\n- **Authentication**: Requires JWT token in the request header for authentication.\n\n#### Request Headers\n\n| Key           | Type   | Description                    |\n|---------------|--------|--------------------------------|\n| `Authorization` | `JWT Token` | Bearer token for authentication\n\n### 9. Update cart item\n\n- **URL**: `/app/customer/cart/{carItemId}`\n- **Method**: `PUT`\n- **Description**: Updates cart item .\n- **Authentication**: Requires JWT token in the request header for authentication.\n\n#### Request Headers\n\n| Key           | Type   | Description                    |\n|---------------|--------|--------------------------------|\n| `Authorization` | `JWT Token` | Bearer token for authentication |\n\n#### Request Parameters\n\n| Parameter | Type     | Required | Description                                                      |\n|-----------|----------|----------|------------------------------------------------------------------|\n| `carItemId`       | `long` | Yes      | The ID of the cart item to update its quantity.          |\n\n### 10. Get all order items\n\n- **URL**: `/app/customer/orders`\n- **Method**: `GET`\n- **Description**: Retrieve order items of authenticated customer.\n- **Authentication**: Requires JWT token in the request header for authentication.\n\n#### Request Headers\n\n| Key           | Type   | Description                    |\n|---------------|--------|--------------------------------|\n| `Authorization` | `JWT Token` | Bearer token for authentication \n\n\n\u0026nbsp;\n\n## Admin Endpoints\n### 1. Admin Registration\n\n- **URL**: `/app/admin/register`\n- **Method**: `POST`\n- **Description**: Create a admin account.\n\n#### Request Body\n\n```json\n{\n  \"name\": \"admin_name\",\n  \"email\": \"admin@gmail.com\",\n  \"password\": \"admin1234\",\n  \"city\": \"admin_city\"\n} \n```\n### 2. Add Product Category\n\n- **URL**: `/app/admin/category`\n- **Method**: `POST`\n- **Description**: End point for creating product category.\n\n#### Request Headers\n\n| Key           | Type   | Description                    |\n|---------------|--------|--------------------------------|\n| `Authorization` | `JWT Token` | Bearer token for authentication\n\n#### Request Body\n\n```json\n{\n  \"image\": \"electronics.jpg\",\n  \"category\" : \"Electronics\"\n} \n```\n### 3. Add Product \n\n- **URL**: `/app/admin/product/{categoryId}`\n- **Method**: `POST`\n- **Description**: End point for adding product in their respective category.\n\n#### Request Headers\n\n| Key           | Type   | Description                    |\n|---------------|--------|--------------------------------|\n| `Authorization` | `JWT Token` | Bearer token for authentication\n\n#### Request Parameters\n\n| Parameter | Type     | Required | Description                                                      |\n|-----------|----------|----------|------------------------------------------------------------------|\n| `categoryId`       | `long` | Yes      | The ID of the category to which the product will be added.          |\n\n#### Request Body\n\n```json\n{\n  \"productName\" : \"macbook \",\n  \"productDescription\": \"macbook air m1 2020\",\n  \"price\": 85000,\n  \"image\": \"macbook.jpg\",\n  \"stocks\": 60,\n  \n} \n```\n### 5. Update Product \n\n- **URL**: `/app/admin/product/update`\n- **Method**: `PUT`\n- **Description**: End point for updating product details. Only include the fields to be updated.\n\n#### Request Headers\n\n| Key           | Type   | Description                    |\n|---------------|--------|--------------------------------|\n| `Authorization` | `JWT Token` | Bearer token for authentication\n\n#### Request Body (Partial Update Supported)\n\n```json\n{\n  \"productName\": \"macbook\",\n  \"productDescription\": \"macbook air m1 2020\",\n  \"price\": 85000,\n  \"image\": \"macbook.jpg\",\n  \"stocks\": 60\n}\n```\n### Notes:\n\n- **Include only the fields you want to update.**  \n- For example:\n  - To update the price:\n    ```json\n    { \"price\": 85000 }\n    ```\n  - To update the stock:\n    ```json\n    { \"stocks\": 60 }\n    ```\n\n\n### 6. Total users\n\n- **URL**: `/app/admin/users`\n- **Method**: `GET`\n- **Description**: End point for Retrieveing total number of users.\n\n#### Request Headers\n\n| Key           | Type   | Description                    |\n|---------------|--------|--------------------------------|\n| `Authorization` | `JWT Token` | Bearer token for authentication\n\n\n\u0026nbsp;\n\n## Public Endpoints\n### 1. Search Products\n\n- **URL**: `/app/search`\n- **Method**: `GET`\n- **Description**: Fetch products based on a search query string. The response is paginated and includes a list of products matching the search term.\n\n## Request Parameters\n\n| Parameter | Type     | Required | Description                                                      |\n|-----------|----------|----------|------------------------------------------------------------------|\n| `q`       | `String` | Yes      | Search query string for product names or descriptions.          |\n| `page`    | `int`    | Yes      | Page number for pagination  |\n\n### **Usage Example**\n\n### Request\n```\nGET /app/search?q=earbuds\u0026page=1\n```\n\n### Response\n```json\n{\n  \"data\": [\n    {\n      \"pId\": 101,\n      \"productName\": \"Wireless Earbuds\",\n      \"productDescription\": \"Bluetooth 5.0, Noise-Canceling\",\n      \"price\": 2999,\n      \"rating\": 4.5,\n      \"image\": \"earbuds.jpg\",\n      \"stocks\": 50,\n      \"sold\": 150,\n      \"isOutOfStock\": false\n    }\n  ],\n  \"pageInfo\": {\n    \"currentPage\": 1,\n    \"totalPages\": 1,\n    \"totalRecords\": 1,\n    \"recordPerPage\": 20\n  }\n}\n```\n\n\n### 2. Filter Products by Rating\n\n- **URL**: `/app/search/rating`\n- **Method**: `GET`\n- **Description**: Fetch products filtered by a minimum rating value and search key. The response includes products matching the given rating criteria..\n\n### **Request Parameters**\n\n| Parameter | Type     | Required | Description                                     |\n|-----------|----------|----------|-------------------------------------------------|\n| `q`       | `String` | Yes      | Search query string for product names or descriptions. |\n| `rating`  | `int`    | Yes      | Minimum rating to filter products, rating must be an integer between 1 and 5 (inclusive).\" |\n| `page`    | `int`    | Yes      | Page number for pagination    |\n\n### **Usage Example**\n### Request\n```\nGET /app/search/rating?rating=4\u0026q=earbuds\u0026page=1\n```\n\n### Response\n```json\n{\n  \"data\": [\n    {\n      \"pId\": 101,\n      \"productName\": \"Wireless Earbuds\",\n      \"productDescription\": \"Bluetooth 5.0, Noise-Canceling\",\n      \"price\": 2999,\n      \"rating\": 4.5,\n      \"image\": \"earbuds.jpg\",\n      \"stocks\": 50,\n      \"sold\": 150,\n      \"isOutOfStock\": false\n    }\n  ],\n  \"pageInfo\": {\n    \"currentPage\": 1,\n    \"totalPages\": 1,\n    \"totalRecords\": 1,\n    \"recordPerPage\": 20\n  }\n}\n```\n\n## 3. Filter Products by Price Range\n\n- **URL**: `/app/search/price`\n- **Method**: `GET`\n- **Description**: Fetch products filtered within a specified price range. The response includes products whose prices fall between the given minimum and maximum values.\n\n### **Request Parameters**\n\n| Parameter | Type     | Required | Description                                      |\n|-----------|----------|----------|--------------------------------------------------|\n| `min`     | `int`    | Yes      | Minimum price for filtering products. Must be greater equal to 0    |\n| `max`     | `int`    | Yes      | Maximum price for filtering products. Should be greater than max           |\n| `q`       | `String` | Yes      | Search query string for product names or descriptions. |\n| `page`    | `int`    | Yes      | Page number for pagination |\n\n### **Usage Example**\n\n#### Request\n```\nGET /app/search/price?min=1000\u0026max=5000\u0026q=electronics\u0026page=1\n```\n\n#### Response\n```json\n{\n  \"data\": [\n    {\n      \"pId\": 102,\n      \"productName\": \"Smartphone\",\n      \"productDescription\": \"64GB Storage, Dual SIM\",\n      \"price\": 4500,\n      \"rating\": 4.3,\n      \"image\": \"smartphone.jpg\",\n      \"stocks\": 30,\n      \"sold\": 200,\n      \"isOutOfStock\": false\n    },\n    {\n      \"pId\": 103,\n      \"productName\": \"Headphones\",\n      \"productDescription\": \"Wireless, Over-Ear\",\n      \"price\": 3000,\n      \"rating\": 4.0,\n      \"image\": \"headphones.jpg\",\n      \"stocks\": 20,\n      \"sold\": 120,\n      \"isOutOfStock\": false\n    }\n  ],\n  \"pageInfo\": {\n    \"currentPage\": 1,\n    \"totalPages\": 1,\n    \"totalRecords\": 2,\n    \"recordPerPage\": 20\n  }\n}\n```\n\n## 4. Sort Products by Price (Ascending)\n\n- **URL**: `/app/search/asc`\n- **Method**: `GET`\n- **Description**: Fetch products sorted by price in ascending order. The response includes products sorted from the lowest to the highest price.\n\n### **Request Parameters**\n\n| Parameter | Type     | Required | Description                                      |\n|-----------|----------|----------|--------------------------------------------------|\n| `q`       | `String` | Yes      | Search query string for product names or descriptions. |\n| `page`    | `int`    | Yes      | Page number for pagination  |\n\n### **Usage Example**\n\n#### Request\n```\nGET /app/search/asc?q=electronics\u0026page=1\n```\n\n#### Response\n```json\n{\n  \"data\": [\n    {\n      \"pId\": 103,\n      \"productName\": \"Headphones\",\n      \"productDescription\": \"Wireless, Over-Ear\",\n      \"price\": 3000,\n      \"rating\": 4.0,\n      \"image\": \"headphones.jpg\",\n      \"stocks\": 20,\n      \"sold\": 120,\n      \"isOutOfStock\": false\n    },\n    {\n      \"pId\": 102,\n      \"productName\": \"Smartphone\",\n      \"productDescription\": \"64GB Storage, Dual SIM\",\n      \"price\": 4500,\n      \"rating\": 4.3,\n      \"image\": \"smartphone.jpg\",\n      \"stocks\": 30,\n      \"sold\": 200,\n      \"isOutOfStock\": false\n    }\n  ],\n  \"pageInfo\": {\n    \"currentPage\": 1,\n    \"totalPages\": 1,\n    \"totalRecords\": 2,\n    \"recordPerPage\": 20\n  }\n}\n```\n\n## 5. Sort Products by Price (Descending)\n\n- **URL**: `/app/search/desc`\n- **Method**: `GET`\n- **Description**: Fetch products sorted by price in descending order. The response includes products sorted from the highest to the lowest price.\n\n### **Request Parameters**\n\n| Parameter | Type     | Required | Description                                      |\n|-----------|----------|----------|--------------------------------------------------|\n| `q`       | `String` | Yes      | Search query string for product names or descriptions. |\n| `page`    | `int`    | Yes      | Page number for pagination  |\n\n### **Usage Example**\n\n#### Request\n```\nGET /app/search/desc?q=electronics\u0026page=1\n```\n\n#### Response\n```json\n{\n  \"data\": [\n    {\n      \"pId\": 102,\n      \"productName\": \"Smartphone\",\n      \"productDescription\": \"64GB Storage, Dual SIM\",\n      \"price\": 4500,\n      \"rating\": 4.3,\n      \"image\": \"smartphone.jpg\",\n      \"stocks\": 30,\n      \"sold\": 200,\n      \"isOutOfStock\": false\n    },\n    {\n      \"pId\": 103,\n      \"productName\": \"Headphones\",\n      \"productDescription\": \"Wireless, Over-Ear\",\n      \"price\": 3000,\n      \"rating\": 4.0,\n      \"image\": \"headphones.jpg\",\n      \"stocks\": 20,\n      \"sold\": 120,\n      \"isOutOfStock\": false\n    }\n  ],\n  \"pageInfo\": {\n    \"currentPage\": 1,\n    \"totalPages\": 1,\n    \"totalRecords\": 2,\n    \"recordPerPage\": 20\n  }\n}\n```\n\n## 6. Get Product Reviews\n\n- **URL**: `/app/search/reviews/{productId}`\n- **Method**: `GET`\n- **Description**: Fetch reviews for a specific product by its ID. The response includes customer reviews for the specified product.\n\n### **Request Parameters**\n\n| Parameter   | Type     | Required | Description                                      |\n|-------------|----------|----------|--------------------------------------------------|\n| `productId` | `Long`   | Yes      | The ID of the product for which reviews are requested. |\n| `page`      | `int`    | Yes      | Page number for pagination  |\n\n### **Usage Example**\n\n#### Request\n```\nGET /app/search/reviews/101?page=1\n```\n\n#### Response\n```json\n{\n  \"data\": [\n    {\n      \"reviewId\": 1,\n      \"ratingStatus\": \"Excellent\",\n      \"description\": \"Amazing product!\",\n      \"rating\": 5,\n      \"customerName\": \"Pawan\",\n      \"customerCity\": \"Balod\"\n    },\n    \n    {\n      \"reviewId\": 2,\n      \"ratingStatus\": \"Good\",\n      \"description\": \"The product broke after a week of use.\",\n      \"rating\": 2,\n      \"customerName\": \"Pawan\",\n      \"customerCity\": \"Banglore\"\n    }\n   \n  ],\n  \"pageInfo\": {\n    \"currentPage\": 1,\n    \"totalPages\": 1,\n    \"totalRecords\": 2,\n    \"recordPerPage\": 20\n  }\n}\n```\n\n## 7. Get Product by ID\n\n- **URL**: `/app/search/product/{pId}`\n- **Method**: `GET`\n- **Description**: Fetch a product's details based on its unique ID.\n\n### **Request Parameters**\n\n| Parameter | Type     | Required | Description                                      |\n|-----------|----------|----------|--------------------------------------------------|\n| `pId`     | `Long`   | Yes      | The unique ID of the product to retrieve.        |\n\n### **Usage Example**\n\n#### Request\n```\nGET /app/search/product/101\n```\n\n#### Response\n```json\n{\n  \"pId\": 101,\n  \"productName\": \"Wireless Earbuds\",\n  \"productDescription\": \"Bluetooth 5.0, Noise-Canceling\",\n  \"price\": 2999,\n  \"rating\": 4.5,\n  \"image\": \"earbuds.jpg\",\n  \"stocks\": 50,\n  \"sold\": 150,\n  \"isOutOfStock\": false\n}\n```\n## 8. Forgot Password Request\n\n- **URL**: `/app/forgot-password`\n- **Method**: `POST`\n- **Description**: Initiates a password reset process by sending an OTP to the user's registered email address. The user will need this OTP to reset their password.\n\n### **Request Body**\n\n| Field   | Type     | Required | Description                                      |\n|---------|----------|----------|--------------------------------------------------|\n| `email` | `String` | Yes      | The email address associated with the user's account. |\n\n### **Usage Example**\n\n#### Request\n```\nPOST /app/forgot-password\n```\n\n**Request Body:**\n```json\n{\n  \"email\": \"user@example.com\"\n}\n```\n\n#### Response\n```json\n{\n  \"message\": \"OTP sent successfully to the provided email address.\"\n}\n```\n\n## 9. Reset Password Request\n\n- **URL**: `/app/reset-password`\n- **Method**: `POST`\n- **Description**: Resets the user's password using the provided OTP. The user must provide the email, the OTP received, and the new password.\n\n### **Request Body**\n\n| Field        | Type     | Required | Description                                                |\n|--------------|----------|----------|------------------------------------------------------------|\n| `email`      | `String` | Yes      | The email address associated with the user's account.      |\n| `otp`        | `String` | Yes      | The one-time password (OTP) sent to the user's email.      |\n| `newPassword`| `String` | Yes      | The new password the user wants to set for their account.  |\n\n### **Usage Example**\n\n#### Request\n```\nPOST /app/reset-password\n```\n\n**Request Body:**\n```json\n{\n  \"email\": \"user@example.com\",\n  \"otp\": \"123456\",\n  \"newPassword\": \"newSecurePassword123\"\n}\n```\n\n#### Response\n```json\n{\n  \"message\": \"Your password has been successfully reset\"\n}\n```\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawan8085%2Ffull-stack-ecommerce-application","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpawan8085%2Ffull-stack-ecommerce-application","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawan8085%2Ffull-stack-ecommerce-application/lists"}