Skip to content

graemerocher/micronaut-petclinic

 
 

Repository files navigation

Micronaut PetClinic Sample Application

This Petclinic is a Micronaut application which I forked from Spring PetClinic and tried to migrate from Spring to Micronaut to know how Micronaut works. I respect Spring so much, and I think I should replace Spring logos with Micronaut logos to avoid confusion.

Running petclinic locally

1. Clone Project

git clone https://github.com/bufferings/micronaut-petclinic.git
cd micronaut-petclinic

2. Start PostgreSQL

This Petclinic uses PostgreSQL. You could start PostgreSQL with docker:

docker run -p "5432:5432" -e POSTGRES_DB=petclinic -e POSTGRES_PASSWORD=petclinic postgres:11.2-alpine

3. Run Application

./mvnw compile exec:exec

4. Access PetClinic

You can then access petclinic here: http://localhost:8080/

Or you can run it from JAR

./mvnw package
java -jar target/*.jar

GraalVM Native Image

This PetClinic supports GraalVM native image build.

./mvnw package && docker build -t micronaut-petclinic .

I usually have ☕ (around 10 mins on my laptop) to wait for the build finishes.

Use Docker compose to start the application:

docker-compose up

It starts in 300-400ms.

License

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

TODO

  • Basic features with Micronaut
  • Native Image
  • Logging
  • Validation
  • Error Handling
  • Cache
  • Hot Reloading?
  • Tests
  • Management

About

A sample Micronaut-based application forked from Spring PetClinic

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 81.1%
  • HTML 12.1%
  • CSS 6.6%
  • Dockerfile 0.2%