A Spring Boot backend project that handles the basic flow of an e-commerce application: users, products, cart management, order placement, payment status simulation, and order tracking.
This project is a backend-only e-commerce system built using Spring Boot, Spring Data JPA, Hibernate, and MySQL.
It allows users to add products to a cart, place orders, and track order/payment status through REST APIs.
User → Product → Cart → Order → Payment → Tracking
- 👤 User management
- 📦 Product management
- 🛒 Add products to cart
- ❌ Remove cart items
- 🧾 Place orders
- 🚚 Track order status
- 💳 Simulate payment status
- 🗄️ MySQL database integration
- 📩 DTO-based request handling
- 🧩 Service interface and implementation structure
- Java
- Spring Boot
- Spring Data JPA
- Hibernate
- MySQL
- Maven
- REST APIs
- Postman / Swagger
src/main/java/com.saish.ecommercebackend
│
├── controller
│ ├── CartController.java
│ ├── OrderController.java
│ ├── ProductController.java
│ └── UserController.java
│
├── dto
│ ├── CartRequest.java
│ ├── OrderStatusRequest.java
│ ├── ProductRequest.java
│ └── UserRequest.java
│
├── entity
│ ├── CartItem.java
│ ├── CustomerOrder.java
│ ├── OrderItem.java
│ ├── OrderStatus.java
│ ├── PaymentStatus.java
│ ├── Product.java
│ └── User.java
│
├── exception
│
├── repository
│ ├── CartItemRepository.java
│ ├── CustomerOrderRepository.java
│ ├── OrderItemRepository.java
│ ├── ProductRepository.java
│ └── UserRepository.java
│
├── service
│ ├── CartService.java
│ ├── OrderService.java
│ ├── ProductService.java
│ ├── UserService.java
│ └── impl
│ ├── CartServiceImpl.java
│ ├── OrderServiceImpl.java
│ ├── ProductServiceImpl.java
│ └── UserServiceImpl.java
│
└── EcommerceBackendApplication.java
👤 User
↓
📦 Product
↓
🛒 Cart Item
↓
🧾 Customer Order
↓
📋 Order Item
↓
💳 Payment Status / 🚚 Order Status
Controller → Service → Repository → Database
| Layer | Purpose |
|---|---|
| Controller | Handles API requests |
| DTO | Carries request data |
| Entity | Represents database tables |
| Repository | Talks to the database |
| Service | Contains business logic |
| Exception | Handles errors |
| Entity | Purpose |
|---|---|
User |
Stores customer details |
Product |
Stores product details |
CartItem |
Stores products added to cart |
CustomerOrder |
Stores placed orders |
OrderItem |
Stores products inside an order |
OrderStatus |
Tracks order progress |
PaymentStatus |
Tracks payment state |
- Add Spring Security and JWT
- Add admin/customer roles
- Add product categories
- Add search and filtering
- Add real payment gateway
- Add frontend integration
- Add unit tests