Skip to content

ShopEasy is a containerized e‑commerce boilerplate with an Angular SPA and Spring Boot API (JWT‑secure), backed by MySQL and Kafka, deployable via Docker Compose or Kubernetes.

License

Notifications You must be signed in to change notification settings

VictorMoni/ShopEasy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShopEasy

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.

📚 Table of Contents

  1. Overview
  2. Technologies Used
  3. Folder Structure
  4. Push Images to DockerHub
  5. Run with Docker Compose
  6. Run with Kubernetes
  7. Tests
  8. Final Considerations

💡 Overview

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

⚙️ Technologies Used

Backend

  • Java 21
  • Spring Boot 3.5.0
  • Spring Security
  • Spring Data JPA
  • Apache Kafka
  • MySQL
  • JUnit 5 and Mockito (tests)

Frontend

  • Angular 20
  • RxJS
  • Karma / Jasmine
  • JWT

Infrastructure

  • Docker
  • Docker Compose
  • Kubernetes (Minikube)
  • ELK Stack (Elasticsearch, Logstash, Kibana)

📂 Folder Structure

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

🐋 Push Images to DockerHub

Log in to Docker Hub

First, authenticate in the terminal:

docker login

Build the images

In the frontend directory:

docker build -t your-username/shopeasy-frontend:latest .

In the backend directory:

docker build -t your-username/shopeasy-backend:latest .

Push to Docker Hub

After logging in and building the images:

docker push your-username/shopeasy-frontend:latest
docker push your-username/shopeasy-backend:latest

🛠️ Run with Docker Compose

Clone the repository:

git clone https://github.com/victormoni/ShopEasy.git
cd ShopEasy

Run npm install in the frontend folder:

cd frontend
npm i

Start all services in detached mode and build:

docker compose up -d --build

Access the application:

Stopping the Containers

docker compose down

🚀 Run with Kubernetes

Open the project with VSCode as Administrator

Download VSCode and right-click to open it as administrator, then open the project folder.

VSCode Download

Start infrastructure

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 minikube tunnel

Run the minikube tunnel command in another terminal as administrator for the store to work, keep the tunnel open while using it.

minikube tunnel

Get the EXTERNAL-IP of the Ingress NGINX with the command below:

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:

http://192.168.49.2:5601


🔧 Tests

Backend

  • Backend tests with JUnit 5 + Mockito
  • Integration tests with H2 database
  • Using Jacoco for Code Coverage
mvn clean verify

Frontend:

  • 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)

About

ShopEasy is a containerized e‑commerce boilerplate with an Angular SPA and Spring Boot API (JWT‑secure), backed by MySQL and Kafka, deployable via Docker Compose or Kubernetes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published