Reference monorepo for a backend + frontend application delivery flow with quality gates, security scanning, container builds, semantic release, and GitOps deployment.
The application itself is intentionally small. The main focus of this repository is the delivery system around it: how code is checked, tested, packaged, scanned, versioned, published, and promoted through Kubernetes manifests.
- Monorepo CI/CD structure for backend and frontend services.
- Backend quality gates with Maven, Checkstyle, unit tests, and JaCoCo coverage.
- Frontend quality gates with npm, ESLint, Vitest, and Vite build validation.
- Container build flow for both services.
- Security checks with SAST, secret detection, and Trivy image scanning.
- Semantic release based on Conventional Commits.
- GitOps deployment flow through Kubernetes overlays and Argo CD.
- Path-based pipeline rules so backend and UI jobs run only when relevant files change.
backend/- Spring Boot API with/api/helloon port8080, tests, Checkstyle, JaCoCo, and Dockerfile.ui/- Vite-based frontend, built as static assets and served through Nginx on port8081.k8s/- base Kubernetes manifests.k8s/overlays/prod/kustomization.yaml- production-style Kustomize overlay updated by the GitOps flow.k8s/argocd/test-app-prod.yaml- example Argo CD Application..gitlab-ci.yml- CI/CD pipeline definition..releaserc.cjs- semantic-release configuration.docs/ci-cd-senior-guide.md- detailed pipeline rationale.docs/argocd-structure.md- Argo CD and GitOps file structure.
cd backend
mvn clean test
mvn spring-boot:runcd ui
npm ci
npm run lint
npm run test:ci
npm run build
npm run devThe GitLab pipeline is organized as a full delivery path:
qualitycommitlintfor Conventional Commits.backend_checkstyle.ui_lint.
test- Backend unit tests with JaCoCo coverage report.
- UI unit tests with Cobertura coverage report.
security- GitLab SAST.
- Secret detection.
versionsemantic_versionwith semantic-release and Git tag creation.
package- Backend JAR artifact.
- UI
distartifact.
build- Multistage Docker builds for backend and UI.
- Docker layer cache through registry cache.
scan- Trivy image scanning.
- Pipeline fails on
CRITICALvulnerabilities.
publish- Pushes versioned and
latestimages.
- Pushes versioned and
deploy- Commits updated image tags to
k8s/overlays/prod/kustomization.yaml. - Argo CD applies the GitOps state to the cluster.
- Commits updated image tags to
- Backend jobs run only when
backend/**changes. - UI jobs run only when
ui/**changes. - Shared jobs such as versioning, security, build, publish, and deploy account for changes across both services.
- Pipeline stages are explicit so a failed quality or security gate stops promotion early.
- Maven:
.m2/repository. - UI:
ui/node_modulesandui/.npm. - Docker layers: registry cache with
:buildcache.
Minimum variables for publishing and GitOps updates:
CONTAINER_REGISTRY- defaults toCI_REGISTRY.CONTAINER_REGISTRY_USER.CONTAINER_REGISTRY_PASSWORD.CONTAINER_IMAGE_PREFIX- for exampledocker.io/<org>/test-app.GIT_PUSH_TOKEN- masked and protected token withwrite_repository.GIT_PUSH_USER- usuallyoauth2for PAT-based GitLab pushes.
Optional:
GITOPS_BOT_NAME.GITOPS_BOT_EMAIL.
Versioning is derived from Conventional Commits:
feat:creates a minor release.fix:creates a patch release.BREAKING CHANGE:creates a major release.
Examples:
feat: add oauth login.fix: handle null response.feat!: change hello contractwithBREAKING CHANGE:.
The CI pipeline does not apply Kubernetes manifests directly to the cluster.
Instead, it commits updated image tags to k8s/overlays/prod/kustomization.yaml. Argo CD watches the repository, detects the desired-state change, and performs the rollout from Git.
This keeps deployment state auditable and reviewable:
- application image versions are visible in Git;
- rollout changes are represented as commits;
- cluster reconciliation is handled by Argo CD;
- rollback can be performed by reverting Git state.
More details:
docs/ci-cd-senior-guide.md.docs/argocd-structure.md.
- This repository is a reference implementation, not a drop-in production platform.
- Secrets must be supplied through protected CI/CD variables or an external secret manager.
- The example Argo CD and Kubernetes manifests should be reviewed and adapted before use in a real environment.
- Container image names, registry credentials, and Git push credentials must never be committed to the repository.