This app allows you to create, read, update, or delete a pet of your choice. The storage is in-memory and will not persist between app runs.
- The only field populated by user in
name
,createdAt
andid
are auto-generated by the service createdAt
is a ZonedDateTimename
is limited to 16 characterstodo
s in code represent points for future improvement- Future.successful wrapper in PetService imitates an async response from a DB
name
is not unique, there might be many pets with the same name- Malformed UUID in GET request returns 405, need to handle this scenario more gracefully
See Swagger for detailed API documentation.
The project is written in Scala 2.13. I recommend using Java 17 or higher.
The build system is SBT - I am using the latest version, currently 1.9.9.
I use Akka HTTP in this implementation.
$ sbt test
$ sbt run
The application starts on localhost:8080
by default.
- Deployment - can be deployed with Heroku
- For storage, a simple SQL solution with
petId
as primary key is sufficient - Implement authorisation with JWT in auth headers
- Store secrets in an external key-vault