|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +This repository is the FINOS TraderX sample trading application. It is intentionally simple, non-production, and designed for local experimentation across a distributed set of services. |
| 4 | + |
| 5 | +## Start here (project context) |
| 6 | +- `README.md` for overall purpose and run modes. |
| 7 | +- `docs/running.md` for default ports, startup sequences, and environment variables. |
| 8 | +- `docs/README.md`, `docs/overview.md`, and `docs/flows.md` for architecture and sequence flows. |
| 9 | +- `docs/c4/workspace.dsl` for the C4 diagram source (use Structurizr Lite to render). |
| 10 | + |
| 11 | +## Repository map (service roots) |
| 12 | +- `database/` (H2 database) |
| 13 | +- `reference-data/` (Node/NestJS reference data) |
| 14 | +- `trade-feed/` (Node/Socket.IO pub-sub) |
| 15 | +- `people-service/` (.NET) |
| 16 | +- `account-service/` (Java/Spring Boot) |
| 17 | +- `position-service/` (Java/Spring Boot) |
| 18 | +- `trade-service/` (Java/Spring Boot) |
| 19 | +- `trade-processor/` (Java/Spring Boot) |
| 20 | +- `web-front-end/` (Angular + React clients) |
| 21 | +- `docs/` and `website/` (documentation site) |
| 22 | +- `gitops/` and `ingress/` (K8s/Tilt and ingress config) |
| 23 | + |
| 24 | +## Quick run options |
| 25 | +- Docker Compose (full system): from repo root, `docker compose up` (see `README.md`). |
| 26 | +- Kubernetes/Tilt: see `gitops/local/Tiltfile` and `docs/running.md` for `tilt up`. |
| 27 | +- Manual run: see `docs/running.md` for the recommended startup sequence and port env vars. |
| 28 | + |
| 29 | +## Service-level guidance |
| 30 | +- Each service has a `README.md` with run details and prerequisites. Read that before editing. |
| 31 | +- OpenAPI specs are generated at runtime (Swagger) and saved as `*/openapi.json` when you run `scripts/generate-openapi.sh`. Swagger UI is typically exposed at `/swagger-ui.html` (or service-specific Swagger routes). |
| 32 | +- Java services use Gradle wrapper (`./gradlew`) from their service directory. |
| 33 | +- Node services use their local `package.json` scripts. |
| 34 | +- `web-front-end/` contains both Angular and React implementations; check each subfolder's README. |
| 35 | + |
| 36 | +## When making changes |
| 37 | +- Prefer small, targeted edits in the service you are touching; do not refactor cross-service behavior unless requested. |
| 38 | +- If behavior or APIs change, refresh the OpenAPI specs via `scripts/generate-openapi.sh` and update any relevant docs in `docs/`. |
| 39 | +- Keep the non-production, demo nature of the project in mind. |
| 40 | + |
| 41 | +## Keeping diagrams in sync |
| 42 | +When adding, removing, or changing services or their interactions, update **all** relevant diagrams: |
| 43 | + |
| 44 | +1. **C4 diagram** (`docs/c4/workspace.dsl`) - The Structurizr DSL is the source of truth for architecture. PNG images are auto-rendered by GitHub Actions on push. |
| 45 | +2. **Mermaid diagrams** in `docs/overview.md` (simplified architecture) and `docs/flows.md` (sequence diagrams). |
| 46 | +3. **Component table** in `README.md` if adding/removing services. |
| 47 | + |
| 48 | +The C4 DSL and Mermaid diagrams should stay consistent—if you update one, check if the other needs the same change. |
| 49 | + |
| 50 | +## Documentation and website |
| 51 | +The project has two content surfaces that may overlap: |
| 52 | +1. **`docs/`** - Markdown files served by Docusaurus (architecture, flows, running instructions) |
| 53 | +2. **`website/src/components/`** - React components for the landing page (feature highlights, intro text) |
| 54 | + |
| 55 | +**Avoid duplication**: The landing page is marketing-style (logo, tagline, feature cards, CTAs). The `docs/` folder is the reference material. If you add content, decide which surface it belongs to—don't put the same text in both places. |
| 56 | + |
| 57 | +**Project history**: When making **major changes** (new services, architectural shifts, significant features), add an entry to `docs/project-history.md`. Minor fixes and routine maintenance do not need to be recorded. |
| 58 | + |
| 59 | +**Relative links in docs**: Links like `../account-service` work on GitHub. The Docusaurus remark plugin (`website/src/remark/transformRelativeLinks.js`) converts them to full GitHub URLs at build time. Keep using relative links in `docs/` markdown files. |
| 60 | + |
| 61 | +## Useful files by task |
| 62 | +- Architecture/flows: `docs/overview.md`, `docs/flows.md`, `docs/c4/workspace.dsl` |
| 63 | +- Local run and ports: `docs/running.md` |
| 64 | +- Docker/K8s: `docker-compose.yml`, `gitops/local/Tiltfile` |
| 65 | +- Front-end: `web-front-end/angular/README.md`, `web-front-end/react/README.md` |
| 66 | +- Docs site: `website/README.md`, `docs/` |
0 commit comments