DevOps and testing

Containers, CI/CD, monitoring, and quality gates

Ship with Docker, Docker Compose, Kubernetes readiness, GitHub Actions, Micrometer Prometheus metrics, Grafana, unit tests, integration tests, controller tests, repository tests, and security tests.

Docker Compose

services:
  api:
    build: .
    ports: ["8080:8080"]
    environment:
      SPRING_PROFILES_ACTIVE: dev
      DB_HOST: postgres
      REDIS_HOST: redis
      RABBITMQ_HOST: rabbitmq
      MINIO_ENDPOINT: http://minio:9000
    depends_on: [postgres, redis, rabbitmq, minio]
  postgres:
    image: postgres:16-alpine
    environment: { POSTGRES_DB: fooddelivery, POSTGRES_USER: fooddelivery, POSTGRES_PASSWORD: fooddelivery }
    ports: ["5432:5432"]
  redis: { image: redis:7-alpine, ports: ["6379:6379"] }
  rabbitmq: { image: rabbitmq:3-management-alpine, ports: ["5672:5672", "15672:15672"] }
  minio:
    image: minio/minio:latest
    command: server /data --console-address ":9001"
    ports: ["9000:9000", "9001:9001"]

Kubernetes deployment

apiVersion: apps/v1
kind: Deployment
metadata: { name: fooddelivery-api }
spec:
  replicas: 3
  selector: { matchLabels: { app: fooddelivery-api } }
  template:
    metadata: { labels: { app: fooddelivery-api } }
    spec:
      containers:
        - name: api
          image: ghcr.io/company/fooddelivery-api:latest
          ports: [{ containerPort: 8080 }]
          readinessProbe: { httpGet: { path: /actuator/health/readiness, port: 8080 } }
          livenessProbe: { httpGet: { path: /actuator/health/liveness, port: 8080 } }
---
apiVersion: v1
kind: Service
metadata: { name: fooddelivery-api }
spec: { selector: { app: fooddelivery-api }, ports: [{ port: 80, targetPort: 8080 }] }

GitHub Actions CI/CD

name: fooddelivery-ci
on: [push, pull_request]
jobs:
  build-test-package:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-java@v4
        with: { distribution: temurin, java-version: "21" }
      - run: mvn -B clean verify
      - run: docker build -t ghcr.io/company/fooddelivery-api:latest .

Order sequence diagram

sequenceDiagram
participant C as Customer App
participant A as Auth Controller
participant O as Order Controller
participant S as Order Service
participant P as Payment Strategy
participant R as Restaurant App
participant D as Driver App
participant M as RabbitMQ
C->>A: POST /api/v1/auth/login
A-->>C: accessToken + refreshToken
C->>O: POST /api/v1/orders
O->>S: createOrder(command)
S->>P: authorize payment
P-->>S: verified payment
S->>M: publish OrderCreatedEvent
M-->>R: notify restaurant
R->>O: PATCH /orders/{id}/status ACCEPTED
S->>M: publish ReadyForDeliveryEvent
M-->>D: nearby delivery offer
D->>O: POST /deliveries/{id}/accept
O-->>C: tracking status updates

Testing matrix

Unit tests with JUnit 5 and Mockito

Repository tests with Testcontainers PostgreSQL

Controller tests with MockMvc and validation failures

Security tests for JWT, RBAC, and rate limits

Integration tests for order-payment-delivery workflows

Built for enterprise backend planning with Spring Boot 3, PostgreSQL, Redis, RabbitMQ, MinIO, Docker, Kubernetes, and observability.
Built with GenMB
Built with GenMB