How naresh5021/docker-java-kubernetes-project works
Project type and purpose
• This is a microservices-based shopping demo written in Java.
• It consists of three independent services—productcatalogue, stockmanager, and shopfront—and is designed to illustrate deploying Java applications in Docker containers on Kubernetes.
• Each service is a standalone Java application (Dropwizard or Spring Boot style), packaged via Maven, containerized with Docker, and orchestrated via Kubernetes.
File structure
• Top-level directories:
– kubernetes: the deployment and service YAMLs for each microservice
– productcatalogue, stockmanager, shopfront: the three distinct microservices
• Each service folder contains:
– Dockerfile and pom.xml for container build and Java dependency management
– src/main/java/... with application entrypoint, configuration, resources (REST endpoints), models, services, repositories, etc.
– src/main/resources for configuration (application.properties or YAML) and templates (for shopfront’s HTML UI)
– src/test for unit and integration tests
• No monolithic “backend” or “frontend” directories; instead, separation is by service.
• Kubernetes directory holds three files—one per service—defining Deployments and Services.
Extract insights from README
• Purpose: Demonstrate Docker & Kubernetes on a shopping microservices project.
Main components and how they interact
a. Components
– Users (browser clients)
– shopfront service (Java web app serving UI + orchestrator)
– productcatalogue service (product data REST API)
– stockmanager service (stock data REST API)
– Docker registry (e.g., Docker Hub or private)
– Kubernetes cluster (nodes, kube-proxy, etcd, API server)
– (Optional) internal datastore or in-memory store per service
b. Relationships & interactions
– User’s browser → HTTP request → shopfront Service → Kubernetes Ingress or Service
– shopfront → REST call → productcatalogue Service → returns product details
– shopfront → REST call → stockmanager Service → returns stock levels
– shopfront aggregates data, renders UI back to user
– Each service is packaged as a Docker image and pulled by Kubernetes
c. Architectural patterns
– Microservices: each service is independent, with its own code, config, and lifecycle
– RESTful APIs for inter-service communication
– Containerization: Dockerfiles in each service directory
– Container orchestration: Kubernetes Deployments + Services in the kubernetes directory
d. Key technologies
– Java (Dropwizard or Spring Boot)
– Maven for builds (pom.xml)
– Docker for container images
– Kubernetes for deployment (YAML manifests)
– (Shopfront uses HTML templates; others expose JSON endpoints)
Detail without over-complication
• Microservice as its own module with its Dockerfile and codebase implied.
• Health check endpoint on productcatalogue (BasicHealthCheck) to illustrate internal monitoring.
• If desired, annotate that shopfront’s templates folder serves the index.html UI.
• Kubernetes YAML files alongside each service as the deployment configuration.