# abderrahmaneod/spring-boot-jenkins-ci-cd architecture

> Architecture diagram of the GitHub repository abderrahmaneod/spring-boot-jenkins-ci-cd, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abderrahmaneod/spring-boot-jenkins-ci-cd
- Repository: https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd

## Overview

1. **What this repository is**
   - This is a single Spring Boot backend application for managing two core domain concepts: **Professeur** and **Specialite**.
   - The code is organized in the classic Spring layered style, so an architecture diagram should show a clear request flow from web controllers down to service and persistence layers.

2. **Application runtime**
   - The application starts from `GestionProfesseursApplication.java`, which is the Spring Boot entry point.
   - It is a Maven-built Java application, targeting **Java 17** as noted in the README.
   - The packaged output is a JAR, which is then used in Docker-based deployment.

3. **Web/API boundary**
   - `controllers/ProfesseurController.java` and `controllers/SpecialiteController.java` form the HTTP entry layer.
   - These controllers are the external-facing boundary of the app and likely expose CRUD-style operations for professors and specialties.
   - For an architecture diagram, place them directly behind the client/API boundary.

4. **Business logic layer**
   - `services/ProfesseurService.java` and `services/SpecialiteService.java` contain the application’s business rules and orchestration.
   - This layer sits between controllers and repositories, keeping HTTP concerns separate from data access.
   - The presence of service classes indicates the app follows a separation-of-concerns pattern rather than putting logic in controllers.

5. **Persistence boundary**
   - `repository/ProfesseurRepository.java` and `repository/SpecialiteRepository.java` are the persistence access points.
   - The repository naming strongly suggests Spring Data-style persistence abstraction, where controllers and services do not talk to the database directly.
   - The actual database type is not shown in the tree, but `application.properties` is where connection and JPA settings would typically live.

6. **Domain model**
   - `entities/Professeur.java` and `entities/Specialite.java` are the core data models.
   - These are the objects moving through the application stack: request payloads likely map into entities, services manipulate them, and repositories persist them.
   - The architecture is centered on these two business entities, so they should be shown as the primary domain objects.

7. **Shared abstraction**
   - `dao/IDao.java` is a small but important architectural hint: it suggests a generic data-access abstraction or an older repository-style interface used by the services/repositories.
   - In the diagram, this can be shown as an internal abstraction boundary, though it appears minor compared to the Spring Data repositories.

8. **Configuration and environment**
   - `src/main/resources/application.properties` is the runtime configuration source.
   - This is where the app’s environment-specific settings would be expected, such as server port, datasource, or JPA behavior.
   - Since the repository is containerized, some configuration may also be supplied through Docker or compose rather than only through properties.

9. **Testing**
   - `GestionProfesseursApplicationTests.java` is the main test artifact in the tree.
   - The repository appears to have a basic test harness rather than a large test suite.
   - In an architecture diagram, testing is a supporting quality gate around the app rather than a runtime subsystem.

10. **Containerization and deployment**
   - The repo includes `Dockerfile`, `Dockerfile.final`, and `docker-compose.yml`, which indicate the application is designed to run as a containerized service.
   - The Docker Compose file is used for staging-style deployment orchestration.
   - `Dockerfile.final` suggests a separate final runtime image, likely distinct from the build image.

11. **CI/CD pipeline as a first-class subsystem**
   - `Jenkinsfile` defines the delivery pipeline described in the README.
   - The pipeline stages are: source checkout, OWASP Dependency Check, SonarQube analysis, Maven build/test, Docker image build and push, Trivy vulnerability scanning, and Docker Compose deployment.
   - For architecture purposes, this pipeline is an external automation layer that takes source code and produces a scanned, deployable container image.

12. **Security and quality gates**
   - OWASP Dependency Check and Trivy add security scanning at dependency and container levels.
   - SonarQube adds static analysis and code-quality enforcement.
   - These tools are not part of the runtime app, but they materially affect how code moves from source to staging, so they should appear as release-time gates in the diagram.

13. **Overall structural view**
   - The runtime architecture is: external caller → controller → service → repository → persistence, with `Professeur` and `Specialite` as the main domain objects.
   - The delivery architecture is: Git checkout → security/quality scans → build → containerize → scan image → deploy with Docker Compose.
   - The repository is therefore both an application codebase and an infrastructure pipeline definition for a containerized Spring Boot service.

