Appearance
Domain-Driven CAP
The default backend in the AI-Driven Development Model is built on the SAP Cloud Application Programming Model (CAP) — Node.js with TypeScript, CAP v10. CAP is the central abstraction for domain model, services, persistence, and authorization. See also the CAP programming model overview.
cds-typergenerates@cds-models/*types, imported via#cds-models/<path>.
Project Scaffolding — always via cds CLI facets
New CAP projects and features are created with cds init / cds add — never by hand-writing configuration:
bash
cds init <project> --add typescript,sqlite # typescript facet auto-adds cds-typer
cds add hana --for production
cds add xsuaa # or: cds add ias
cds add mtaRationale: facets wire up package.json, tsconfig.json, mta.yaml, and cds-plugin presets consistently; hand-rolled config drifts and breaks cds build tasks.
TypeScript Runtime — tsx is mandatory
tsxandtypescriptare required devDependencies in every CAP project.- Run plain
cds watch— it detectstsconfig.jsonand runs via tsx automatically ("Detected tsconfig.json. Running with tsx.").
WARNING
Without tsx, cds watch does not run .ts handlers and @cds-models/* are not regenerated on model changes — a recurring failure in past projects.
@cds-models/*are build artifacts: excluded from version control, regenerated by the cds-typer plugin duringcds watchand by thetypescriptbuild task duringcds build.
Domain Model & APIs
- Domain model: CDS — Entities, Aggregates, Bounded Contexts via namespaces.
- APIs: OData v4 first, REST only when useful.
- CAP v10: Application Services serve only
odata-v2/odata-v4/odata-x4by default; widen viacds.protocols.defaultsif needed.
- CAP v10: Application Services serve only
Fiori UI Annotations
The CDS model carries standard SAP Fiori annotations that the frontend's React Fiori building blocks render out of the box — no per-field UI code. Annotations live in companion files next to each service, all registered in srv/services.cds:
<service>-service.ui.cds— Fiori UI annotations:@UI.LineItem(table columns / list report),@UI.HeaderInfo,@UI.Facets/@UI.HeaderFacets(object page),@UI.DataPoint,@UI.FieldGroup.<service>-service.valuehelp.cds—@Common.ValueListdefinitions (value helps / Wertehilfen).<service>-service.common.cds— field/entity labels and i18n texts (@title,@Common.Label).
Because these annotations are served in the OData $metadata, a single annotated CDS model drives both the API and the UI — the same annotation-driven, source-of-truth principle as SAP Fiori elements, but consumed by React components instead of UI5. See Frontend → Fiori Building Blocks.
Persistence
- Local / dev: SQLite via
@cap-js/sqlite(added viacds add sqlite).- CAP v10 uses native
node:sqliteas the default driver (Node ≥ 22.5). better-sqlite3/sql.jsrequire an explicit dependency.
- CAP v10 uses native
- Production: SAP HANA Cloud via
@cap-js/hana(added viacds add hana --for production). - No direct driver deps in
package.json— services are auto-wired via cds-plugin presets.
AI Layer
The AI layer is deliberately flexible — pick per project between SAP's managed AI stack and a direct LLM call:
- SAP Business AI as the core (SAP AI Core) — the CAP AI plugin (
@cap-js/aifor Node.js,cds-starter-aifor Java, since June 2026) integrates SAP AI Core. It auto-resolves service bindings, manages resource groups and model deployments, and exposes a standardizedAICoreservice. Built-in use cases include automatic UI field recommendations (powered by SAP's RPT-1 foundation model) for@Common.ValueListfields in draft-enabled Fiori UIs — no custom handler required. Models offered by SAP Generative AI Hub are reached through this path. - Other LLMs directly — alternatively, call an LLM SDK straight from a CAP service handler, e.g. the Anthropic Claude SDK. Add a thin per-provider adapter only when a second provider is introduced.
- Vector / RAG — optional native CAP vector support (CDL
Vectortype +cosineSimilarity/l2Distance) for in-CAP RAG on SQLite / PostgreSQL / HANA.
Note
capire documents CAP's built-in AI integration via SAP AI Core (@cap-js/ai). Using arbitrary third-party LLMs is not a dedicated CAP feature — it is a plain SDK call from a handler; the managed, multi-model path runs through SAP AI Core / Generative AI Hub.
See AI-Driven Workflow for how the AI layer fits into the end-to-end development flow.