Skip to content

HarshitVarshneyv/ECommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


πŸŽ‰ Full Stack E-commerce Search & Product Details πŸ›οΈ

This is Assessment Project is dedicated to SpendTech[A B2B product based company in Bangaluru] =>

Verdit : Selected and worked as the Associate developer

Welcome to the Full Stack E-commerce project! This is a full-featured web application for product search and product details with a backend API in Spring Boot and a frontend built using React. The project allows users to search for products, view detailed information about each product, and enjoy a seamless, responsive shopping experience.


πŸš€ Features

  • Product Search: Allows users to search for products by name or brand.
  • Product Details: Clicking a product displays detailed information.
  • Responsive UI: Optimized for desktop, tablet, and mobile.
  • Interactive API Documentation: Powered by Swagger UI.
  • Error Handling: Friendly error messages displayed on failures.

πŸ› οΈ Technologies Used

Backend (Spring Boot)

  • Spring Boot (REST API)
  • H2 (Database)
  • JPA/Hibernate (ORM)
  • Swagger/OpenAPI (API Documentation)
  • Flyway (Database Migrations)
  • Security (OAuth2, Authentication)

Frontend (React)

  • ReactJS
  • Axios for API requests
  • React Router for page navigation
  • TailwindCSS for styling
  • Toast Notifications for error handling

πŸ’» Project Structure

πŸ“¦ Full-Stack-Ecommerce-Project
 β”œβ”€β”€ πŸ“ client (React frontend)
 β”‚   β”œβ”€β”€ πŸ“ src
 β”‚   β”‚   β”œβ”€β”€ πŸ“„ App.js
 β”‚   β”‚   β”œβ”€β”€ πŸ“„ index.js
 β”‚   β”‚   β”œβ”€β”€ πŸ“ components
 β”‚   β”‚   β”œβ”€β”€ πŸ“ pages
 β”‚   β”‚   └── πŸ“ styles
 β”‚   β”œβ”€β”€ πŸ“„ package.json
 β”‚   └── πŸ“„ tailwind.config.js
 β”œβ”€β”€ πŸ“ server (Spring Boot backend)
 β”‚   β”œβ”€β”€ πŸ“ src
 β”‚   β”‚   β”œβ”€β”€ πŸ“ main
 β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ java
 β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ com
 β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ ecommerce
 β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ ProductController.java
 β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ ProductService.java
 β”‚   β”‚   β”‚   β”‚   β”‚   β”‚   └── πŸ“„ EcommerceApplication.java
 β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ resources
 β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ application.properties
 β”‚   β”‚   β”‚   β”‚   └── πŸ“„ data.sql
 β”‚   β”œβ”€β”€ πŸ“„ pom.xml
 └── πŸ“„ README.md

πŸƒ Getting Started

1. Clone the repository:

git clone https://github.com/your-username/full-stack-ecommerce-project.git
cd full-stack-ecommerce-project

2. Setting up Backend (Spring Boot)

Prerequisites:

  • JDK 17+
  • Maven

This will start the backend on http://localhost:8080.

API Documentation:

Once the backend is running, you can access the interactive Swagger UI for API documentation at:

http://localhost:8080/swagger-ui.html

3. Setting up Frontend (React)

Prerequisites:

  • Node.js (v16 or higher)

Steps:

  1. Navigate to the client directory.
  2. Install dependencies:
cd client
npm install
  1. Run the React development server:
npm start

This will start the frontend on http://localhost:3000.


πŸ“„ Endpoints

Backend API Endpoints

  • GET /products - Returns a list of all products.

    • Query Params: search (string)
  • GET /products/{id} - Returns details of a specific product.

    • Path Params: id (Product ID)

Example Request (Product Search):

GET http://localhost:8080/products?search=phone

βš™οΈ API Documentation

Access full API documentation at:


πŸ”§ Error Handling

  • Friendly error messages are displayed in case of API failures (e.g., no products found, invalid product ID).

πŸ“± Responsive Design

The project is built to work across all devices:

  • Mobile: User-friendly search and product display.
  • Tablet: Optimized grid layout.
  • Desktop: Clean, spacious design with product cards.

βœ… Acceptance Criteria

  1. Product Search: Returns partial matches for product name/brand.
  2. Product Details: Clicking a product navigates to a details page with full information.
  3. Pre-loaded Products: At least 20 products pre-loaded for testing.
  4. API Error Handling: Friendly error messages for failed requests.
  5. Responsive UI: Fully responsive across mobile, tablet, and desktop.
  6. API Documentation: Accessible Swagger UI for easy API testing.
  7. Clean Code & Structure: Well-organized code and modular components.

πŸ§‘β€πŸ€β€πŸ§‘ Contributing

We welcome contributions! If you'd like to help make this project better, feel free to fork the repo, make changes, and create a pull request.


πŸ“ License

Make this repo as Your Star to save it ...


🌟 Acknowledgements

  • React: A JavaScript library for building user interfaces.
  • Spring Boot: A Java framework for building backend applications.
  • TailwindCSS: A utility-first CSS framework for fast UI development.
  • Swagger/OpenAPI: Documentation tool for RESTful APIs.

πŸ“œ Contact

Feel free to reach out via:


Icons used:


Enjoy building your Full Stack E-commerce project!

Releases

No releases published

Packages

No packages published