How microcosmx/workspace_microservices works
Project type and purpose
• This is a large‐scale, containerized ticket‐seller application built with 40+ microservices.
• Each microservice implements a distinct business domain (e.g., user, order, payment, route, travel, contacts, assurance, etc.) and is written in various stacks (Java/Spring Boot, NodeJS/Express, Python/Django, Go/Webgo).
• The application is assembled and deployed via Docker Compose, Docker Swarm, and even Kubernetes YAML manifests.
File structure
• Top‐level directories:
• “ts-*-service” (40+ microservices)
• ts-ui-dashboard (Angular/HTML/CSS/JS frontend)
• ts-ui-test (integration tests)
• 1-services-analysis, kubernetes-services (tracing analysis and K8s YAML examples)
• docker-compose.yml + docker-compose-swarm.yml (orchestration)
• ts-service-*.yml (Swarm/K8s stack definitions)
• ms-monitoring-core (shared tracing instrumentation library)
• Each microservice has:
• Dockerfile + pom.xml or respective language manifest
• src/main/java (or equivalent)
• application.yml (Spring Cloud config)
• Supporting infrastructure:
• Config Service (ts-config-service)
• Discovery/eureka (implied by Spring Cloud usage)
• Messaging/async queue (in inside-payment, rest-service-6)
• Monitoring/tracing (ms-monitoring-core instrumentation, Portainer UI)
README for additional insights
• Core tech: Java + Spring Boot/Cloud, NodeJS, Python, Go
• Local vs. cluster runtime instructions (docker-compose vs. Docker Swarm/Kubernetes)
• Fault‐injection branches to simulate failure modes
a. Main components
1. API Layer (UI + optional API Gateway)
• ts-ui-dashboard container
• (ts-ui-test as automated client)
2. Service Discovery & Configuration
• ts-config-service (Spring Cloud Config Server)
• Eureka/Consul (Spring Cloud Discovery, not explicit in tree but standard)
3. Business Microservices
• By domain (user, order, payment, route, travel, contacts, etc.)
• Each microservice container registers with Discovery & pulls config
4. Messaging Infrastructure
• RabbitMQ or other broker for async flows (used by inside-payment, rest-service-6)
5. Data Stores
• Separate database per service (PostgreSQL / MySQL containers)
• ts-voucher-service uses SQLite or file‐based DB (db.sql)
6. Monitoring & Tracing
• Zipkin/Jaeger (instrumented by ms-monitoring-core)
• Portainer UI for Docker management
b. Component Interactions
• UI → calls microservices over REST
• Microservices → retrieve configuration from Config Server
• Microservices → register/discover peers via Discovery Server
• Inter‐service calls (order → payment → notification)
• Async flows (inside-payment → message broker → notification)
• Each service persists to its own database
• Tracing data flows to Zipkin/Jaeger via ms-monitoring-core
c. Architectural patterns & principles
• Microservices per bounded context
• Twelve‐factor apps: externalized config, logs
• Service registry and discovery (Spring Cloud)
• API composition by the UI (no monolithic gateway shown)
• Polyglot services containerized with Docker
• Orchestration layers: Docker Compose for local, Swarm or Kubernetes for cluster
• Distributed tracing and centralized configuration
d. Technologies, frameworks, libraries
• Java/Spring Boot, Spring Cloud Config, Discovery
• NodeJS/Express, Python/Django, Go/Webgo
• Docker, Docker Compose, Docker Swarm, Kubernetes YAML
• RabbitMQ (or JMS), asynchronous queues
• Zipkin/Jaeger (ms-monitoring-core)
• Portainer for monitoring containers