Skip to main content

Bookstore Microservices

This repository implements a bookstore platform as a set of Spring Boot microservices behind a Spring Cloud Gateway, plus a React + Vite frontend. The project supports local development with Docker Compose and production-style deployment on AWS EKS using GitOps (Argo CD).

Architecture at a glance​

Services​

ServicePort (local)Responsibility
API Gateway8080Single HTTP entry point; routes /auth/**, /api/**, /analytics/** to backend services; CORS
Auth Service8081Registration, login, JWT access tokens, refresh-token sessions
User Service8082User profile CRUD; internal profile creation via API key
Book Service8083Catalog (books, authors, categories, publishers); S3 book cover upload
Order Service8084Order queries and cancellation; builds orders from Kafka payment-success events
Payment Service8087Stripe PaymentIntent checkout, webhooks, payment state
Notification Service8085Email and SMS on order-created (Kafka consumer only — no HTTP API)
Analytics Service8088Admin dashboards fed from Kafka events
Frontend5173 dev / 80 prodReact SPA: catalog, cart, checkout, admin analytics

Repository layout​

auth-service/
user-service/
book-service/
order-service/
payment-service/
notification-service/
analytics-service/
api-gateway/
frontend/
docker/
docker-compose.yml
.github/workflows/ci-workflow.yml
bookstore-docs/

Production Kubernetes manifests, Terraform, and Argo CD applications live in the separate bookstore-infra repository.

Key platform capabilities​

  • User registration and login with JWT + refresh tokens
  • JWT-protected customer and admin routes
  • Catalog CRUD for books, authors, categories, and publishers
  • Book cover upload to Amazon S3 (production)
  • Cart and checkout flow in the frontend
  • Stripe payment intent creation and webhook handling
  • Order creation from payment success events via Kafka
  • Notification fan-out (email + SMS) from order events
  • Admin analytics views backed by Kafka-fed aggregates
  • Docker-based local full-stack environment
  • CI/CD: GitHub Actions → Amazon ECR → GitOps manifest update → Argo CD sync

Technology stack​

Backend​

  • Java 17
  • Spring Boot 4.x
  • Spring Security
  • Spring Data JPA
  • Spring Cloud OpenFeign
  • Spring Cloud Gateway (WebFlux)
  • Spring Kafka
  • MySQL
  • JWT via io.jsonwebtoken
  • Stripe Java SDK
  • AWS SDK (S3) in book-service
  • Micrometer + Spring Actuator (Prometheus metrics on most services)

Frontend​

  • React 19
  • TypeScript 6
  • Vite 8
  • React Router DOM 7
  • Recharts
  • @stripe/react-stripe-js

Infrastructure (bookstore-infra)​

  • Amazon EKS, ECR, RDS (MySQL), S3, IAM, VPC
  • Kubernetes manifests in k8s/
  • Argo CD with automated sync
  • Prometheus, Grafana, Alertmanager in monitoring namespace
  • Terraform modules for VPC, EKS, RDS, ECR, S3, GitHub OIDC

Messaging​

Local and production environments use Apache Kafka 3.9.1 in KRaft mode (no Zookeeper).

TopicProducerConsumers
payment-successpayment-serviceorder-service
payment-failedpayment-serviceanalytics-service
order-createdorder-servicenotification-service, analytics-service

:::warning Known implementation gap payment-service publishes payment-success, while analytics-service also listens for payment-completed (no producer exists for that topic). Successful payment analytics will not be ingested until the topic names are aligned. :::

Deployment modes​

ModeWhere configuredPurpose
Localdocker-compose.yml in this repoDeveloper full-stack on localhost
Productionbookstore-infra repo (k8s/, Terraform)AWS EKS cluster with Argo CD GitOps

See Deployment Overview and AWS Architecture Overview for the production pipeline.