CodersCamp 2020 - Project Node.js
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.
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. |
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. |
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. |
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*"
}
Send PUT request to:
https://awesome-movie-match.herokuapp.com/api/users/register/:registrationtoken
Where :registrationtoken
is a valid registration token (received via email).
Send POST request to:
https://awesome-movie-match.herokuapp.com/api/users/login
Example of request body:
{
"email": "[email protected]",
"password": "Thadeus1*"
}
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).
Send POST request to:
https://awesome-movie-match.herokuapp.com/api/users/forgotpassword
Example of request body:
{
"email": "[email protected]"
}
Send POST request to:
https://awesome-movie-match.herokuapp.com/api/users/avatar
Example of request body:
{
"avatar": <file>
}
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.
Send POST request to:
https://awesome-movie-match.herokuapp.com/api/friends/invite/:friendid
Where :friendid
is a valid id of another user.
Send POST request to:
https://awesome-movie-match.herokuapp.com/api/friends/accept/:invitationid
Where :invitationid
is a valid id of an invitation.
Send POST request to:
https://awesome-movie-match.herokuapp.com/api/friends/decline/:invitationid
Where :invitationid
is a valid id of an invitation.
Send GET request to:
https://awesome-movie-match.herokuapp.com/api/friends/:friendid
Where :friendid
is a valid friend's id.
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.
Send GET request to:
https://awesome-movie-match.herokuapp.com/api/movies
If you want to search for movie by title, provide title
query.
Send GET request to:
https://awesome-movie-match.herokuapp.com/api/movies/suggest
Send GET request to:
https://awesome-movie-match.herokuapp.com/api/movies/:movieid
Where :movieid
is a valid movie id (e.g. tt0903625).
Send POST request to:
https://awesome-movie-match.herokuapp.com/api/movies/:movieid
Where :movieid
is a valid movie id (e.g. tt0903625).
Send DELETE request to:
https://awesome-movie-match.herokuapp.com/api/movies/:movieid
Where :movieid
is a valid movie id (e.g. tt0903625).
Send PATCH request to:
https://awesome-movie-match.herokuapp.com/api/movies/:movieid
Where :movieid
is a valid movie id (e.g. tt0903625).
- Node.js(https://nodejs.org/)
- Express.js(https://expressjs.com)
- MongoDB(https://www.mongodb.com/)
- Mongoose(https://mongoosejs.com)
- EJS(https://ejs.co)
- OMDb API(http://www.omdbapi.com)
- nodemailer(https://nodemailer.com/about/)
- 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
To see our project, visit: