Skip to content

AnastasiiaZu/pet-crud-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to PetApp

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.

Assumptions and improvement points

  1. The only field populated by user in name, createdAt and id are auto-generated by the service
  2. createdAt is a ZonedDateTime
  3. name is limited to 16 characters
  4. todos in code represent points for future improvement
  5. Future.successful wrapper in PetService imitates an async response from a DB
  6. name is not unique, there might be many pets with the same name
  7. Malformed UUID in GET request returns 405, need to handle this scenario more gracefully

API

See Swagger for detailed API documentation.

Requirements

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.

Test

$ sbt test

Run

$ sbt run

The application starts on localhost:8080 by default.

Improvements for production

  1. Deployment - can be deployed with Heroku
  2. For storage, a simple SQL solution with petId as primary key is sufficient
  3. Implement authorisation with JWT in auth headers
  4. Store secrets in an external key-vault

About

Pet app to create, update, and delete pets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages