# Component Spec: nats-broker

> For the complete documentation index, see [llms.txt](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/llms.txt).

## Responsibilities

*   Provide broker-based pub/sub for backend services.
*   Provide websocket-compatible endpoint for browser streaming clients.
*   Support subject wildcard subscriptions for account-scoped updates.

## Covered Flows

*   [`F2`](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/specs/baseline-uncontainerized-parity/system/end-to-end-flows.md#f2-bootstrap-trade--position-blotters) trade submission to processing event chain.
*   [`F4`](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/specs/baseline-uncontainerized-parity/system/end-to-end-flows.md#f4-process-trade-events) real-time update streaming to UI.
*   `STARTUP` runtime readiness dependency for event-producing services.

## Requirement Coverage

*   [`FR-701`](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/specs/baseline-uncontainerized-parity/spec.md), [`FR-702`](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/specs/baseline-uncontainerized-parity/spec.md), [`FR-703`](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/specs/baseline-uncontainerized-parity/spec.md), [`FR-705`](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/specs/baseline-uncontainerized-parity/spec.md)
*   [`NFR-701`](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/specs/baseline-uncontainerized-parity/spec.md), [`NFR-702`](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/specs/baseline-uncontainerized-parity/spec.md), [`NFR-703`](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/specs/baseline-uncontainerized-parity/spec.md), [`NFR-704`](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/specs/baseline-uncontainerized-parity/spec.md)

## Interfaces

*   NATS client: `4222`
*   Monitoring: `8222` (optional debug)
*   Browser websocket (proxied): `/nats-ws`

## Verification

*   `scripts/test-state-006-messaging-nats-replacement.sh` (to be implemented)