Main entry points: [`src/main/java/ma/projet/gestionprofesseurs/GestionProfesseursApplication.java`](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/GestionProfesseursApplication.java) (App), [`Jenkinsfile`](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/tree/main/Jenkinsfile) (Jenkinsfile), [`src/main/java/ma/projet/gestionprofesseurs/services/ProfesseurService.java`](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/services/ProfesseurService.java) (Professeur svc), [`src/main/java/ma/projet/gestionprofesseurs/services/SpecialiteService.java`](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/services/SpecialiteService.java) (Specialite svc)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime app"]
  node_app(("App<br/>spring-boot entrypoint"))
  node_professeur_controller["Professeur API<br/>web controller"]
  node_specialite_controller["Specialite API<br/>web controller"]
  node_professeur_service["Professeur svc<br/>service layer"]
  node_specialite_service["Specialite svc<br/>service layer"]
  node_professeur_repo[("Professeur repo")]
  node_specialite_repo[("Specialite repo")]
  node_professeur["Professeur<br/>entity<br/>[Professeur.java]"]
  node_specialite["Specialite<br/>entity<br/>[Specialite.java]"]
  node_idao{{"IDao<br/>dao abstraction<br/>[IDao.java]"}}
end

subgraph group_delivery["Delivery pipeline"]
  node_jenkinsfile["Jenkinsfile<br/>pipeline definition"]
  node_depcheck(("Dependency check<br/>security gate"))
  node_sonar(("SonarQube<br/>quality gate"))
  node_maven_build(("Build & test<br/>pipeline stage"))
  node_docker_build["Docker build<br/>container build"]
  node_trivy(("Trivy scan<br/>security gate"))
  node_compose_deploy["Compose deploy<br/>deployment<br/>[docker-compose.yml]"]
  node_final_image["Final image<br/>runtime image<br/>[Dockerfile.final]"]
end

subgraph group_support["Support files"]
  node_application_properties["Config"]
  node_tests["Smoke tests<br/>test harness"]
  node_pom["Maven build<br/>build config<br/>[pom.xml]"]
end

node_app -->|"wires"| node_professeur_controller
node_app -->|"wires"| node_specialite_controller
node_app -->|"wires"| node_professeur_service
node_app -->|"wires"| node_specialite_service
node_app -->|"wires"| node_professeur_repo
node_app -->|"wires"| node_specialite_repo
node_app -.->|"loads"| node_application_properties
node_professeur_controller -->|"uses"| node_professeur_service
node_specialite_controller -->|"uses"| node_specialite_service
node_professeur_service -->|"persists"| node_professeur_repo
node_specialite_service -->|"persists"| node_specialite_repo
node_professeur_repo -->|"stores"| node_professeur
node_specialite_repo -->|"stores"| node_specialite
node_professeur_service -.->|"abstracts"| node_idao
node_specialite_service -.->|"abstracts"| node_idao
node_tests -.->|"verifies"| node_app
node_pom -->|"builds"| node_app
node_jenkinsfile -->|"stage"| node_depcheck
node_jenkinsfile -->|"stage"| node_sonar
node_jenkinsfile -->|"stage"| node_maven_build
node_jenkinsfile -->|"stage"| node_docker_build
node_jenkinsfile -->|"stage"| node_trivy
node_jenkinsfile -->|"stage"| node_compose_deploy
node_maven_build -->|"feeds"| node_docker_build
node_docker_build -->|"produces"| node_final_image
node_docker_build -->|"scans"| node_trivy
node_trivy -->|"gates"| node_compose_deploy

