How abderrahmaneod/spring-boot-jenkins-ci-cd works
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: GestionProfesseursApplication.java App · Jenkinsfile Jenkinsfile · ProfesseurService.java Professeur svc · SpecialiteService.java Specialite svc
Components 21
Runtime app
Spring Boot request flow and domain model
- App · Spring Boot application bootstrap
src/main/java/ma/projet/gestionprofesseurs/GestionProfesseursApplication.java - Professeur API · HTTP boundary for professeur operations
src/main/java/ma/projet/gestionprofesseurs/controllers/ProfesseurController.java - Specialite API · HTTP boundary for specialite operations
src/main/java/ma/projet/gestionprofesseurs/controllers/SpecialiteController.java - Professeur svc · Business logic for professors
src/main/java/ma/projet/gestionprofesseurs/services/ProfesseurService.java - Specialite svc · Business logic for specialties
src/main/java/ma/projet/gestionprofesseurs/services/SpecialiteService.java - Professeur repo · Persistence access for professors
src/main/java/ma/projet/gestionprofesseurs/repository/ProfesseurRepository.java - Specialite repo · Persistence access for specialties
src/main/java/ma/projet/gestionprofesseurs/repository/SpecialiteRepository.java - Professeur · Core professor domain model
src/main/java/ma/projet/gestionprofesseurs/entities/Professeur.java - Specialite · Core specialty domain model
src/main/java/ma/projet/gestionprofesseurs/entities/Specialite.java - IDao · Shared data-access abstraction
src/main/java/ma/projet/gestionprofesseurs/dao/IDao.java
Delivery pipeline
CI/CD, image build, scan, and deployment
- Jenkinsfile · CI/CD pipeline orchestration
Jenkinsfile - Dependency check · OWASP dependency vulnerability scan
- SonarQube · Static analysis and code quality gate
- Build & test · Compile, test, and package the jar
- Docker build · Builds the runtime container image
Dockerfile - Trivy scan · Container image vulnerability scan
- Compose deploy · Docker Compose runtime deployment
docker-compose.yml - Final image · Slim final container build
Dockerfile.final
Support files
Build, config, and test support
- Config · Application and datasource settings
src/main/resources/application.properties - Smoke tests · Main application test entry
src/test/java/ma/projet/gestionprofesseurs/GestionProfesseursApplicationTests.java - Maven build · Project dependency and packaging model
pom.xml
Connections 27
- 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