Code Monkey home page Code Monkey logo

movie-api's Introduction

Movie-API

Develop an API project based on a public API to meet a set of requirements. Project developed using Movie API: Get movie recommendations based on inputted criteria, e.g. year/genre/actor/ratings/certification. Checks added for the age of who will be watching. This project was developed using Java 17.


Key Features of Solution

  • Backend-only app
  • Users need to interact with API using Postman
  • Create API endpoints with the appropriate HTTP verbs
  • API must call the public API and use the returned data to solve the problem
  • API base URL and endpoints must be appropriately named
  • Good separation of concerns, clean and readable
  • Good coverage of tests
  • Applied error and exception handling considerations in API design
  • Include a /health endpoint to give the health of the application

Assumptions

  • User has access to postman and is aware of end points (included below)
  • Application will use movies only (no tv programmes)
  • Adult movies will not be included

Approaches

  • Sketch and plan ideas first
  • Draw UML
  • Model View Controller (MVC) approach with Spring boot
  • Custom Exceptions to account for invalid requests
  • Testing periodically visited (more Agile than TDD)

SSD

This is an image

UML

This is an image


Run Application

  • To run this application - run from "ApiApplication.java"
  • Access the API from software such as Postman (or browser)
  • Runs from http://localhost:8081/api/v1/
  • For endpoints and usage, see below:

Movie

/movie/{movieId}
Returns: movie object
Get the movie info. for a movie with a particular id
e.g. /movie/20

/movie/{movieId}/recommendations
Returns: list of movie objects
Get a list of movie recommendations based on the movie with the given Id
E.g. /movie/20/recommendations

/movie/{movieId}/similar
Returns: list of movie objects
Get a list of similar movies based on the movie with the given id
E.g. /movie/20/similar

/movie/actor?actor1={actor1Id}&actor2={actor2Id}
Returns: list of movie objects
Get a list of movies that the actors with the given ids has appeared it. Actor 2 is optional.
E.g. /movie/actor?actor1=31&actor2=12898
/movie/actor?actor1=31

/movie/{movieId}/director
Returns: a director object
Get the director name based on the movie with the given id
E.g. /movie/20/director

/movie/genrelist
Returns: list of genre objects
Get the genres (categories) available for movies
E.g. /movie/genrelist

/movie/popularMovies
Returns: list of movie objects
Get all the currently popular movies
E.g. /movie/popularMovies

/movie/topRatedMovies
Returns: list of movie objects
Get all the top rated movies
E.g. /movie/topRatedMovies

/movie/latestMovie
Returns: a movie object
Get the latest movie that has been added to the external api
E.g. /movie/latestMovie

/movie/{movieId}/actors
Returns: list of actor objects
Get the actors that appear in the movie with the given id
E.g. /movie/20/actors

/movie/findMovies
Returns: a list of movie objects
Get movies using certain parameters (ALL optional)

  • Rating - gte
  • Release from date (default 1900-01-01 in YYYY-MM-DD format) - gte
  • Genre
  • Runtime (in minutes) - gte

E.g. /movie/findMovies?rating=9.0&genre=28&date_from=2000-10-02&time_available=90

/movie/random
Returns: a random movie
Get a completely random movie
E.g. movie/random

movie/rating?rateMin={rateMin}&rateMax={rateMax}
Returns a list of movie objects
Get a list of movie objects between a specific minimum rating and maximum rating. The maximum rating is optional
E.g. movie/rating?rateMin=7.2&rateMax=9.2
/rating?rateMin=9.0

/movie/upcoming
Returns: list of movie objects
Get a list of movies
E.g. /movie/upcoming

Actor

/actor/{actorId}
Returns: an actor object
Get the actor by the given id
E.g. /actor/2

/actor/popular
Returns: list of actor objects
Get the current popular actors
E.g. /actor/popular

Search

/search/movie/{searchTerm}
Returns: a list of movie objects
Get a list of movies based on a search term
E.g. /search/movie/”the lord of the rings”

/search/actor/{searchTerm}
Returns: a list of actor objects
Get a list of actors based on a search term
E.g. /search/actor/”tom”

Reviews

/movie/{movieId}/reviews
Returns a list of review objects
Get a list of review objects for a particular movie with the given Id
E.g. /movie/28/reviews


Future Considerations

  • Create frontend
  • Create accounts
  • Users can create a list of movies to watch
  • Create list of users
  • Each user can have a list with favourite movies/actors
  • Review Movies
  • Suggest movie considering the weather
  • User can share list of own favourite movies
  • Tell platform (netflix, amazon, HBO, …) where you can watch that movie
  • Rate Movies
  • Deploy API into a cloud service (AWS, GCP, Azure)
  • API usage for TV programmes
  • Add Database
  • User can give suggestions for API improvement
  • Each movie has a recommendation of food/drinks (from food API) and order from delivery apps (UberEats, Deliveroo)
  • User can have a list of movies to watch in a day selected by user or random criteria

movie-api's People

Contributors

hvferreira avatar dwright1989 avatar muheem avatar simplecodeingithub 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.