|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +This is a multi-language, multi-sample repository of extension and application samples for [SAP BTP, Kyma Runtime](https://kyma-project.io/). Each top-level directory is an independent sample — there is no monorepo build system tying them together. Samples target deployment on Kubernetes (Kyma) via Docker containers. |
| 8 | + |
| 9 | +## Repository Structure |
| 10 | + |
| 11 | +Each sample is self-contained with its own: |
| 12 | +- `README.md` — setup and deployment instructions |
| 13 | +- `Makefile` — build, image, and deploy targets |
| 14 | +- `Dockerfile` (or buildpack config) — container build |
| 15 | +- Kubernetes manifests (in a `k8s/` subdirectory) or Helm charts |
| 16 | + |
| 17 | +Shared resources: |
| 18 | +- `prerequisites/README.md` — all required tooling by category |
| 19 | +- `helm-charts/` — reusable Helm charts |
| 20 | +- `workspaces/` — VS Code workspace files per sample |
| 21 | +- `assets/` — shared images/diagrams |
| 22 | +- `.github/workflows/` — CI workflows per sample |
| 23 | + |
| 24 | +## Build Commands |
| 25 | + |
| 26 | +### Root-level (Java samples only) |
| 27 | +```bash |
| 28 | +make build-java-projects # builds sample-extension-java, sample-event-trigger-java, cloudsdk-client-cert-auth |
| 29 | +``` |
| 30 | + |
| 31 | +### Per-sample (run from sample directory) |
| 32 | +Most samples follow this Makefile pattern: |
| 33 | +```bash |
| 34 | +make build # compile/build the application |
| 35 | +make build-image # build Docker image |
| 36 | +make push-image # push to registry (requires DOCKER_PUSH_REPOSITORY etc.) |
| 37 | +make all # clean + build + build-image + push-image |
| 38 | +``` |
| 39 | + |
| 40 | +**Java (Gradle):** |
| 41 | +```bash |
| 42 | +./gradlew clean build |
| 43 | +./gradlew -Pversion=<version> -Pname=<app> clean build |
| 44 | +``` |
| 45 | + |
| 46 | +**Go:** |
| 47 | +```bash |
| 48 | +go build ./... |
| 49 | +go test ./... -count=1 |
| 50 | +``` |
| 51 | + |
| 52 | +**.NET:** |
| 53 | +```bash |
| 54 | +dotnet build |
| 55 | +dotnet test |
| 56 | +``` |
| 57 | + |
| 58 | +**Node.js/CAP:** |
| 59 | +```bash |
| 60 | +npm install |
| 61 | +npm run build # or npm start |
| 62 | +cds build # for CAP projects |
| 63 | +``` |
| 64 | + |
| 65 | +## CI/CD |
| 66 | + |
| 67 | +Workflows in `.github/workflows/` follow a naming convention: `build-docker-<sample-name>.yml`, `build-and-publish-<sample-name>.yml`, `deploy-<sample-name>.yml`. Each workflow is independent and scoped to one sample. GitHub Actions uses JDK 17 (adopt distribution) for Java samples. |
| 68 | + |
| 69 | +## Key Technologies by Sample Category |
| 70 | + |
| 71 | +| Category | Samples | Stack | |
| 72 | +|----------|---------|-------| |
| 73 | +| Java microservices | `sample-extension-java`, `sample-event-trigger-java` | Spring Boot 3, Gradle, JDK 17 | |
| 74 | +| Go microservices | `orders-service`, `api-postgresql-go`, `app-auth-proxy` | Go 1.21, PostgreSQL/MSSQL | |
| 75 | +| .NET | `sample-extension-dotnet`, `sample-extension-dotnet-minimalapi` | ASP.NET Core, .NET 6+ | |
| 76 | +| Node.js functions | `s4hana-materialstock-function`, serverless functions | Node.js, SAP Cloud SDK | |
| 77 | +| Frontend | `frontend-react-mssql`, `frontend-ui5-postgresql` | React, SAPUI5 | |
| 78 | +| CAP | `from-zero-to-cap-on-kyma`, `cap-multitenancy-sample` | `@sap/cds-dk`, Node.js | |
| 79 | +| Mocks | `commerce-mock`, `c4c-mock`, `marketing-mock` | Node.js/TypeScript | |
| 80 | +| Auth | `user-propagation`, `app-auth-proxy` | XSUAA, OIDC, Go | |
| 81 | +| Advanced | `grpc-python`, `custom-component-dapr`, `sample-ldap` | Python, Dapr, LDAP | |
| 82 | + |
| 83 | +## Contributing |
| 84 | + |
| 85 | +- Propose changes via a GitHub issue first. |
| 86 | +- Squash multiple commits into one before submitting a PR. |
| 87 | +- Commit messages should reference issues: `Fixes https://github.com/SAP-samples/kyma-runtime-extension-samples/issues/<N>` (no colon after "Fixes"). |
| 88 | +- DCO acceptance is required via CLA assistant on first PR. |
| 89 | +- Follow the coding standards of the language used in each sample. |
| 90 | + |
| 91 | +## Deployment Pattern |
| 92 | + |
| 93 | +All samples deploy to Kyma/Kubernetes. The typical workflow: |
| 94 | +1. Build the app (`make build`) |
| 95 | +2. Build and push a Docker image (`make build-image push-image`) |
| 96 | +3. Apply Kubernetes manifests (`kubectl apply -f k8s/`) or install Helm chart |
| 97 | +4. Configure SAP BTP service bindings as Kubernetes secrets |
| 98 | + |
| 99 | +Each sample's `README.md` documents the specific deployment steps and required environment variables/secrets. |
0 commit comments