Skip to content

github-copilot-workshop/copilot-petclinic

Repository files navigation

Spring PetClinic Sample Application Build Status

This project is a copy of the https://github.com/spring-projects/spring-petclinic.git modified to be used with GitHub Copilot to learn how to use it.

Run Petclinic locally

Spring Petclinic is a Spring Boot application built using Maven or Gradle. You can build a jar file and run it from the command line (it should work just as well with Java 17 or newer):

git clone https://github.com/github-copilot-workshop/copilot-petclinic.git
cd copilot-petclinic
./mvnw package
java -jar target/*.jar

You can then access the Petclinic at http://localhost:8080/.

Or you can run it from Maven directly using the Spring Boot Maven plugin. If you do this, it will pick up changes that you make in the project immediately (changes to Java source files require a compile as well - most people use an IDE for this):

./mvnw spring-boot:run

Test Applications

At development time we recommend you use the test applications set up as main() methods in PetClinicIntegrationTests (using the default H2 database and also adding Spring Boot Devtools), MySqlTestApplication and PostgresIntegrationTests. These are set up so that you can run the apps in your IDE to get fast feedback and also run the same classes as integration tests against the respective database. The MySql integration tests use Testcontainers to start the database in a Docker container, and the Postgres tests use Docker Compose to do the same thing.

Using GitHub Copilot

The project contains some exercises to learn how to use GitHub Copilot. You can find them in the docs folder.

License

The Spring PetClinic sample application is released under version 2.0 of the Apache License.