Back to Mid Level

API-first Scala backend


Prerequisite
  • Use Scala for the backend (Prefrably Akka HTTP)
  • Use PostgreSQL database
  • Dockerize the application so that it can be run end-to-end using docker-compose up

Requirements

  • Upload endpoint - /api/upload
    • POST-BODY: a pipe (|) delimitted TXT file. Output: HTTP 201 response with JSON output of the number of lines in the file. JSON output shall contain the id of the upload (each new uplaod results in an incremented <upload_id>).
    • Action: The data extracted (parsed) from the uploaded file is persisted into a PostgreSQL database. The format of the file will be: <order_id> | <product_name> | <product_quantity>. Example: 2 | Eggs | 20
    • Sample Response:
      {"upload_id": 1}
      
  • Read Endpoint - /api/upload/<upload_id>
    • GET: Pass in the <upload id>. Output: HTTP 200 response with JSON output of the upload id
    • Action: Fetch the details for the passed in <upload_id>
    • Sample Response
      {"upload_id": 1, "number_of_rows": 5, "items": "Egg, Bread, Butter, Milk, Corn"}
      

Deliverable

  • A docker-compose file so we can clone the repo and run docker-compose up to test the endpoints.
  • Unit and/or Integration tests.
  • A great README with instructions on how to run everything locally (Including API docs)
  • A GitHub repo with read permissions given to GitHub users rafty8s,bsneider, omnipresent07, and barakstout (how to invite collaborators)