Git Product home page Git Product logo

desafiotexoit's Introduction

Worst Movie Awards API

This is an API created by me for my TexoIT job interview. It is designed to return the award winners of the Golden Raspberry Awards for worst picture separated by producers and grouped by the difference in time to get their previous and following award. The API runs on a default 8080 port, needs no external software installation except for Java SDK 1.8 and Maven.

How to set up the project

1 - The project uses Spring, flyway and H2 dependencies. I recommend getting Maven as dependency manager, as the next steps consider you're using it to run the API.

2 - Clone the master branch of the repository, that is the release branch for this interview.

3 - Navigate to the root folder of the project (where you can find the pom.xml file) through the system explorer or a command line prompt.

4 - Execute the following command to run the API:

mvn spring-boot:run This will start the Spring API and load the default movielist.csv into the memory, which is stored in the classpath.

OPTIONAL: you can pass an argument in the command line to recursevily search .csv files. The api checks the first line of the header to make sure it is a valid "movielist" file.

mvn spring-boot:run -Dspring-boot.run.arguments=--databasefiller.folder="YOUR FOLDER HERE"

OPTIONAL 2: If you are running it from and IDE, such as STS, you can set the arguments in the launch/debug configurations. During development I used STS 4.12.1, and the argument syntax was different.

--databasefiller.folder="YOUR FOLDER HERE"

How to run tests in the API

The following maven command will run the api Use the command: mvn test

OPTIONAL:

mvn test -Ddatabasefiller.folder="YOUR FOLDER HERE"

Swagger docs

Once the API is running, the swagger doc becomes available.

http://localhost:8080/api/swagger-ui/index.html?configUrl=/api/v3/api-docs/swagger-config#/get-worst-movie-award-interval-controller/a

How to make calls to the api

This API has a single GET endpoint, it can be called through the browser by inserting the url in the address bar and sending, or through a dedicated tool such as Postman. Once the API is running, it can be called through the following URL:

http://localhost:8080/api/worstMovie/getIntervals

Expected outcome

{
    "min": [
        {
            "producer": "Joel Silver",
            "interval": 1,
            "previousWin": 1990,
            "followingWin": 1991
        }
    ],
    "max": [
        {
            "producer": "Matthew Vaughn",
            "interval": 13,
            "previousWin": 2002,
            "followingWin": 2015
        }
    ]
}

desafiotexoit's People

Contributors

lukatxd avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.