# bespin-nova/was architecture

> Architecture diagram of the GitHub repository bespin-nova/was, 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/bespin-nova/was
- Repository: https://github.com/bespin-nova/was

## Overview

Spring PetClinic is a Java sample web application. Its documented principal flow follows a three-layer architecture: users access the presentation layer, which delegates to services and repositories. The repository layer can use an in-memory H2 database or an externally configured MySQL database. The README documents these layers and database options, but no source excerpts were provided, so finer-grained calls and feature-specific flows are not asserted.

Main entry points: [`src/main/java/org/springframework/samples/petclinic/web`](https://github.com/bespin-nova/was/tree/main/src/main/java/org/springframework/samples/petclinic/web) (Web controllers), [`src/main/java/org/springframework/samples/petclinic/service/ClinicServiceImpl.java`](https://github.com/bespin-nova/was/blob/main/src/main/java/org/springframework/samples/petclinic/service/ClinicServiceImpl.java) (Clinic service), [`src/main/java/org/springframework/samples/petclinic/repository`](https://github.com/bespin-nova/was/tree/main/src/main/java/org/springframework/samples/petclinic/repository) (Repositories)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Presentation"]
  node_web["Web controllers"]
  node_views["JSP views"]
end

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

subgraph group_persistence["Persistence"]
  node_repositories["Repositories"]
  node_jdbc["JDBC repositories"]
  node_jpa["JPA repositories"]
  node_springdata["Spring Data repositories"]
  node_database[("Database")]
end

node_user(("PetClinic user"))

node_user -->|"accesses"| node_web
node_web -->|"delegates to"| node_service
node_service -->|"delegates to"| node_repositories
node_repositories -->|"persists data"| node_database

click node_web "https://github.com/bespin-nova/was/tree/main/src/main/java/org/springframework/samples/petclinic/web"
click node_views "https://github.com/bespin-nova/was/tree/main/src/main/webapp/WEB-INF/jsp"
click node_service "https://github.com/bespin-nova/was/blob/main/src/main/java/org/springframework/samples/petclinic/service/ClinicServiceImpl.java"
click node_domain "https://github.com/bespin-nova/was/tree/main/src/main/java/org/springframework/samples/petclinic/model"
click node_repositories "https://github.com/bespin-nova/was/tree/main/src/main/java/org/springframework/samples/petclinic/repository"
click node_jdbc "https://github.com/bespin-nova/was/tree/main/src/main/java/org/springframework/samples/petclinic/repository/jdbc"
click node_jpa "https://github.com/bespin-nova/was/tree/main/src/main/java/org/springframework/samples/petclinic/repository/jpa"
click node_springdata "https://github.com/bespin-nova/was/tree/main/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa"

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_web,node_views,node_user toneBlue
class node_service,node_domain toneAmber
class node_repositories,node_jdbc,node_jpa,node_springdata,node_database toneMint
```

## Components

### Presentation

- [Web controllers](https://github.com/bespin-nova/was/tree/main/src/main/java/org/springframework/samples/petclinic/web): `src/main/java/org/springframework/samples/petclinic/web`
- [JSP views](https://github.com/bespin-nova/was/tree/main/src/main/webapp/WEB-INF/jsp): `src/main/webapp/WEB-INF/jsp`

### Business domain

- [Clinic service](https://github.com/bespin-nova/was/blob/main/src/main/java/org/springframework/samples/petclinic/service/ClinicServiceImpl.java): `src/main/java/org/springframework/samples/petclinic/service/ClinicServiceImpl.java`
- [Clinic domain](https://github.com/bespin-nova/was/tree/main/src/main/java/org/springframework/samples/petclinic/model): `src/main/java/org/springframework/samples/petclinic/model`

### Persistence

- [Repositories](https://github.com/bespin-nova/was/tree/main/src/main/java/org/springframework/samples/petclinic/repository): `src/main/java/org/springframework/samples/petclinic/repository`
- [JDBC repositories](https://github.com/bespin-nova/was/tree/main/src/main/java/org/springframework/samples/petclinic/repository/jdbc): `src/main/java/org/springframework/samples/petclinic/repository/jdbc`
- [JPA repositories](https://github.com/bespin-nova/was/tree/main/src/main/java/org/springframework/samples/petclinic/repository/jpa): `src/main/java/org/springframework/samples/petclinic/repository/jpa`
- [Spring Data repositories](https://github.com/bespin-nova/was/tree/main/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa): `src/main/java/org/springframework/samples/petclinic/repository/springdatajpa`
- **Database**

### Other components

- **PetClinic user**

## Connections

- PetClinic user → Web controllers: accesses (evidence: `readme.md`)
- Web controllers → Clinic service: delegates to (evidence: `readme.md`)
- Clinic service → Repositories: delegates to (evidence: `readme.md`)
- Repositories → Database: persists data (evidence: `readme.md`)
