How anthonyrichir/quickperf-sample-test works
Project type and purpose
• This is a JHipster-generated Java/Spring Boot microservice (bookApi) intended to be part of a larger microservice ecosystem.
• Its primary responsibility is to expose REST endpoints for CRUD operations on Book, Author, Editor, and Owner entities.
• It relies on Service Discovery (JHipster Registry), Centralized Configuration (Spring Cloud Config), a MySQL datastore, Liquibase for schema management, and includes monitoring (Prometheus + Grafana) and CI/CD support (Jenkins, Sonar).
File structure
• Top-level artifacts:
• pom.xml, mvnw scripts, package.json (front-end stub), JHipster registry & Docker Compose yml under src/main/docker.
• src/main/java/com/book: typical Spring-Boot layers: config, domain, repository, service, web/rest, security, aop, client.
• src/main/resources/config: multiple profiles (dev, prod, tls), Liquibase changelogs & data.
• src/test: unit & integration tests for each layer.
• Docker compose definitions for: MySQL, JHipster-Registry, Config Server, Hazelcast Management Center, Prometheus, Grafana, Sonar, Jenkins.
• CI: Jenkinsfile and .travis.yml for pipelines; sonar-project.properties for code quality.
Key insights from README
• Service refuses to start without a running JHipster-Registry at localhost:8761.
• Docker-Compose can bring up all dependencies (mysql, registry, config, monitoring, Sonar).
• Built-in QuickPerf tests annotated in integration and unit tests, but that is peripheral and not part of the runtime architecture.
Main components and their interactions
a. External/Infrastructure services (deployed via Docker Compose or external):
• JHipster Registry (Eureka) – Service Discovery.
• Spring Cloud Config Server – Centralized configuration store.
• MySQL – Relational database.
• Prometheus & Grafana – Metrics collection and dashboards (actuator → Prometheus → Grafana).
• Jenkins & SonarQube – CI/CD and code quality.
b. Application microservice (bookApi):
• Spring Boot application (BookApiApp).
• Configuration layer: reads from Config Server.
• Service Discovery client: registers with JHipster Registry.
• Web/API layer: com.book.web.rest.* controllers.
• Business layer: com.book.service.* (if any) and repository layer: com.book.repository.*.
• Domain layer: com.book.domain.* JPA entities managed via Liquibase migrations.
• Security: JWT filter, Token Provider, Spring Security config.
• Feign client interceptor for outgoing calls to other microservices.
• AOP logging and async execution.
c. CI pipeline: Jenkins builds and runs Sonar, Maven, Docker image via Jib, then deploys.
Architectural patterns and principles
• Microservice architecture with externalized configuration and service registration (Spring Cloud Config & Eureka).
• Layered (onion/hexagonal) architecture within the application: REST → Service → Repository → Database.
• Infrastructure-as-code: Docker Compose for dependencies, Jib for containerizing the app.
• Automated CI/CD and quality gates (Sonar, Jenkins).
• Use of Liquibase for versioned DB migrations.
• Monitoring via Spring Boot Actuator → Prometheus → Grafana.