Git Product home page Git Product logo

moviestorage's Introduction

MovieStorage

Architecture

The application consists in 2 main parts:

  1. API: A simple SpringBoot application that creates some endpoints to manipulate data (see API Enpoints section).
  2. Database: An in-memory H2 database is used to store data.

Data model

image info

API Endpoints

Get movie

  • URL: /getMovies
  • Params: N/A
  • HTTP Method: GET
  • Description: Returns the movies saved

Save movie

  • URL: /saveMovie
  • Params: N/A
  • HTTP Method: POST
  • Description: Saves the movie defined as JSON in the request body

Update movie

  • URL: /updateMovie
  • Params: id -> ID of the movie you want to update
  • HTTP Method: PUT
  • Description: Updates the movie which ID is specified as parameter.

Delete movie

  • URL: /deleteMovie
  • Params: id -> ID of the movie you want to delete
  • HTTP Method: DELETE
  • Description: Deletes the movie which ID is specified as parameter.

List

  • URL: /list
  • Params:
    • fields -> List of fields to order by.
    • title -> Title filter.
    • page -> Number of the page to return.
    • size -> Size of the page to return.
  • HTTP Method: GET
  • Description: Returns a filtered, sorted and paginated list of movies.

Examples

getMovies

  [
    {
        "id": 3,
        "title": "C99",
        "rating": 9.2,
        "yearPremiered": 1991,
        "genres": [
            {
                "id": 1,
                "name": "Comedy"
            },
            {
                "id": 2,
                "name": "SciFi"
            }
        ]
    },
    {
        "id": 4,
        "title": "Python2",
        "rating": 8.0,
        "yearPremiered": 2007,
        "genres": [
            {
                "id": 1,
                "name": "Comedy"
            },
            {
                "id": 2,
                "name": "SciFi"
            }
        ]
    },
    {
        "id": 5,
        "title": "Python2.7",
        "rating": 8.9,
        "yearPremiered": 2008,
        "genres": [
            {
                "id": 1,
                "name": "Comedy"
            },
            {
                "id": 2,
                "name": "SciFi"
            }
        ]
    },
    {
        "id": 6,
        "title": "Python3.10",
        "rating": 7.55,
        "yearPremiered": 2019,
        "genres": [
            {
                "id": 1,
                "name": "Comedy"
            },
            {
                "id": 2,
                "name": "SciFi"
            }
        ]
    }
]

saveMovie

{
    "title": "Python3.10",
    "rating": 7.55,
    "yearPremiered": 2019,
    "genres":
        [
            {
                "name": "Comedy"
            },
            {
                "name": "SciFi"
            }
        ]
    
}
  • Response body:
{
    "id": 6,
    "title": "Python3.10",
    "rating": 7.55,
    "yearPremiered": 2019,
    "genres": [
        {
            "id": 1,
            "name": "Comedy"
        },
        {
            "id": 2,
            "name": "SciFi"
        }
    ]
}

filter

[
    {
        "id": 6,
        "title": "Python3.10",
        "rating": 7.55,
        "yearPremiered": 2019,
        "genres": [
            {
                "id": 1,
                "name": "Comedy"
            },
            {
                "id": 2,
                "name": "SciFi"
            }
        ]
    },
    {
        "id": 5,
        "title": "Python2.7",
        "rating": 8.9,
        "yearPremiered": 2008,
        "genres": [
            {
                "id": 1,
                "name": "Comedy"
            },
            {
                "id": 2,
                "name": "SciFi"
            }
        ]
    },
    {
        "id": 4,
        "title": "Python2",
        "rating": 8.0,
        "yearPremiered": 2007,
        "genres": [
            {
                "id": 1,
                "name": "Comedy"
            },
            {
                "id": 2,
                "name": "SciFi"
            }
        ]
    }
]

updateMovie

{
    "id": 6,
    "title": "Python2",
    "rating": 7.00,
    "yearPremiered": 1995,
    "genres":
        [
            {
                "name": "Comedy"
            },
            {
                "name": "SciFi"
            }
        ]
    
}
  • Response body:
{
    "id": 6,
    "title": "Python2",
    "rating": 7.00,
    "yearPremiered": 1995,
    "genres":
        [
            {
                "name": "Comedy"
            },
            {
                "name": "SciFi"
            }
        ]
    
}

deleteMovie

moviestorage's People

Contributors

urkx 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.