click node_app "https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/GestionProfesseursApplication.java"
click node_professeur_controller "https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/controllers/ProfesseurController.java"
click node_specialite_controller "https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/controllers/SpecialiteController.java"
click node_professeur_service "https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/services/ProfesseurService.java"
click node_specialite_service "https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/services/SpecialiteService.java"
click node_professeur_repo "https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/repository/ProfesseurRepository.java"
click node_specialite_repo "https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/repository/SpecialiteRepository.java"
click node_professeur "https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/entities/Professeur.java"
click node_specialite "https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/entities/Specialite.java"
click node_idao "https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/dao/IDao.java"
click node_application_properties "https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/resources/application.properties"
click node_tests "https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/test/java/ma/projet/gestionprofesseurs/GestionProfesseursApplicationTests.java"
click node_pom "https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/pom.xml"
click node_jenkinsfile "https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/tree/main/Jenkinsfile"
click node_docker_build "https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/tree/main/Dockerfile"
click node_compose_deploy "https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/docker-compose.yml"
click node_final_image "https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/Dockerfile.final"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_professeur_controller,node_specialite_controller,node_professeur_service,node_specialite_service,node_professeur_repo,node_specialite_repo,node_professeur,node_specialite,node_idao toneBlue
class node_jenkinsfile,node_depcheck,node_sonar,node_maven_build,node_docker_build,node_trivy,node_compose_deploy,node_final_image toneAmber
class node_application_properties,node_tests,node_pom toneMint
```

## Components

### Runtime app

Spring Boot request flow and domain model

- [App](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/GestionProfesseursApplication.java): spring-boot entrypoint · Spring Boot application bootstrap · `src/main/java/ma/projet/gestionprofesseurs/GestionProfesseursApplication.java`
- [Professeur API](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/controllers/ProfesseurController.java): web controller · HTTP boundary for professeur operations · `src/main/java/ma/projet/gestionprofesseurs/controllers/ProfesseurController.java`
- [Specialite API](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/controllers/SpecialiteController.java): web controller · HTTP boundary for specialite operations · `src/main/java/ma/projet/gestionprofesseurs/controllers/SpecialiteController.java`
- [Professeur svc](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/services/ProfesseurService.java): service layer · Business logic for professors · `src/main/java/ma/projet/gestionprofesseurs/services/ProfesseurService.java`
- [Specialite svc](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/services/SpecialiteService.java): service layer · Business logic for specialties · `src/main/java/ma/projet/gestionprofesseurs/services/SpecialiteService.java`
- [Professeur repo](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/repository/ProfesseurRepository.java): repository · Persistence access for professors · `src/main/java/ma/projet/gestionprofesseurs/repository/ProfesseurRepository.java`
- [Specialite repo](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/repository/SpecialiteRepository.java): repository · Persistence access for specialties · `src/main/java/ma/projet/gestionprofesseurs/repository/SpecialiteRepository.java`
- [Professeur](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/entities/Professeur.java): entity · Core professor domain model · `src/main/java/ma/projet/gestionprofesseurs/entities/Professeur.java`
- [Specialite](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/entities/Specialite.java): entity · Core specialty domain model · `src/main/java/ma/projet/gestionprofesseurs/entities/Specialite.java`
- [IDao](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/java/ma/projet/gestionprofesseurs/dao/IDao.java): dao abstraction · Shared data-access abstraction · `src/main/java/ma/projet/gestionprofesseurs/dao/IDao.java`

### Delivery pipeline

CI/CD, image build, scan, and deployment

- [Jenkinsfile](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/tree/main/Jenkinsfile): pipeline definition · CI/CD pipeline orchestration · `Jenkinsfile`
- **Dependency check**: security gate · OWASP dependency vulnerability scan
- **SonarQube**: quality gate · Static analysis and code quality gate
- **Build & test**: pipeline stage · Compile, test, and package the jar
- [Docker build](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/tree/main/Dockerfile): container build · Builds the runtime container image · `Dockerfile`
- **Trivy scan**: security gate · Container image vulnerability scan
- [Compose deploy](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/docker-compose.yml): deployment · Docker Compose runtime deployment · `docker-compose.yml`
- [Final image](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/Dockerfile.final): runtime image · Slim final container build · `Dockerfile.final`

### Support files

Build, config, and test support

- [Config](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/main/resources/application.properties): runtime config · Application and datasource settings · `src/main/resources/application.properties`
- [Smoke tests](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/src/test/java/ma/projet/gestionprofesseurs/GestionProfesseursApplicationTests.java): test harness · Main application test entry · `src/test/java/ma/projet/gestionprofesseurs/GestionProfesseursApplicationTests.java`
- [Maven build](https://github.com/abderrahmaneod/spring-boot-jenkins-ci-cd/blob/main/pom.xml): build config · Project dependency and packaging model · `pom.xml`

## Connections

- App → Professeur API: wires · Spring creates controller beans
- App → Specialite API: wires · Spring creates controller beans
- App → Professeur svc: wires · Service bean lifecycle
- App → Specialite svc: wires · Service bean lifecycle
- App → Professeur repo: wires · Repository bean lifecycle
- App → Specialite repo: wires · Repository bean lifecycle
- App → Config: loads · Runtime configuration source
- Professeur API → Professeur svc: uses · HTTP requests delegated to business logic
- Specialite API → Specialite svc: uses · HTTP requests delegated to business logic
- Professeur svc → Professeur repo: persists · Professor data access
- Specialite svc → Specialite repo: persists · Specialty data access
- Professeur repo → Professeur: stores · Professor entity persistence
- Specialite repo → Specialite: stores · Specialty entity persistence
- Professeur svc → IDao: abstracts · Shared data-access contract
- Specialite svc → IDao: abstracts · Shared data-access contract
- Smoke tests → App: verifies · Application smoke coverage
- Maven build → App: builds · Maven packages the application
- Jenkinsfile → Dependency check: stage · Pipeline security scan
- Jenkinsfile → SonarQube: stage · Pipeline quality analysis
- Jenkinsfile → Build & test: stage · Pipeline build and test
- Jenkinsfile → Docker build: stage · Pipeline container build
- Jenkinsfile → Trivy scan: stage · Pipeline container scan
- Jenkinsfile → Compose deploy: stage · Pipeline deployment step
- Build & test → Docker build: feeds · Packaged jar becomes container input
- Docker build → Final image: produces · Final runtime image build
- Docker build → Trivy scan: scans · Image vulnerability scanning
- Trivy scan → Compose deploy: gates · Only scanned images are deployed
