Skip to content

spring-petclinic/spring-petclinic-flutter

Repository files navigation

Spring Petclinic Flutter

Flutter CI OSV Scanner Semgrep CodeQL

Flutter frontend for Spring Petclinic. This app targets Android and web, mirrors the functional flows of the Angular frontend, and uses the same REST backend exposed by spring-petclinic-rest.

The CI status includes static analysis, tests, the web build, and the Android debug APK build.

Screenshots

Web

Spring Petclinic owners screen on web Spring Petclinic owners details screen on web

Android

Spring Petclinic home screen on Android Spring Petclinic owner details screen on Android

Backend

Start the backend first:

cd ~/spring-petclinic-rest
./mvnw spring-boot:run

The expected API is:

http://localhost:9966/petclinic/api

API configuration

The app resolves the API base URL in this order:

  1. PETCLINIC_API_BASE_URL passed with --dart-define
  2. Platform default

Platform defaults:

  • Android emulator: http://10.0.2.2:9966/petclinic/api
  • Web: http://localhost:9966/petclinic/api
  • Other non-Android platforms: http://localhost:9966/petclinic/api

That logic lives in:

lib/shared/config/api_config.dart

Override it at runtime when needed:

flutter run --dart-define=PETCLINIC_API_BASE_URL=http://<host>:9966/petclinic/api

Use an explicit override when:

  • running on a physical Android device;
  • serving the web app against a backend that is not on localhost;
  • pointing the app to a shared/staging backend.

Run on Android

For an Android emulator:

cd ~/spring-petclinic-flutter
flutter pub get
flutter run

For a physical Android device, pass the host machine IP explicitly:

flutter run --dart-define=PETCLINIC_API_BASE_URL=http://<host>:9966/petclinic/api

Run on Web

For local browser development against the backend running on the same machine:

cd ~/spring-petclinic-flutter
flutter pub get
flutter run -d chrome

If the backend is not reachable at http://localhost:9966/petclinic/api, pass an override:

flutter run -d chrome --dart-define=PETCLINIC_API_BASE_URL=http://<host>:9966/petclinic/api

Build

Build an Android debug APK:

flutter build apk --debug

Build the web app:

flutter build web

Validation

Typical checks:

dart format --set-exit-if-changed .
flutter analyze
flutter test
flutter build apk --debug
flutter build web

GitHub Actions also runs dependency vulnerability scanning with OSV Scanner, an advisory Semgrep scan, and CodeQL analysis for workflow security.

Contributing

The issue tracker is the preferred channel for reporting bugs and proposing new features.

Please refer to CONTRIBUTING.md for detailed contribution guidelines, including the pull request process and contribution workflow.

About

Flutter frontend for Spring Petclinic, supporting Android and web with the Spring Petclinic REST backend.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages