# spring-projects/spring-petclinic

> spring-petclinic is a sample Spring Boot application for developers who want to run a database-backed web app locally. When it starts, it fills an in-memory H2 database with default data and serves a web interface that reads and writes that data. The project is written in Java and built with Maven or Gradle.

Source: https://github.com/spring-projects/spring-petclinic
Indexed: commit 500158f on 2026-10-16 by Repowise. Facts come from the source and git history, not from the maintainer.

## Facts

- Type: App
- Language: CSS
- Stars: 9,662 at index time
- License: Apache-2.0
- Code health: 8.8/10, Excellent
- Last commit: 2026-09-29
- Contributors: 134

## Install

From the README: https://github.com/spring-projects/spring-petclinic

Clone the spring-petclinic repository.
    git clone https://github.com/spring-projects/spring-petclinic.git

Move into the spring-petclinic folder.
    cd spring-petclinic

Start the application with Maven.
    ./mvnw spring-boot:run

Or start the application with Gradle.
    ./gradlew bootRun

Build a container image with the Spring Boot build plugin, which needs a Docker daemon.
    ./mvnw spring-boot:build-image

## How it works

Requests enter through web controllers such as src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java, which handle creating and editing owners and pets. The domain classes in the owner package, such as Owner, build on shared entity types in src/main/java/org/springframework/samples/petclinic/model/BaseEntity.java and model/Person.java. Spring Data JPA saves these objects to the database chosen by the active Spring profile, which is H2 by default or MySQL or PostgreSQL when configured. The system package holds system-wide configuration and standalone controllers, and CacheConfiguration sets up caching. Thymeleaf renders the pages that the controllers return.

- src/main/java/org/springframework/samples/petclinic/model/BaseEntity.java: entry point
- src/main/java/org/springframework/samples/petclinic/model/NamedEntity.java: entry point
- src/main/java/org/springframework/samples/petclinic/model/Person.java: entry point
- src/main/java/org/springframework/samples/petclinic/owner/Owner.java: entry point
- src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java: entry point
Modules: src, .devcontainer. 80 files, 2,855 lines, 266 symbols.

## Code health

- Score: 8.8/10 (Excellent)
- Rank: not ranked (leaderboards need 100+ files)
- Hotspots: none
- Lowest file: src/main/java/org/springframework/samples/petclinic/owner/PetController.java
- Dead code: none found

## Maintenance

- Last commit 2026-09-29, first commit 2016-06-29, 522 commits
- 134 contributors, bus factor 2

## Security

- Security findings are shown to signed-in users at https://repowise.dev/repo/spring-projects/spring-petclinic/security

## More

- Page: https://repowise.dev/repo/spring-projects/spring-petclinic
- Ask this codebase: https://repowise.dev/repo/spring-projects/spring-petclinic/chat
- Docs: https://repowise.dev/repo/spring-projects/spring-petclinic/docs
- MCP (signs in with Repowise on first use):
    claude mcp add --transport http repowise https://api.repowise.dev/mcp/spring-projects/spring-petclinic
