A full-stack e-commerce platform built with Spring Boot for learning and practice purposes. This project demonstrates modern web development practices including backend REST APIs, frontend interactivity, and database management.
Live Demo: https://springboot-ecommerce-jjun.onrender.com/
- Features
- Tech Stack
- Project Structure
- Prerequisites
- Installation & Setup
- Running the Application
- API Endpoints
- Contributing
- License
- User authentication and registration
- Product catalog and filtering
- Shopping cart functionality
- Order management
- Responsive UI design
- Admin dashboard for product management
- Secure payment integration
- Order history tracking
| Layer | Technology |
|---|---|
| Backend | Java, Spring Boot, Spring Security, JPA/Hibernate |
| Frontend | HTML5, CSS3, JavaScript |
| Database | MySQL/PostgreSQL |
| Deployment | Docker, Render |
| Build Tool | Maven/Gradle |
springboot-ecommerce/
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/ecommerce/
│ │ │ ├── controller/ # REST API endpoints
│ │ │ ├── service/ # Business logic
│ │ │ ├── model/ # Entity classes
│ │ │ └── repository/ # Database access
│ │ └── resources/
│ │ ├── templates/ # HTML templates
│ │ ├── static/ # CSS, JavaScript assets
│ │ └── application.yml # Configuration
│ └── test/
├── Dockerfile # Container configuration
├── pom.xml # Maven dependencies
└── README.md
- Java JDK 11 or higher
- Maven 3.6+ or Gradle 6+
- MySQL 8.0+ or PostgreSQL 12+
- Git
- Docker (optional, for containerization)
git clone https://github.com/hamza-vuiyan/springboot-ecommerce.git
cd springboot-ecommerceUpdate src/main/resources/application.yml:
spring:
datasource:
url: jdbc:mysql://localhost:3306/ecommerce
username: root
password: your_password
jpa:
hibernate:
ddl-auto: updatemvn clean installmvn spring-boot:runThe application will start at http://localhost:8080
docker build -t springboot-ecommerce .
docker run -p 8080:8080 springboot-ecommerceGET /api/products- List all productsGET /api/products/{id}- Get product detailsPOST /api/products- Create product (Admin)PUT /api/products/{id}- Update product (Admin)DELETE /api/products/{id}- Delete product (Admin)
GET /api/orders- Get user's ordersPOST /api/orders- Create new orderGET /api/orders/{id}- Get order details
POST /api/auth/register- Register new userPOST /api/auth/login- User loginPOST /api/auth/logout- User logout
This project is perfect for learning how a typical online store works. For instance, when a customer browses products, the frontend sends requests to the Java backend, which queries the database for available items and returns them. When they add items to the cart and checkout, the system processes the order and stores it in the database—just like real e-commerce platforms like Amazon or eBay do.
Contributions are welcome! Feel free to:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For issues, questions, or suggestions, please open an issue on GitHub.
Happy coding! 🎉