# mohansgithub/devops_petclinic architecture

> Architecture diagram of the GitHub repository mohansgithub/devops_petclinic, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mohansgithub/devops_petclinic
- Repository: https://github.com/mohansgithub/devops_petclinic

## Overview

Spring Framework PetClinic is a sample veterinary-clinic web application using the documented presentation–service–repository architecture. A user works through the web presentation to manage clinic records; the service layer mediates access to repositories backed by one of three selectable persistence implementations. The README documents H2 as the default, populated in-memory database and MySQL/PostgreSQL alternatives. Source excerpts were unavailable, so the relationships shown are limited to those documented in the README; the tree supplies paths for the implementation components.

Main entry points: [`src/main/java/org/springframework/samples/petclinic/web`](https://github.com/mohansgithub/devops_petclinic/tree/main/src/main/java/org/springframework/samples/petclinic/web) (Spring MVC), [`src/main/java/org/springframework/samples/petclinic/repository`](https://github.com/mohansgithub/devops_petclinic/tree/main/src/main/java/org/springframework/samples/petclinic/repository) (Repository layer), [`src/main/java/org/springframework/samples/petclinic/service/ClinicServiceImpl.java`](https://github.com/mohansgithub/devops_petclinic/blob/main/src/main/java/org/springframework/samples/petclinic/service/ClinicServiceImpl.java) (Clinic service), [`src/main/resources/db`](https://github.com/mohansgithub/devops_petclinic/tree/main/src/main/resources/db) (Configured database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web presentation"]
  node_mvc["Spring MVC"]
  node_jsp["JSP views"]
  node_webconfig["MVC configuration"]
end

subgraph group_business["Clinic domain"]
  node_service["Clinic service"]
  node_domain["Clinic records"]
end

subgraph group_persistence["Persistence layer"]
  node_repository["Repository layer"]
  node_jpa["JPA implementation"]
  node_jdbc["JDBC implementation"]
  node_springdata["Spring Data JPA"]
  node_database[("Configured database")]
end

subgraph group_configuration["Runtime configuration"]
  node_businessconfig["Business configuration"]
  node_datasource["Datasource configuration"]
end

node_browser(("Clinic user"))

node_browser -->|"uses presentation"| node_mvc
node_mvc -->|"calls service"| node_service
node_mvc -->|"renders views"| node_jsp
node_mvc -->|"configured by"| node_webconfig
node_service -->|"uses repository"| node_repository
node_service -.->|"manages records"| node_domain
node_repository -->|"selects implementation"| node_jpa
node_repository -->|"selects implementation"| node_jdbc
node_repository -->|"selects implementation"| node_springdata
node_jpa -.->|"persists records"| node_database
node_jdbc -.->|"persists records"| node_database
node_springdata -.->|"persists records"| node_database
node_businessconfig -->|"configures transactions"| node_service
node_datasource -.->|"configures connection"| node_database

click node_mvc "https://github.com/mohansgithub/devops_petclinic/tree/main/src/main/java/org/springframework/samples/petclinic/web"
click node_jsp "https://github.com/mohansgithub/devops_petclinic/tree/main/src/main/webapp/WEB-INF/jsp"
click node_webconfig "https://github.com/mohansgithub/devops_petclinic/blob/main/src/main/resources/spring/mvc-view-config.xml"
click node_service "https://github.com/mohansgithub/devops_petclinic/blob/main/src/main/java/org/springframework/samples/petclinic/service/ClinicServiceImpl.java"
click node_domain "https://github.com/mohansgithub/devops_petclinic/tree/main/src/main/java/org/springframework/samples/petclinic/model"
click node_repository "https://github.com/mohansgithub/devops_petclinic/tree/main/src/main/java/org/springframework/samples/petclinic/repository"
click node_jpa "https://github.com/mohansgithub/devops_petclinic/tree/main/src/main/java/org/springframework/samples/petclinic/repository/jpa"
click node_jdbc "https://github.com/mohansgithub/devops_petclinic/tree/main/src/main/java/org/springframework/samples/petclinic/repository/jdbc"
click node_springdata "https://github.com/mohansgithub/devops_petclinic/tree/main/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa"
click node_database "https://github.com/mohansgithub/devops_petclinic/tree/main/src/main/resources/db"
click node_businessconfig "https://github.com/mohansgithub/devops_petclinic/blob/main/src/main/resources/spring/business-config.xml"
click node_datasource "https://github.com/mohansgithub/devops_petclinic/blob/main/src/main/resources/spring/datasource-config.xml"

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_mvc,node_jsp,node_webconfig,node_browser toneBlue
class node_service,node_domain toneAmber
class node_repository,node_jpa,node_jdbc,node_springdata,node_database toneMint
class node_businessconfig,node_datasource toneRose
```

## Components

### Web presentation

- [Spring MVC](https://github.com/mohansgithub/devops_petclinic/tree/main/src/main/java/org/springframework/samples/petclinic/web): `src/main/java/org/springframework/samples/petclinic/web`
- [JSP views](https://github.com/mohansgithub/devops_petclinic/tree/main/src/main/webapp/WEB-INF/jsp): `src/main/webapp/WEB-INF/jsp`
- [MVC configuration](https://github.com/mohansgithub/devops_petclinic/blob/main/src/main/resources/spring/mvc-view-config.xml): `src/main/resources/spring/mvc-view-config.xml`

### Clinic domain

- [Clinic service](https://github.com/mohansgithub/devops_petclinic/blob/main/src/main/java/org/springframework/samples/petclinic/service/ClinicServiceImpl.java): `src/main/java/org/springframework/samples/petclinic/service/ClinicServiceImpl.java`
- [Clinic records](https://github.com/mohansgithub/devops_petclinic/tree/main/src/main/java/org/springframework/samples/petclinic/model): `src/main/java/org/springframework/samples/petclinic/model`

### Persistence layer

- [Repository layer](https://github.com/mohansgithub/devops_petclinic/tree/main/src/main/java/org/springframework/samples/petclinic/repository): `src/main/java/org/springframework/samples/petclinic/repository`
- [JPA implementation](https://github.com/mohansgithub/devops_petclinic/tree/main/src/main/java/org/springframework/samples/petclinic/repository/jpa): `src/main/java/org/springframework/samples/petclinic/repository/jpa`
- [JDBC implementation](https://github.com/mohansgithub/devops_petclinic/tree/main/src/main/java/org/springframework/samples/petclinic/repository/jdbc): `src/main/java/org/springframework/samples/petclinic/repository/jdbc`
- [Spring Data JPA](https://github.com/mohansgithub/devops_petclinic/tree/main/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa): `src/main/java/org/springframework/samples/petclinic/repository/springdatajpa`
- [Configured database](https://github.com/mohansgithub/devops_petclinic/tree/main/src/main/resources/db): `src/main/resources/db`

### Runtime configuration

- [Business configuration](https://github.com/mohansgithub/devops_petclinic/blob/main/src/main/resources/spring/business-config.xml): `src/main/resources/spring/business-config.xml`
- [Datasource configuration](https://github.com/mohansgithub/devops_petclinic/blob/main/src/main/resources/spring/datasource-config.xml): `src/main/resources/spring/datasource-config.xml`

### Other components

- **Clinic user**

## Connections

- Clinic user → Spring MVC: uses presentation (evidence: `readme.md`)
- Spring MVC → Clinic service: calls service (evidence: `readme.md`)
- Spring MVC → JSP views: renders views (evidence: `readme.md`)
- Spring MVC → MVC configuration: configured by (evidence: `readme.md`)
- Clinic service → Repository layer: uses repository (evidence: `readme.md`)
- Clinic service → Clinic records: manages records
- Repository layer → JPA implementation: selects implementation (evidence: `readme.md`)
- Repository layer → JDBC implementation: selects implementation (evidence: `readme.md`)
- Repository layer → Spring Data JPA: selects implementation (evidence: `readme.md`)
- JPA implementation → Configured database: persists records
- JDBC implementation → Configured database: persists records
- Spring Data JPA → Configured database: persists records
- Business configuration → Clinic service: configures transactions (evidence: `readme.md`)
- Datasource configuration → Configured database: configures connection
