This project is a modular, production-grade E-Commerce backend system built using Spring Boot microservices architecture. It supports secure user management, real-time inventory/order updates, asynchronous communication, and seamless third-party integrations.
- Backend Framework: Spring Boot
- Microservices: Product, Order, Inventory, Notification
- API Gateway: Custom Spring Cloud Gateway
- Authentication & Authorization: Keycloak (via Docker Compose)
- Databases:
- PostgreSQL (hosted on NeonDB)
- Message Broker: Apache Kafka (via Confluent Cloud)
- Communication:
- REST (synchronous)
- Kafka (asynchronous)
- Containerization: Docker (each service has its own Dockerfile)
- Deployment Target: Google Cloud Platform (Compute Engine, 2 VMs)
- Monitoring: Planned
- Circuit Breaker: Planned via Resilience4j
- CRUD for product catalog
- REST APIs
- PostgreSQL integration
- Manages order placement and tracking
- Sends Kafka events to Notification service
- Uses PostgreSQL (via NeonDB)
- Manages product inventory levels
- Consumes order events
- Decreases stock, updates product availability
- Uses PostgreSQL (via NeonDB)
- Listens to order events via Kafka
- Sends email/SMS notifications (placeholder logic)
- Stateless service
- Acts as a unified entry point for external clients
- Handles routing and forwarding
- Integrated with Keycloak for secured endpoints
- Keycloak manages user registration, login, and RBAC (Role-Based Access Control).
- Keycloak is containerized and run locally using Docker Compose.
Each service includes its own Dockerfile:
- Simple multi-stage builds
- Environment-specific variables injected at runtime
- Compatible with local Docker Desktop and cloud deployment
✅ Note: Database services are not containerized. PostgreSQL is hosted on NeonDB.
- Run all services using Docker Desktop
- Kafka handled via Confluent Cloud (no local Kafka setup needed)
- NeonDB used for PostgreSQL access
- 2 VMs on Google Compute Engine
- Docker images pulled or built directly on VMs
- LoadBalancer service for API Gateway
- Free-tier compliant setup
-
order-events- Published by Order Service
- Consumed by Inventory Service & Notification Service
-
inventory-updates(Optional)- Published by Inventory after stock update
Kafka is fully managed via Confluent Cloud, reducing ops overhead.
Use .env files or secure secrets management to inject:
# NeonDB URLs
ORDER_DB_URL=jdbc:postgresql://<order-neon-url>
INVENTORY_DB_URL=jdbc:postgresql://<inventory-neon-url>
# Kafka
KAFKA_BOOTSTRAP_SERVERS=<confluent-cloud-bootstrap>
KAFKA_API_KEY=...
KAFKA_API_SECRET=...
# Keycloak
KEYCLOAK_AUTH_URL=http://localhost:8085/realms/<realm>