Skip to content

AleksandraZochowska/CodersCamp2020.Project.FullStack-Node-React.MovieMatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Movie Match!

CodersCamp 2020 - Project Node.js

Table of contents

General info

The aim of this project was to create back-end for Awesome Movie Match application. Awesome Movie Match is meant to be a platform for people to create movie collections & find people with similar movie interests.

Project was created during CodersCamp Course in Feb - Mar 2021 using Node.js.

API - endpoints

USERS

Route Method Description Only for logged in users
/api/users GET Returns users: if email or displayedName is specified in query, returns matching results - otherwise returns all users. Yes.
/api/users/avatar/:userid GET Returns avatar of user with given id. Yes.
/api/users/register POST Sends email with confirmation link. Requires providing email, name, displayedName & password in request body. No.
/api/users/login POST Returns logged in user & authorization token. Requires providing email & password in request body. No.
/api/users/forgotpassword POST Sends email with reset link. Requires providing email in request body. No.
/api/users/avatar POST Sets user avatar. Requires providing avatar in request body. Yes.
/api/users/register/:registrationtoken PUT Activates user account. Requires providing a valid registrationtoken No.
/api/users/resetpassword/:resettoken PUT Resets user password. Requires providing a valid resettoken as param & newPassword in request body No.
/api/users/:id/password PATCH Changes user's password to new one, provided in request body. Yes.
/api/users/:id PATCH Depending on provided request body, changes user's: name, or displayedName, or email. Yes.
/api/users/:id DELETE Deletes user's account. Requires providing password in request body. Yes.

FRIENDS

Route Method Description Only for logged in users
/api/friends GET Returns friends: if name or displayedName is specified in query, returns matching results - otherwise returns all friends. Yes.
/api/friends/:friendid GET Returns details of a friend with given id: name, displayedName. Yes.
/api/friends/invite/:friendid POST Sends friend invitation to the user with given id. Yes.
/api/friends/accept/:invitationid POST Accepts friend invitation with given id. Yes.
/api/friends/decline/:invitationid POST Declines friend invitation with given id. Yes.
/api/friends/invitations GET Shows active invitations of user whose id is provided via token. Yes.

MOVIES

Route Method Description Only for logged in users
/api/movies GET Returns list of movies matching "title" query. Yes.
/api/movies/suggest GET Returns list of movie suggestions. Yes.
/api/movies/:movieid GET Returns details of movie with specified id. Yes.
/api/movies/:movieid POST Adds movie with specified id to user's collection. Yes.
/api/movies/:movieid DELETE Removes movie with specified id from users collection. Yes.

API - usage examples

USERS

Register user:

Send POST request to: https://awesome-movie-match.herokuapp.com/api/users/register

Example of request body:

{
    "email": "[email protected]",
    "name": "Thadeus",
    "displayedName": "Thadeus",
    "password": "Thadeus1*"
}

Confirm registration:

Send PUT request to: https://awesome-movie-match.herokuapp.com/api/users/register/:registrationtoken

Where :registrationtoken is a valid registration token (received via email).

Login user:

Send POST request to: https://awesome-movie-match.herokuapp.com/api/users/login

Example of request body:

{
    "email": "[email protected]",
    "password": "Thadeus1*"
}

Edit user's information:

Send PATCH request to: https://awesome-movie-match.herokuapp.com/api/users/:id

Where :id is a valid user's id.

Example of request body:

{
    "name": "Thad",
    "displayedName": "Thad",
    "email": "[email protected]"
}

You need to provide ONE of the above options (not more, not less).

Forgot pasword - send email with reset token:

Send POST request to: https://awesome-movie-match.herokuapp.com/api/users/forgotpassword

Example of request body:

{
    "email": "[email protected]"
}

Set user's avatar:

Send POST request to: https://awesome-movie-match.herokuapp.com/api/users/avatar

Example of request body:

{
    "avatar": <file>
}

Search user:

Send GET request to: https://awesome-movie-match.herokuapp.com/api/users

Available query options (all optional):

displayedName
email
limit
page

If you provide email or displayed name, it has to be one OR the other. limit sets the number of records per page. page sets the number of returned page.

FRIENDS

Send friend request:

Send POST request to: https://awesome-movie-match.herokuapp.com/api/friends/invite/:friendid

Where :friendid is a valid id of another user.

Accept friend request:

Send POST request to: https://awesome-movie-match.herokuapp.com/api/friends/accept/:invitationid

Where :invitationid is a valid id of an invitation.

Decline friend request:

Send POST request to: https://awesome-movie-match.herokuapp.com/api/friends/decline/:invitationid

Where :invitationid is a valid id of an invitation.

Show friend's profile:

Send GET request to: https://awesome-movie-match.herokuapp.com/api/friends/:friendid

Where :friendid is a valid friend's id.

Search friend:

Send GET request to: https://awesome-movie-match.herokuapp.com/api/friends

Available query options (all optional):

displayedName
name
limit
page

If you provide name or displayed name, it has to be one OR the other. limit sets the number of records per page. page sets the number of returned page.

MOVIES

Search movie:

Send GET request to: https://awesome-movie-match.herokuapp.com/api/movies

If you want to search for movie by title, provide title query.

Show movie suggestions :

Send GET request to: https://awesome-movie-match.herokuapp.com/api/movies/suggest

Show movie details:

Send GET request to: https://awesome-movie-match.herokuapp.com/api/movies/:movieid

Where :movieid is a valid movie id (e.g. tt0903625).

Add movie to user's collection:

Send POST request to: https://awesome-movie-match.herokuapp.com/api/movies/:movieid

Where :movieid is a valid movie id (e.g. tt0903625).

Remove movie from user's collection:

Send DELETE request to: https://awesome-movie-match.herokuapp.com/api/movies/:movieid

Where :movieid is a valid movie id (e.g. tt0903625).

Toggle movie in user's collection between watched / not watched:

Send PATCH request to: https://awesome-movie-match.herokuapp.com/api/movies/:movieid

Where :movieid is a valid movie id (e.g. tt0903625).

Technologies

Project was created with:

Project scope

  • REST API
  • creating user account
  • authorization & authentication, user permissions, Json Web Token
  • using database (NoSQL or SQL)
  • integration with external system (e.g. e-mail sending)
  • testing

Team

Development:

Tech Lead:
Product Owner:
Development Manager:

Mentor:

Live Preview

To see our project, visit:

https://awesome-movie-match.herokuapp.com