Skip to content

This project is a full-stack e-commerce application, developed with a Java Spring Boot backend and a React.js frontend. The application provides a comprehensive platform for users to browse products, add items to their cart, and proceed to checkout.

Notifications You must be signed in to change notification settings

AlterSDB/SpringBoot-Reactjs-Ecommerce

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›οΈ Full Stack E-commerce Web Application

A full-stack E-commerce application using Spring Boot (Java) for the backend and ReactJS with Vite for the frontend. This application demonstrates the integration of RESTful APIs with a modern frontend stack, ideal for learning and demonstration purposes.


πŸ“ Project Structure

SpringBoot-Reactjs-Ecommerce-main/
β”œβ”€β”€ Ecommerce-Backend/       # Spring Boot REST API backend
β”œβ”€β”€ Ecommerce-Frontend/      # React + Vite frontend application

🧩 Backend - Spring Boot

πŸ”§ Technologies Used

  • Java 17+
  • Spring Boot
  • Spring Data JPA
  • MySQL (can be adapted)
  • Maven

πŸ“‚ Backend Directory Structure

Ecommerce-Backend/
β”œβ”€β”€ controller/      # REST endpoints
β”œβ”€β”€ model/           # JPA entity classes
β”œβ”€β”€ repo/            # Spring Data JPA interfaces
β”œβ”€β”€ service/         # Business logic
β”œβ”€β”€ resources/
β”‚   β”œβ”€β”€ application.properties
β”‚   └── data1.sql
└── pom.xml          # Maven build config

βš™οΈ Setup Instructions

  1. Database Setup:

    • Create a MySQL database, e.g., ecomdb.

    • Update application.properties:

      spring.datasource.url=jdbc:mysql://localhost:3306/ecomdb
      spring.datasource.username=root
      spring.datasource.password=yourpassword
      spring.jpa.hibernate.ddl-auto=update
  2. Run the App:

    cd Ecommerce-Backend
    mvn spring-boot:run
  3. Data Initialization:

    On first run, data1.sql inserts seed product data into your DB.

πŸ“‘ REST API Endpoints

Method Endpoint Description
GET /products Fetch all products
GET /products/{id} Get product by ID
POST /products Add new product
PUT /products/{id} Update product
DELETE /products/{id} Delete product

πŸ’» Frontend - React + Vite

πŸ”§ Technologies Used

  • ReactJS
  • Vite (bundler)
  • Axios (API calls)
  • Bootstrap (UI)
  • JavaScript (ES6+)

πŸ“‚ Frontend Directory Structure

Ecommerce-Frontend/
β”œβ”€β”€ public/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/      # Reusable components
β”‚   β”œβ”€β”€ pages/           # Page-level components
β”‚   β”œβ”€β”€ App.jsx          # App layout
β”‚   └── main.jsx         # Entry point
β”œβ”€β”€ package.json
└── vite.config.js

▢️ Getting Started

  1. Install dependencies:

    cd Ecommerce-Frontend
    npm install
  2. Run the app:

    npm run dev

    This will launch the frontend at http://localhost:5173.

  3. Connect to Backend:

    Update the backend URL in API service files (usually inside src/ or src/services/) if needed:

    axios.get('http://localhost:8080/products')

🧩 Features

  • Product List (from Spring Boot backend)
  • Dynamic rendering using React components
  • Fully responsive UI
  • Easy integration with further features (cart, checkout, login)

About

This project is a full-stack e-commerce application, developed with a Java Spring Boot backend and a React.js frontend. The application provides a comprehensive platform for users to browse products, add items to their cart, and proceed to checkout.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 63.4%
  • CSS 25.5%
  • Java 10.3%
  • HTML 0.8%