--- title: "Sonar Test Nest4" generated_by: documentor-agent generated_at: "2026-05-14T12:03:54+00:00" human_edited: false source_entity: "Component/default/sonar-test-nest4" source_repo: "https://gitea.kyndemo.live/validate/sonar-test-nest4" --- # Sonar Test Nest4 > A stateless microservice built with TypeScript and NestJS, providing API endpoints for item management and integrated observability features. ## Overview Sonar Test Nest4 is a stateless microservice scaffolded from the **Create Microservice** golden-path template on the Kyndryl Platform. It is implemented using the `typescript-nestjs` runtime and is designed to manage items through a RESTful API. The service includes built-in observability features such as health checks and Prometheus metrics. This service follows a structured branch model (`dev → staging → prod → main`) to ensure smooth CI/CD workflows. The `dev` branch supports active development with automatic deployments to the development environment, while `staging` and `prod` require PR-based promotions with CI gates and approvals. The `main` branch serves as the system of record for platform metadata and workflow files. Sonar Test Nest4 integrates with Azure Container Registry for image storage and Humanitec for deployment orchestration, targeting an AKS cluster. Observability is enhanced through OpenTelemetry instrumentation and Prometheus metrics, with dashboards available in Grafana. ## Repository | Field | Value | |---|---| | Source Repo | [Sonar Test Nest4 Repository](https://gitea.kyndemo.live/validate/sonar-test-nest4) | | Branch | dev | | ArgoCD App | — | | Namespace | dev | ## Architecture Sonar Test Nest4 is built using the `typescript-nestjs` runtime and deployed as a stateless service. Key architectural components include: - **Runtime**: TypeScript with NestJS framework. - **Container Port**: `3000`. - **Endpoints**: - `/health`: Health check endpoint returning `{"status":"UP"}`. - `/metrics`: Prometheus metrics exposition. - `/api/items`: RESTful API for item management. - **Image Storage**: Azure Container Registry (`bstagecjotdevacr`). - **Deployment Flow**: - CI/CD pipelines (`build-push.yml` and `deploy-humanitec.yml`) handle image building, testing, and deployment. - Humanitec orchestrates deployments to AKS using Score files. The service is integrated with observability tools such as Grafana and Prometheus, ensuring robust monitoring and alerting capabilities. ## Configuration | Config Key | Value | |---|---| | runtime | typescript-nestjs | | health_path | /health | | container_port | 3000 | ## Operations ### Deployment Steps 1. Push changes to the `dev` branch for automatic deployment to the development environment. 2. Open a PR for promotion to `staging` or `prod`. Ensure CI tests pass and obtain one approval. 3. Merge PR to promote the service to the target environment. 4. Use Backstage CI/CD tab for environment promotions. ### Branch Model | Branch | Purpose | |---|---| | dev | Active development with automatic deployments. | | staging | Pre-production environment, promoted from `dev`. | | prod | Production environment, promoted from `staging`. | | main | System of record for platform metadata and workflow files. | ## Observability - [Grafana Dashboard](https://grafana.kyndemo.live/d/otel-app-observability-v2/opentelemetry-application-observability?orgId=1&var-app=sonar-test-nest4) - Prometheus metrics available at `/metrics`. ## Dependencies - api:default/sonar-test-nest4-api