Technical overview · Technology stack

Technology stack.

Spring Boot and Spring AI on the backend, React and strict TypeScript on the frontend, one openapi.yaml contract between them, and tests that block CI if anything drifts. The technology choices, and why.

01 · Backend

Java 17, Spring Boot and Spring AI.

A conventional Spring Boot foundation extended with Spring AI for LLM abstractions, tools and MCP servers. PostgreSQL persistence uses Flyway as the single authority for the schema; Hibernate remains in validate mode.

Framework

Java 17 LTS (records, sealed types, pattern matching) · Spring Boot 4 · Spring AI for LLM, tool and MCP integration.

Persistence

PostgreSQL 15+ · Flyway applies SQL migrations at startup · HikariCP for JDBC connection pooling · Hibernate in validate mode.

Security & rate limiting

Spring Security filter chain · JJWT for HS256 · BCrypt for passwords and API keys · Bucket4j for two-level rate limiting.

Spring AI, not a home-grown wrapper

Spring AI avoids building a fragile abstraction layer for LLMs. Its native ports for tools, MCP and embeddings are already at the right level. Application code works with ChatOptions and EmbeddingRequest, not OpenAI payloads.

02 · Frontend

React 18, strict TypeScript, API-first.

A lightweight SPA served as static files, with no server-side rendering. TypeScript types are not handwritten: they are generated from the OpenAPI contract, and any drift fails CI.

Framework

Strict TypeScript 5 · React 18 · Vite bundler · Tailwind CSS with custom tokens · React Router for client-side routing.

Data & SSE

openapi-fetch with generated types · @tanstack/react-query for caching and retries · @microsoft/fetch-event-source for authenticated SSE streams.

Forms & validation

react-hook-form for state · zod for validation · schemas shared between the resolver and lightweight UI business checks.

Why not native EventSource?

The browser's native EventSource cannot send an authorisation header, so it cannot attach a Bearer token to an SSE stream. @microsoft/fetch-event-source is a clean alternative: the same semantics, with support for custom headers.

03 · API contract

One openapi.yaml as the source of truth.

The API contract is written once in YAML. The frontend derives its types from it, while the backend checks consistency with a parity test. Any drift is detected before merge, not in production.

  • Generated ahead of time. npm run gen:api produces frontend/src/generated/schema.d.ts, consumed directly by openapi-fetch.
  • CI guardrail. npm run gen:api:check fails if committed types differ from the current YAML. Merging is blocked until the mismatch is resolved.
  • Server-side parity. A backend test verifies that every ProblemDetails.code declared in OpenAPI has a Java handler, and vice versa. No orphan error codes or undocumented handlers.
Drift caught by design

The contract cannot silently diverge. Any mismatch between OpenAPI, generated TypeScript types and Java handlers breaks CI. This avoids one of the hardest bugs to diagnose: “it worked in development, but not in production.”

04 · Quality & delivery

Tested, then packaged.

Broad test coverage on both sides: unit, integration with a real database, network stubs, architecture rules and accessibility. Maven build for the backend, npm for the frontend, delivered as a fat JAR on EC2. No Docker.

Tests

Backend: JUnit 5 · AssertJ · Mockito · Testcontainers (real PostgreSQL) · WireMock (stubbed OpenAI). Frontend: Vitest · React Testing Library · MSW.

Quality & architecture

ArchUnit enforces hexagonal layers · ESLint + Prettier on the frontend · vitest-axe checks accessibility in CI · a dedicated regression test covers log redaction.

Build & delivery

Maven Wrapper with pinned versions · npm with committed package-lock.json · Spring Boot fat JAR deployed to EC2 · Terraform under terraform/, applied by an operator.

No Docker, by design

An explicit choice for the current target: a fat JAR, systemd and RDS are sufficient — no container-stack overhead, registry to operate or orchestrator to manage. If the scope changes, the move remains possible without changing the domain.