It can take sometimes take longer to chose a movie than to watch it!
This Movie API allows users to retrieve movie recommendations based on a search criteria - only 3 movie recommendations are returned based on the iMDB ratings.
This API recommends provides the following end points:
- No filter, e.g. /movies
- Year, e.g. movies/year/2019 or year/startYear=1990&endYear=1995
- Genre, e.g. movies/genre/family
- Person, e.g. movies/person/Harrison Ford
- Name of movie, e.g. movies/name/Star Wars
and returns a result in JSON format.
An optional emailAddress parameter can be used to send the recommendations via email through integration with Twilio's SendGrid platform.
The full specification can be seen at: http://api.movi3.me.uk/swagger-ui/index.html
- Java SE Development Kit 11
- Maven
- Java
- Spring Boot
- MySQL
- Lombok
- H2 Database
- Swagger
- AWS
- Docker
- SendGrid
- You can run the unit tests in IntelliJ, or you can go to your terminal and inside the root of this directory, run:
mvn test
-
Download or clone the repository from GitHub git clone https://github.com/sairaawan/movie-api.git
-
Database set-up
The data used for this project is from iMDb.
A subset of the data available is described at https://www.imdb.com/interfaces is used, which can be downloaded from https://datasets.imdbws.com.
Instructions are available here - DB Setup instructions -
Configuration of application properties and environment variables
The application requires configuration of the following environment variables to run:
| prod_movieDB | e.g. yourdomain:3306/imdb |
| prod_db_user | user account for production database |
| prod_db_pwd | password for prod db user |
| test_movieDB | e.g. localhost:3306/imdb |
| test_db_user | user account for test database/imdb |
| test_db_pwd | password for test db user |
| sendgrid_api_key | your SendGrid API key |
| mail_from | email from address |
| test_email | email address to use for testing |
- Running the application
mvn clean installjava -jar target/api-movies-data-0.0.1
The application default port is 8080 and hence all endpoints can be accessed starting from http://localhost:8080
The project is deployed as Docker image on AWS Elastic beanstalk. Visit http://api.movi3.me.uk/movies to view the API.
The Main Entry Point for the application is: MovieApiApplication.java