Project Name: E-commerce Platform
Project Description:
A robust and scalable e-commerce platform built with Spring Boot. This system enables users to browse products, manage their shopping cart, and complete secure purchases. It includes an admin panel for managing products, orders, and users. Designed with modern best practices, this project is ideal for businesses looking to establish or expand their online presence.
- User Authentication & Authorization – Secure user registration, login, and role-based access with JWT.
- Email Verification – Send email verification links using JavaMailSender.
- Product Management – Admins can add, update, and delete products.
- Shopping Cart – Users can manage their cart and checkout securely.
- Order Processing – Integrated with Stripe/PayPal for payments.
- Email Notifications – Automated emails for registration and order updates.
- RESTful API – Well-documented API for frontend and third-party integrations.
- Testing – Unit and integration tests using JUnit 5 and Mockito.
Languages:
- Java
Frameworks & Libraries:
- Spring Boot, Spring Security, Spring Data JPA, Hibernate, JavaMailSender
Database & Storage:
- MySQL (for production), H2 Database (for testing)
📂 src
├── 📂 main
│ ├── 📂 java
│ │ ├── 📂 com.example.Ecommerce
│ │ ├── 📂 aspect
│ │ ├── 📂 config
│ │ ├── 📂 constants
│ │ ├── 📂 controller
│ │ ├── 📂 enums
│ │ ├── 📂 exceptions
│ │ ├── 📂 factory
│ │ ├── 📂 mapper
│ │ ├── 📂 model
│ │ ├── 📂 repository
│ │ ├── 📂 request
│ │ ├── 📂 response
│ │ ├── 📂 scheduler
│ │ ├── 📂 security
│ │ ├── 📂 service
│ │ ├── 📂 util
│ │ ├── 📂 validator
│ │ ├── 📄 DemoApplication.java
│ │ ├── 📄 DummyObjects.java
│ ├── 📂 resources
│ ├── 📂 test
├── 📂 target
├── 📄 .gitattributes
- Java Development Kit (JDK) 11+
- Maven
- MySQL
- SMTP Server (for email notifications)
git clone https://github.com/ELglaly/Ecommerce-SpringBoot.git
cd Ecommerce-SpringBootspring.datasource.url=jdbc:mysql://localhost:3306/ecommerce_db
spring.datasource.username=your_username
spring.datasource.password=your_passwordspring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.username=your_email@gmail.com
spring.mail.password=your_email_password
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=truemvn clean install
mvn spring-boot:runAll API endpoints require authentication via a Bearer token.
Description: Registers a new user.
- Request Body:
{ "username": "string", "password": "string", "email": "string" } - Response:
{ "data": { "user details" }, "message": "User created successfully" }
Description: Logs in a user and returns an authentication token.
- Request Body:
{ "username": "string", "password": "string" } - Response:
{ "data": "JWT Token", "message": "Login successful" }
Description: Login with Google.
- Response:
{ "data": "Login with Google", "message": "Success" }
Description: Create a new product.
- Request Body:
{ "name": "Product Name", "price": 100.0, "category": "Category" } - Response:
{ "data": { "product details" }, "message": "Product created successfully" }
Description: Get product by ID.
- Response:
{ "data": { "product details" }, "message": "Product found" }
Description: Get all products.
- Response:
{ "data": [ { "product details" } ], "message": "Products retrieved successfully" }
Description: Update a product.
- Request Body:
{ "name": "Updated Product Name", "price": 150.0, "category": "Updated Category" } - Response:
{ "data": { "updated product details" }, "message": "Product updated successfully" }
Description: Delete a product.
- Response:
{ "data": true, "message": "Product deleted successfully" }
Description: Place an order by cart ID.
- Response:
{ "data": { "order details" }, "message": "Order created successfully" }
Description: Place an order by product.
- Request Body:
{ "productId": 1, "quantity": 2 } - Response:
{ "data": { "order details" }, "message": "Order created successfully" }
Description: Get order by ID.
- Response:
{ "data": { "order details" }, "message": "Order retrieved successfully" }
Description: Get all orders.
- Response:
{ "data": [ { "order details" } ], "message": "Orders retrieved successfully" }
Description: Get cart by ID.
- Response:
{ "data": { "cart details" }, "message": "Cart retrieved successfully" }
Description: Add product to cart.
- Request Params:
productId: Longquantity: int
- Response:
{ "data": { "cart details" }, "message": "Product added to cart successfully" }
Description: Remove item from cart.
- Response:
{ "data": null, "message": "Item removed successfully" }
- 400: Bad Request (Invalid input)
- 401: Unauthorized (Invalid credentials)
- 403: Forbidden (Admin only access)
- 404: Not Found (Resource does not exist)
- 500: Internal Server Error
Run all tests:
mvn test