Skip to content

prudhvi46/java-tech-task

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lunch Microservice

The service provides an endpoint that will determine, from a set of recipes, what I can have for lunch at a given date, based on my fridge ingredient's expiry date, so that I can quickly decide what I’ll be having to eat, and the ingredients required to prepare the meal.

Prerequisites

Note: Docker is used for the local MySQL database instance, feel free to use your own instance or any other SQL database and insert data from lunch-data.sql script

Run

  1. Start database:

    docker-compose up -d
    
  2. Add test data from sql/lunch-data.sql to the database. Here's a helper script if you prefer:

    CONTAINER_ID=$(docker inspect --format="{{.Id}}" lunch-db)
    
    docker cp sql/lunch-data.sql $CONTAINER_ID:/lunch-data.sql
    
    docker exec $CONTAINER_ID /bin/sh -c 'mysql -u root -prezdytechtask lunch </lunch-data.sql'
    
  3. Run Springboot LunchApplication

  4. Moved db access logic to RecipeRepository

  5. Added LunchService interface which is implemented by LunchServiceImpl

  6. Added error handling code

  7. Added unit tests to check Lunch api

  8. Extended /lunch/recipes exclusion of ingredients functionality to also has an inclusion option where recipes that contain specified ingredients will be returned - Prudhvi

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%