Microservice Pet Clinic

A fully distributed, cloud-native application demonstrating the power of microservices architecture using Java, Golang, Node.js, and Python.

Features

Microservices Architecture

Independently deployed services that work together to create a robust system.

Service Discovery

Eureka / Consul for dynamic service registration and discovery.

API Gateway

Kong / Traefik for centralized request handling and routing.

Configuration Management

Spring Cloud Config / HashiCorp Vault for centralized configuration.

Asynchronous Messaging

Kafka / RabbitMQ for event-driven architecture and communication.

Authentication & Authorization

Keycloak with OAuth2 & JWT for secure identity management.

Monitoring & Tracing

Prometheus, Grafana, Zipkin / Jaeger for observability.

Centralized Logging

ELK Stack (Elasticsearch, Logstash, Kibana) for log management.

CI/CD Pipeline

GitHub Actions, Jenkins, Kubernetes, Helm for continuous delivery.

Containerization & Orchestration

Docker, Kubernetes, Helm, ArgoCD for deployment and management.

Architecture

+------------------------------------------------+ | API Gateway (Kong) | | - Handles Routing, Authentication (JWT) | | - Rate Limiting, Load Balancing | +--------------------+---------------------------+ | +---------------------+--------------+-----------------------+ | | | v v v +------------+ +----------------+ +------------------+ | Service Reg|<--> | Config Server | | Monitoring & Logs| | Discovery | | (Spring Config)| | Prometheus + ELK | | Eureka/Consul| | HashiCorp Vault| | Zipkin / Jaeger | +------------+ +----------------+ +------------------+ | | | | v | | +------------------+ | | | Auth Service | <-----> Keycloak | | | (Java + Spring) | (OAuth2 + JWT) | | +------------------+ | | | | +----------------+ +----------------+ +------------------+ +----------------+ | Pet Service |<--> | Owner Service |<-> | Visit Service |<->| Billing Service | | Golang + Gin | | Python + FastAPI| | Java + Spring | | Golang + Fiber | +----------------+ +----------------+ +------------------+ +----------------+ | | | | v | | +-------------------+ | | | Event Bus (Kafka) | | | | Async Messaging | | | +-------------------+ | | | | | v | | +----------------------+ | | | Notification Service | | | | (Python + Celery) | | | +----------------------+ | | | +--------------------------------------------------------------+ | +--------------------------------------------------+ | CI/CD: GitHub Actions + Jenkins + Kubernetes | | Docker, Helm, ArgoCD for Automated Deployment | +--------------------------------------------------+

Repository Structure

microservice-pet-clinic/
│── api-gateway/       → Kong / Traefik
│── service-registry/  → Eureka / Consul
│── config-server/     → Spring Cloud Config
│── services/
│   ├── auth-service/      → Java (Spring Boot)
│   ├── pet-service/       → Golang (Gin)
│   ├── owner-service/     → Python (FastAPI)
│   ├── vet-service/       → Node.js (Express)
│   ├── visit-service/     → Java (Spring Boot)
│   ├── billing-service/   → Golang (Fiber)
│   ├── notification-service/ → Python (Celery)
│── event-streaming/ → Kafka / RabbitMQ
│── monitoring/      → Prometheus + Grafana
│── tracing/         → Zipkin / Jaeger
│── logging/         → ELK Stack (Elasticsearch, Logstash, Kibana)
│── k8s/            → Kubernetes manifests
│── ci-cd/          → GitHub Actions / Jenkins pipelines
│── README.md

Getting Started

Prerequisites

  • Docker & Docker Compose
  • Kubernetes & Helm
  • Java 17, Golang, Node.js, Python
  • PostgreSQL / MongoDB
  • Kafka / RabbitMQ

Running Services Locally

With Docker Compose

docker-compose up -d

With Kubernetes

kubectl apply -f k8s/

API Endpoints

Service Endpoint Method
Auth Service /auth/login POST
Pet Service /pets GET, POST
Owner Service /owners GET, POST
Vet Service /vets GET, POST
Visit Service /visits GET, POST
Billing Service /billing POST

CI/CD Pipeline

  1. GitHub Actions - Code build & testing
  2. Jenkins - Continuous Integration
  3. ArgoCD - Kubernetes GitOps deployment
  4. Helm - Kubernetes package manager

Monitoring & Logging

Component Purpose
Zipkin / Jaeger Distributed Tracing
Prometheus + Grafana Metrics & Alerts
ELK Stack Centralized Logging

Contributing

Feel free to contribute to this project! Open an issue or create a pull request on our GitHub repository.

Open an Issue

License

MIT License - Feel free to use and modify this project.