Skip to content

Microservices demo architecture with Spring Boot, Go and Node.js service, API Gateway, Kafka, SAGA and CQRS patterns

Notifications You must be signed in to change notification settings

jessy-p/microservices-concepts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo E-commerce Order System

Microservices demo project.

Concepts illustrated in this repo

  • Event-Driven Architecture - Kafka messaging between services
  • SAGA Pattern - Distributed transaction management
  • API Gateway - Centralized routing and authentication
  • CQRS & Event Sourcing - Command/Query separation
  • JWT Authentication - Stateless security
  • Service Discovery - Dynamic service registration
  • Circuit Breakers - Resilience patterns
  • Domain-Driven Design - Clear service boundaries

Current Services

  • User Service (Spring Boot) - Authentication & user management
  • Order Service (Spring Boot) - Order creation & management
  • API Gateway (Spring Cloud Gateway) - Routing & JWT validation
  • Kafka - Event-driven messaging

Planned Services (To Do)

  • Payment Service (Go) - Stripe integration & payment processing
  • Notification Service (Node.js) - CQRS/Event Sourcing notifications

Getting Started

# Copy environment template
cp .env.example .env

# Start all services
docker-compose up -d

Endpoints:

API Examples

Register user:

curl -X POST http://localhost:8080/auth/register \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "password": "password123"}'

Login and get JWT:

curl -X POST http://localhost:8080/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "password": "password123"}'

Create order (replace YOUR_JWT_TOKEN):

curl -X POST http://localhost:8080/orders \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      {"productId": "widget-1", "quantity": 2},
      {"productId": "gadget-2", "quantity": 1}
    ]
  }'

About

Microservices demo architecture with Spring Boot, Go and Node.js service, API Gateway, Kafka, SAGA and CQRS patterns

Resources

Stars

Watchers

Forks

Contributors