Git Product home page Git Product logo

uade-movie-api's People

Contributors

jaime-human avatar pawap90 avatar

Stargazers

 avatar

Watchers

 avatar

uade-movie-api's Issues

[Endpoint] api/rate

The endpoint will receive the body, extract the account id from the jwt, and insert everything on the rates collection.

Route: api/rate
Method: POST
Requires authorization
Body:

  • MediaType (string: 'movie' or 'series')
  • MediaId (Number)
  • Rating (Number - 1 to 10)
  • Comment (string)

The account id can be retrieved from the jwt.

Rate model:

  • Account Id (ObjectId - required)
  • MediaType (string - required)
  • MediaId (Number - required)
  • Rating (Number - required)
  • Comment (string - required)

Authorization

Build authorization middleware that verifies the JWT from the Authorization header.

[Endpoint] GET api/rate/:mediaType/:mediaId

The endpoint will receive the media type and id through the route params, extract the account id from the jwt, get all rates for the specified media (movie or series) and set ratedByMe=true on the rates that were created by the current user.

Route: api/rate/:mediaType/:mediaId
Method: GET
Requires authorization

The account id must be retrieved from the jwt.

[Endpoint] Account register

Endpoint: /api/account/register
Method: POST
Body: Receives email, name, lastName, password, genres (string array)
Inserts the account info into the account collection
The endpoint doesn't return any data

Note: The account model must be updated to store an array of genres

Also add the swagger documentation

[Endpoint] GET api/list

Returns the current user's lists.
The endpoint will extract the account id from the jwt and search the list collection for lists that match the account id.

Route: api/list
Method: GET
Requires authorization

The account id can be retrieved from the jwt.

[Endpoint] DELETE api/list/:listId/item/:mediaType/:mediaId

Removes a media item from the specified list (:listId).
The endpoint will receive the list id in the route params, extract the account id from the jwt, and remove the received media item from the specified list.

Note: Must validate that the current user owns the specified list (one user cannot modify another user's lists).

Route: api/list/:listId/item/:mediaType/:mediaId
Method: DELETE
Requires authorization

The account id can be retrieved from the jwt.

[Endpoint] POST api/list/item

Adds a media item to the current user's default list.
The endpoint will receive the media item in the body, extract the account id from the jwt, and add the received media item to the current user's default list.

Route: api/list/item
Method: POST
Requires authorization
Body:

  • mediaType (string: 'movie' or 'series')
  • mediaId (Number)
  • mediaTitle
  • mediaDescription,
  • mediaImagePath,
  • mediaGenres (string array),
  • mediaYear

The account id can be retrieved from the jwt.

[Endpoint] POST api/list

The endpoint will receive the list data on the body, extract the account id from the jwt and insert a new list with empty media items on the list collection.

Route: api/list
Method: POST
Body:

  • name
  • isPublic

Requires authorization

The account id must be retrieved from the jwt.

Also create the list model:

    - isDefault 
    - name 
    - accountId
    - isPublic
    - mediaItems: [
        {
            type
            id,
            title,
            description,
            imagePath,
            genres (string array),
            year
        }
    ]

[Endpoint] PUT api/list/:listId

The endpoint will receive the list data on the body, the list id on the route params, extract the account id from the jwt and update the specified list's data.

Note: Must validate that the current user owns the specified list (one user cannot modify another user's lists).

Route: api/list/:listId
Method: PUT
Body:

  • name
  • isPublic

Requires authorization

The account id must be retrieved from the jwt.

[Endpoint] DELTE api/list/:listId

The endpoint will receive the list id on the route params, extract the account id from the jwt and delete the specified list.

Note: Must validate that the current user owns the specified list (one user cannot modify another user's lists).

Route: api/list/:listId
Method: DELETE

Requires authorization

The account id must be retrieved from the jwt.

[Endpoint] PUT api/account

The endpoint will allow the current user to update their account data.

Route: api/account
Method: PUT
Requires authorization
Body:
name, lastName, genres

The account id can be retrieved from the jwt.

Login

Enter email and password, authorize and get JWT

[Endpoint] POST api/list/:listId/item

Adds a media item to the specified list (:listId).
The endpoint will receive the list id in the route params, the media item in the body, extract the account id from the jwt. Finally it will add the provided media item into the specified list id.

Note: Must validate that the current user owns the specified list (one user cannot modify another user's lists).

Route: api/list/:listId/item
Method: POST
Requires authorization

The account id can be retrieved from the jwt.

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.