movies
is a sample exercise to understand how to build basic a microservice using different programming languages.
Any implementation of movies
should:
- Respect a set of constraints (see Constraints section below)
- Follow the same API (see API section below)
The goal of this project is to be able to compare different technologies by offering the same system behavior.
Currently the following implementations are available:
Any implementation of movies
should respect the following constraints:
- Have a
README.md
file with at least the following sections:- Installation
- Testing
- Usage
- Have code coverage by unit tests greater or equal to 80%
- Read configuration values from a file
- Store movies in a database
- Log to a file
Any implementation of movies
should offer the following actions:
- Check microservice is alive
- Create a movie
- Find a specific movie
- Find a set of movies
- Update a movie
- Delete a movie
Each API call is specified below:
Request
Method: GET
URL: http://localhost:9001/movies/admin/ping
Response
pong
Request
Method: POST
URL: http://localhost:9001/movies/api/movies
Body:
{
"imdbId": "tt0133093",
"title": "The Matrix",
"runtimeInMinutes": 136,
"releaseDate": "1999-03-31T00:00",
"filmRating": "R",
"genre": "Action, Sci-Fi",
"director": "The Wachowski brothers",
"plot": "A computer hacker learns from mysterious rebels about the true nature of his reality and his role in the war against its controllers.",
"metascore": 73,
"imdbRating": 8.7,
"imdbVotes": 1023621
}
Response
{
"imdbId": "tt0133093"
}
Request
Method: GET
URL: http://localhost:9001/movies/api/movies/tt0133093
Response
{
"imdbId": "tt0133093",
"title": "The Matrix",
"runtimeInMinutes": 136,
"releaseDate": "1999-03-31T00:00",
"filmRating": "R",
"genre": "Action, Sci-Fi",
"director": "The Wachowski brothers",
"plot": "A computer hacker learns from mysterious rebels about the true nature of his reality and his role in the war against its controllers.",
"metascore": 73,
"imdbRating": 8.7,
"imdbVotes": 1023621
}
Request
Method: GET
URL: http://localhost:9001/movies/api/movies?title=Matrix&runtimeInMinutes=130&metascore=6&imdbRating=7.2&imdbVotes=1000
Response
[
{
"imdbId": "tt0133093",
"title": "The Matrix",
"runtimeInMinutes": 136,
"releaseDate": "1999-03-31T00:00",
"filmRating": "R",
"genre": "Action, Sci-Fi",
"director": "The Wachowski brothers",
"plot": "A computer hacker learns from mysterious rebels about the true nature of his reality and his role in the war against its controllers.",
"metascore": 73,
"imdbRating": 8.7,
"imdbVotes": 1023621
}
]
Request
Method: PUT
URL: http://localhost:9001/movies/api/movies/tt0133093
Body:
{
"imdbId": "tt0133093",
"title": "The Matrix2",
"runtimeInMinutes": 136,
"releaseDate": "1999-03-31T00:00",
"filmRating": "R",
"genre": "Action, Sci-Fi",
"director": "The Wachowski brothers and some others",
"plot": "A computer hacker meets agent Smith.",
"metascore": 83,
"imdbRating": 8.7,
"imdbVotes": 1023621
}
We changed the title, director, plot and the metascore.
Response
{
"imdbId": "tt0133093",
"title": "The Matrix2",
"runtimeInMinutes": 136,
"releaseDate": "1999-03-31T00:00",
"filmRating": "R",
"genre": "Action, Sci-Fi",
"director": "The Wachowski brothers and some others",
"plot": "A computer hacker meets agent Smith.",
"metascore": 83,
"imdbRating": 8.7,
"imdbVotes": 1023621
}
Request
Method: DELETE
URL: http://localhost:9001/movies/api/movies/tt0133093
Response
{
"The movie was deleted?": true
}
This project is under the MIT License. See the LICENSE file for the full license text.