Register
Submit a solution
The challenge is finished.

Challenge Overview

Problem Description

Help Cody write a diet-planner to stay Lean and Agile without too much bloat! In this challenge, we will help Cody by creating a web-app to optimize meal-planning. Given a list of food items and some constraints, we will need to calculate a good meal plan.

Medium

In this task, we will create a simple backend API to support our meal-planner app.

The backend should contain a JSON REST API on port 8080 with the following endpoints:

  • POST /food
    • with body
      • "foodName" - string
      • "calorieCount" - integer
      • "yummy" - integer
    • Using this endpoint will add the submitted food to the app
    • Response should be {"msg": "OK"}
  • GET /foods
    • returns a list of foods that have been added through the POST /food endpoint. In any order.
  • POST /reset
    • removes all submitted foods
    • Response should be {"msg": "OK"}

For example,

POST /food
{
  "foodName": "Baguette",
  "calorieCount": 350,
  "yummy": 100
}

=>

{"msg": "OK"}

and

GET /foods

=>

[{
  "foodName": "Baguette",
  "calorieCount": 350,
  "yummy": 100
}]

Technology Stack

  • Programming language: No limitation
  • Docker

Sample submissions and tester

Feel free to use the sample servers in this repository as a starting point for your submission.

Submission Deliverables

Submit a zip file. Inside the zip file, there needs to be a folder name code. Inside the code folder, you need to have a Dockerfile which we will use to build the image and start your application by starting a container using the image. The code folder can contain other folders and files but it needs to contain the Dockerfile. The zip file too can contain other folders and files, but it needs to have the code folder at the ROOT.

Constraints & Guidelines

  • Please use the forums to ask any questions.
  • Minimal code quality is expected for the reviewer to review the submission and go through your code
  • Obvious and deliberate code obfuscation will be rejected.
  • Collaborating/Cheating in any way with anyone else (member or not) during a rated event is considered cheating.
    • An excessive amount of unused content should be avoided.

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30353315