Enhanced OTT Platform: My List Feature Backend Development
- Clone the repository
git clone https://github.com/vaibhav-raj/my-list.git
- Install dependencies
cd my-list
npm install
- Build and run the project
npm run dev
Navigate to http://localhost:3000/api
Deployed endpoint : https://my-list-rphj.onrender.com/api
Check out this route to know more about me: https://my-list-rphj.onrender.com/api/owner
Certainly! Here's a neatly organized version:
User Routes:
-
Create User:
- Endpoint:
POST /users
- Payload:
{ "username": "example_user", "preferences": { "favoriteGenres": ["Action", "Comedy"], "dislikedGenres": ["Horror", "Romance"] } }
- Endpoint:
-
Update User Preferences:
- Endpoint:
PUT /users/:userId
- Payload:
{ "preferences": { "favoriteGenres": ["Action", "Comedy", "Drama"], "dislikedGenres": ["Romance"] } }
- Note: Replace
:userId
with the actual user ID.
- Endpoint:
-
Add to Watch History:
- Endpoint:
POST /users/:userId/watch-history
- Payload:
{ "contentId": "content_id_123", "watchedOn": "2024-05-01T12:00:00Z", "rating": 4 }
- Note: Replace
:userId
with the actual user ID.
- Endpoint:
For adding favorite and disliked genres:
-
Add Favorite Genres for a User:
- Endpoint:
PUT /api/users/:userId/favoriteGenres
- Payload:
{ "favoriteGenres": ["Action", "Comedy", "SciFi"] }
- Example URL (assuming
userId
is123
):PUT /api/users/123/favoriteGenres
- Endpoint:
-
Add Disliked Genres for a User:
- Endpoint:
PUT /api/users/:userId/dislikedGenres
- Payload:
{ "dislikedGenres": ["Romance", "Drama"] }
- Example URL (assuming
userId
is123
):PUT /api/users/123/dislikedGenres
- Endpoint:
TV Show Routes:
-
Create TV Show:
- Endpoint:
POST /tv-shows
- Payload:
{ "title": "Example TV Show", "description": "This is an example TV show description.", "genres": ["Action", "Drama"], "episodes": [ { "episodeNumber": 1, "seasonNumber": 1, "releaseDate": "2024-05-01", "director": "Director Name", "actors": ["Actor 1", "Actor 2"] }, { "episodeNumber": 2, "seasonNumber": 1, "releaseDate": "2024-05-08", "director": "Director Name", "actors": ["Actor 1", "Actor 3"] } ] }
- Endpoint:
-
Get All TV Shows:
- Endpoint:
GET /tv-shows
- Endpoint:
-
Get TV Show by ID:
- Endpoint:
GET /tv-shows/:tvShowId
- Note: Replace
:tvShowId
with the actual TV show ID.
- Endpoint:
-
Update TV Show by ID:
- Endpoint:
PUT /tv-shows/:tvShowId
- Payload:
{ "description": "Updated description." }
- Note: Replace
:tvShowId
with the actual TV show ID.
- Endpoint:
-
Delete TV Show by ID:
- Endpoint:
DELETE /tv-shows/:tvShowId
- Note: Replace
:tvShowId
with the actual TV show ID.
- Endpoint:
My List Routes:
-
Add to My List:
- Endpoint:
POST /my-list/add-to-list/:userId/:contentId/:contentType
- Note: Replace
:userId
,:contentId
, and:contentType
in the URL.- Example URL:
/my-list/add-to-list/609c05587bc7d111e85c9c53/609c06f97bc7d111e85c9c5f/movie
- Example URL:
- Endpoint:
-
Remove from My List:
- Endpoint:
DELETE /my-list/remove-from-list/:userId/:contentId
- Note: Replace
:userId
and:contentId
in the URL.- Example URL:
/my-list/remove-from-list/609c05587bc7d111e85c9c53/609c06f97bc7d111e85c9c5f
- Example URL:
- Endpoint:
-
List My Items:
- Endpoint:
GET /my-list/list-my-items/:userId
- Note: Replace
:userId
in the URL.- Example URL:
/my-list/list-my-items/609c05587bc7d111e85c9c53
- Example URL:
- Endpoint:
Movie Routes:
-
Create Movie:
- Endpoint:
POST /movies
- Payload:
{ "title": "Example Movie", "description": "This is an example movie description.", "genres": ["Action", "Drama"], "releaseDate": "2024-05-01", "director": "Director Name", "actors": ["Actor 1", "Actor 2"] }
- Endpoint:
-
Get All Movies:
- Endpoint:
GET /movies
- Endpoint:
-
Get Movie by ID:
- Endpoint:
GET /movies/:movieId
- Note: Replace
:movieId
with the actual movie ID.
- Endpoint:
-
Update Movie by ID:
- Endpoint:
PUT /movies/:movieId
- Payload:
{ "description": "Updated description." }
- Note: Replace
:movieId
with the actual movie ID.
- Endpoint:
-
Delete Movie by ID:
- Endpoint:
DELETE /movies/:movieId
- Note: Replace
:movieId
with the actual movie ID.
- Endpoint:
These endpoints and payloads can be used in Postman to interact with the backend API for movie management.
- Vaibhav