This repository contains a very simple application that provides a REST interface. It lets pet owners submit and list visits and vets accept and reject visits. All visit information are stored in a (in-memory) database.
We use this project as a starting point to create and refactor to a Clean-/Onion-style Architecture.
To run the application, the following should be installed:
- git
- JDK (e.g., AdoptOpenJDK)
- Optionally, Apache Maven
In the command line, run the following:
git clone https://github.com/fortiss-cce/pet-visits-service.git
cd pet-visits-service
./mvnw spring-boot:run
To see and try out the API, go to http://localhost:8080/swagger-ui/
To have a look into the database, go to http://localhost:8080/h2-console/
Login using the following config:
Field | Value |
---|---|
JDBC URL |
jdbc:h2:mem:petvisitsdb |
User name |
sa |
Password |
can be left empty |
The config and initial data can be edited in
application.yml
and data.sql
inside src/main/resources/
.
Currently, our application supports one SQL repository and one REST controller to provide both actors (pet owners, vets) the respective two use cases.
Soon, we plan to maybe add or switch to a MongoDB repository for storage and a GraphQL controller to provide the use cases.
The task is to add and change the classes and interfaces and to shape the dependencies in order to ease future developers these planned technology additions.
- Create a fork of this repository
- Refactor/extend the code to achieve a clean architecture
- keep the SOLID principles in mind
- keep the clean architecture principles in mind
- high cohesion inside a package
- low coupling between packages
- Javadoc and extensive error handling can be disregarded for the purpose of this exercise
- Create a pull request to submit you proposals