Skip to content

Microservices Overview

tien.nguyen edited this page Jul 30, 2026 · 1 revision

Microservices Overview

The Emporia Trading Platform is decomposed into 9 autonomous microservices plus a shared contracts library and a modern React trading frontend.


๐Ÿ“ฆ Service Architecture & Descriptions

1. authorisation-service (Port: 9000)

  • Technology: Spring Boot 4.0.7, Spring Security OAuth2 / OIDC Server, PostgreSQL (emporia_authorisation).
  • Function: Handles user identity authentication, token issuance (JWT / OIDC with PKCE), user registrations, client credential management, and role-based permissions (ROLE_TRADER, ROLE_ADMIN).

2. gateway (Port: 8082)

  • Technology: Spring Cloud Gateway, Reactive Netty stack.
  • Function: Unified entry point for client applications. Handles OAuth2 token verification, route forwarding, CORS headers, and path filtering (/api/static/**, /api/orders/**, etc.).

3. static-data-service (Port: 8081)

  • Technology: Spring Boot 4.0.7, Spring Data JPA, PostgreSQL (emporia_static_data).
  • Function: Manages instruments, exchange listing details, tick sizes, lot sizes, trading hours, and symbol metadata. Serves snapshot endpoints consumed by Order Command, Market Data, and Execution services.

4. user-preferences-service (Port: 8083)

  • Technology: Spring Boot 4.0.7, Spring Data JPA, PostgreSQL (emporia_client_config).
  • Function: Stores personalized user settings, watchlists, workspace layouts, chart configurations, and UI notification preferences.

5. market-data-service (HTTP Port: 8084, gRPC Port: 50551)

  • Technology: Spring Boot 4.0.7, gRPC, Protobuf, Server-Sent Events (SSE).
  • Function: Aggregates level-1 and level-2 quotes from external FIX protocol simulators and Alpaca IEX feeds. Distributes realtime tick data over HTTP SSE streams and gRPC channels.

6. order-command-service (Port: 8085)

  • Technology: Spring Boot 4.0.7, Spring Kafka, RestClient.
  • Function: Validates inbound trade commands (CREATE, MODIFY, CANCEL) against static data listings, generates unique correlation IDs, and produces commands onto emporia.order.commands.v1 Kafka topic.

7. order-management-service (Port: 8086)

  • Technology: Spring Boot 4.0.7, Spring Data JPA, PostgreSQL (emporia_order_data), Spring Kafka.
  • Function: Core state machine for trading orders. Persists TradingOrder lifecycle state, consumes execution fills, handles race conditions between cancels and fills, and publishes immutable order events to emporia.orders.v1.

8. execution-service (Port: 8087)

  • Technology: Spring Boot 4.0.7, Spring Kafka, LMAX Disruptor (exchange-core integration).
  • Function: Order routing engine. Evaluates order execution strategies (SMART, VWAP, DIRECT) and routes order slices to exchange matching engines or simulated venues.

9. portfolio-service (Port: 8088)

  • Technology: Spring Boot 4.0.7, Spring Data JPA, PostgreSQL (emporia_portfolio).
  • Function: Consumes execution events to track real-time positions, realized/unrealized P&L, account cash balances, and margin requirements.

๐Ÿ“š Supporting Modules

trading-contracts

  • Type: Shared Java Library & Protocol Buffers Specification.
  • Function: Defines core domain events (OrderCreated, OrderFilled, OrderCancelled), Kafka command payloads, and gRPC Protobuf definitions. Shared across all backend Java microservices.

frontend (Port: 3001)

  • Technology: React 19, TypeScript, Vite, TailwindCSS / Custom CSS design system.
  • Function: Real-time trading UI containing order book depth widgets, interactive charts, order entry forms, execution history, and portfolio position tables.

Clone this wiki locally