This repository contains a simple E-commerce Application, composed of:
- Frontend: SPA in Angular 20, packaged and served by NGINX.
- Backend: RESTful API in Spring Boot 3.5.0 (Java 21).
- Database: MySQL 8.0.
- Messaging: Apache Kafka for order events.
- Infrastructure: Docker Compose for local orchestration and Kubernetes (K8s) for deployment in cloud or local clusters.
- Overview
- Technologies Used
- Folder Structure
- Push Images to DockerHub
- Run with Docker Compose
- Run with Kubernetes
- Tests
- Final Considerations
The project aims to provide a complete foundation for an e-commerce system with:
- JWT Authentication
- CRUD for users, products, and orders
- Kafka events for order processing
- Observability via Spring Actuator
- Local deployment with Docker Compose or in cluster with Kubernetes
- Java 21
- Spring Boot 3.5.0
- Spring Security
- Spring Data JPA
- Apache Kafka
- MySQL
- JUnit 5 and Mockito (tests)
- Angular 20
- RxJS
- Karma / Jasmine
- JWT
- Docker
- Docker Compose
- Kubernetes (Minikube)
- ELK Stack (Elasticsearch, Logstash, Kibana)
ShopEasy/
├── backend/
| |── src/
│ ├── pom.xml
│ └── Dockerfile
├── elk # Logstash configuration
├── frontend/
| ├── src/
│ ├── package.json
│ └── Dockerfile
├── k8s/
├── .gitignore
├── docker-compose.yml # Kubernetes manifests
├── LICENSE # MIT LICENSE
├── minikube.sh # Script to run minikube
└── README.md
First, authenticate in the terminal:
docker login
In the frontend directory:
docker build -t your-username/shopeasy-frontend:latest .
In the backend directory:
docker build -t your-username/shopeasy-backend:latest .
After logging in and building the images:
docker push your-username/shopeasy-frontend:latest
docker push your-username/shopeasy-backend:latest
git clone https://github.com/victormoni/ShopEasy.git
cd ShopEasy
cd frontend
npm i
docker compose up -d --build
- Frontend: http://localhost
- Actuator: http://localhost:8080/actuator
- Swagger: http://localhost:8080/swagger-ui/index.html
- Kafka UI: http://localhost:8085/
- Kibana: http://localhost:5601/
- H2 Database: http://localhost:8080/h2-console
- MySQL: localhost:3306
docker compose down
Download VSCode and right-click to open it as administrator, then open the project folder.
Run the minikube.sh script selecting the type of driver you want to use (HyperV or Docker):
./minikube.sh hyperv
or
./minikube.sh docker
Run the minikube tunnel command in another terminal as administrator for the store to work, keep the tunnel open while using it.
minikube tunnel
kubectl get svc -n ingress-nginx
echo "NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE"
echo "ingress-nginx-controller LoadBalancer 10.109.168.86 192.168.49.2 80:31945/TCP,443:31383/TCP 5m"
Then access in the browser: http://EXTERNAL-IP/"
Take the EXTERNAL-IP from the previous command and replace "localhost" in the URLs you want to use, remember that depending on the URL you may need to include the port:
- Example:
- Backend tests with JUnit 5 + Mockito
- Integration tests with H2 database
- Using Jacoco for Code Coverage
mvn clean verify
- Frontend tests with Karma + Jasmine
ng test
Thank you for using ShopEasy! If you have any questions or suggestions, open an issue or submit a Pull Request.
Author: Victor Moni
License: MIT License (see the LICENSE file for more details)