How rachidatanassat/micro_service works
Project Type and Purpose
• This is TP2 from a series of Java EE micro-service exercises.
• It implements a small e-commerce backend: multiple Spring Boot microservices (customer, inventory, order, billing), a Spring Cloud Config server integrating with Consul & Vault, an API Gateway, plus an Angular frontend (“ecom-web-app1”).
Top-Level Structure
• TP2/
• config-service (Spring Cloud Config server, backed by Consul & Vault)
• gateway-service (Spring Cloud Gateway)
• customer-service (manages customers, JPA entities + REST)
• inventory-service (manages products, JPA + REST)
• order-service (manages orders, calls customer & inventory via RestClient)
• billing (demonstrates reading config from Consul & Vault via custom config classes)
• ecom-web-app1 (Angular single-page app)
Key Components
a. External Clients
• Browser/SPA (Angular app)
b. Edge/API Layer
• API Gateway (routes calls to backend services)
c. Configuration & Secret Management
• Spring Cloud Config Server (“config-service”)
• Consul (configuration registry)
• Vault (secret store)
d. Business Microservices
• Customer Service (REST + JPA → Customer DB)
• Inventory Service (REST + JPA → Product DB)
• Order Service (REST + JPA → Order DB; communicates with Customer + Inventory)
• Billing Service (consumes configuration from Consul & Vault; exposes its own endpoints)
e. Data Stores
• Each microservice has its own relational database (e.g., H2/Postgres)
f. Communication Patterns
• UI ↔ Gateway via HTTP/JSON
• Gateway ↔ each Microservice via HTTP/JSON
• Order Service ↔ Customer Service & Inventory Service via internal REST clients
• Microservices ↔ Config Server via Spring Cloud config protocol (HTTP)
• Config Server ↔ Consul & Vault
Relationships and Flows
• From Gateway to each microservice (customer, inventory, order, billing).
• From each microservice to “Config Server” (on startup and refresh).
• From each microservice to its own database.
Architectural Patterns and Principles
• Microservices (single responsibility per service, own database)
• API Gateway (central entry point, routing)
• Externalized Configuration (Config Service + Consul + Vault)
• Service-to-Service REST communication
• Separation of concerns (config vs. business logic)
Technologies & Frameworks
• Spring Boot, Spring Cloud Config, Spring Cloud Gateway, Spring Data JPA
• Consul (service/config registry), HashiCorp Vault (secrets)
• Angular CLI, TypeScript, RxJS, HTTPClient
• Maven build scripts, application-properties/YAML