Skip to main content

Architecture (State 005 PostgreSQL Database Replacement)

State 005 replaces H2 database runtime with PostgreSQL while preserving state 004 containerized ingress topology and baseline flows.

  • Inherits architectural baseline from: 004-containerized-compose-runtime
  • Generated from: system/architecture.model.json
  • Canonical flows: ../001-baseline-uncontainerized-parity/system/end-to-end-flows.md

Entry Points​

  • ingress: http://localhost:8080
  • postgres: postgres://localhost:18083/traderx

Architecture Diagram​

Diagram source
flowchart LR
  trader["Trader Browser"]
  ingress["NGINX Ingress"]
  web["Web Front End Angular"]
  referenceData["Reference Data"]
  tradeFeed["Trade Feed"]
  people["People Service"]
  account["Account Service"]
  position["Position Service"]
  tradeProcessor["Trade Processor"]
  tradeService["Trade Service"]
  database["PostgreSQL Database"]
  trader -->|"Single browser entrypoint"| ingress
  ingress -->|"/"| web
  ingress -->|"/account-service"| account
  ingress -->|"/position-service"| position
  ingress -->|"/trade-service"| tradeService
  ingress -->|"/reference-data"| referenceData
  ingress -->|"/people-service"| people
  ingress -->|"/trade-feed (WS)"| tradeFeed
  tradeService -->|"Validate account"| account
  tradeService -->|"Validate ticker"| referenceData
  tradeService -->|"Publish trade event"| tradeFeed
  tradeProcessor -->|"Consume/publish account updates"| tradeFeed
  account -->|"Validate person"| people
  account -->|"Read/write account data"| database
  position -->|"Read positions/trades"| database
  tradeProcessor -->|"Persist processed trades/positions"| database

Node Catalog​

NodeKindLabelNotes
traderactorTrader BrowserUses Angular UI via ingress.
ingressgatewayNGINX IngressSingle browser entrypoint for UI + API + websocket.
webfrontendWeb Front End AngularTraderX UI.
referenceDataserviceReference DataTicker lookup/list.
tradeFeedmessagingTrade FeedSocket.IO pub/sub layer (unchanged from state 004).
peopleservicePeople ServiceIdentity lookup and validation.
accountserviceAccount ServiceAccount and account-user operations using PostgreSQL.
positionservicePosition ServiceTrades/positions query operations using PostgreSQL.
tradeProcessorserviceTrade ProcessorTrade processing and persistence using PostgreSQL.
tradeServiceserviceTrade ServiceTrade submission and validation.
databasedatabasePostgreSQL DatabasePersistent account/trade/position state.

State Notes​

  • State 005 is an architecture-track branch from state 004.
  • Only database engine/runtime is replaced; functional API and messaging contracts remain stable.
  • H2 web console is removed from runtime expectations in this state.