A full-stack e-commerce application built with Spring Boot, PostgreSQL, Kafka, and a Vanilla JS/HTML Frontend. This project demonstrates a complete microservices-ready architecture with event-driven processing.
- User Authentication: JWT-based registration and login with role-based access control (Admin/User).
- Product Management: CRUD operations for products and categories (Admin only).
- Shopping Cart: Persistent shopping cart functionality.
- Order Processing: Seamless checkout flow with Kafka integration for asynchronous event processing.
- Event-Driven Architecture: Uses Kafka for decoupling order creation from inventory updates and notifications.
- Database Persistence: Full data persistence using PostgreSQL and Hibernate/JPA.
- Interactive UI: Beautiful, responsive frontend built with HTML5, CSS3, and Vanilla JavaScript.
- Backend: Java 17, Spring Boot 4.0.0
- Database: PostgreSQL 15 (Dockerized)
- Messaging: Apache Kafka & Zookeeper (Dockerized)
- Frontend: HTML5, CSS3, Vanilla JavaScript
- Build Tool: Maven
- Containerization: Docker Compose
- Docker & Docker Compose
- Java 17 SDK
- Maven (Wrapper included)
Start PostgreSQL, Kafka, and Zookeeper using Docker Compose:
docker-compose up -dWait a few seconds for the services to initialize.
Navigate to the backend directory and start the Spring Boot application:
cd backend
./mvnw spring-boot:runThe backend will start on http://localhost:8080.
Open the frontend/index.html file in your browser:
open frontend/index.htmlRun the included script to test the entire flow (Registration -> Product Creation -> Cart -> Checkout):
./e2e-test.shVerify the Kafka integration specifically:
./test-checkout.shSwagger UI is available at:
http://localhost:8080/swagger-ui.html
- SecurityConfig: Configured for JWT auth and CORS (allowing file:// access for local frontend).
- KafkaConfig: Custom producer/consumer factories for reliable message delivery.
- GlobalExceptionHandler: Centralized error handling for clean API responses.
- JPA Auditing: Automatic
createdAtandupdatedAttimestamp management.
This project is licensed under the MIT License.
