Skip to content

Architecture ​

Target architecture of the AI-Driven Development Model: a React/shadcn frontend connected via a type-safe OData v4 contract to a Domain-Driven SAP CAP backend, running on SAP BTP Cloud Foundry.

System Overview ​

Design Approach ​

  • Domain-Driven Design — Entities, Aggregates, and Bounded Contexts via CDS namespaces.
  • i18n from day one — every app is localizable.
  • CAP as the central abstraction — domain model, services, persistence, and authorization all flow through CAP.

Repository Layout ​

An npm workspaces monorepo:

PathPurpose
packages/*Frontend apps / shared libraries
srv/CAP service layer
db/CDS domain model & persistence
main.tsxApp entry (root)

Layers ​

Frontend ​

React + TypeScript on Vite 8 (Rolldown bundler), UI built with shadcn/ui on Base UI primitives and Tailwind CSS v4. See Frontend for the full stack.

Backend ​

SAP CAP Node.js with TypeScript (CAP v10) or ABAP RAP, CDS domain model, OData v4 APIs. See Backend.

Interface ​

  • OData v4 first, REST only when useful.
  • End-to-end type safety: cds-typer generates @cds-models/* types on the backend; the frontend consumes them via TanStack Query.
  • ⚠️ CAP v10 delivers Decimal and Int64 as strings in OData responses ("9.99", not 9.99) — parse/type accordingly and avoid strict numeric equality on these fields.

Runtime & Tooling ​

  • Node.js 24 LTS recommended (CAP v10 minimum: Node 22; Node 26 from Oct 2026).
  • HTTP: CAP uses native fetch (Axios removed) — align custom adapters / destination calls accordingly.

Dependency Policy ​

  • Pin exact versions in lockfiles; Renovate/audit via CI gate before merging dependency bumps.
  • Heightened scrutiny for @tanstack/* and @cap-js/* version ranges — both ecosystems had npm supply-chain incidents in May 2026 (compromised published versions); verify against known-good versions before upgrading.

Deployment ​