Click to view
- Download dependencies by running
npm install - Start up the app using
npm start
Functionalities
The app have the following functionalities
-
Initially, the app should be in light theme
-
Login Route
- When a invalid username and password are provided and the Login button is clicked, then the respective error message received from the response should be displayed
- When a valid username and password are provided and the Login button is clicked, then the page should be navigated to the Home route
- When an unauthenticated user, tries to access the
HomeRoute,TrendingRoute,GamingRoute,SavedVideosRoute,VideoDetailsRoute, then the page should be navigated to Login route - When an authenticated user, tries to access the
HomeRoute,TrendingRoute,GamingRoute,SavedVideosRoute,VideoDetailsRoute, then the page should be navigated to the respective route - When an authenticated user tries to access the
LoginRoute, then the page should be navigated to the Home route - When show password checkbox is checked, then the password should be shown
- When show password checkbox is unchecked, then the password should be masked
-
Home Route
- When an authenticated user opens the Home Route,
- An HTTP GET request should be made to homeVideosApiUrl with query parameter as
searchand its initial value as empty string- Loader should be displayed while the HTTP request is fetching the data
- After the data is fetched successfully, display the list of videos received in the response
- If the HTTP GET request made is unsuccessful, then the Failure view should be displayed
- When the Retry button is clicked, an HTTP GET request should be made to homeVideosApiUrl
- When a non-empty value is provided in the Search Input and button with search icon is clicked
- Make an HTTP GET request to the homeVideosApiUrl with
jwt_tokenin the Cookies and query parametersearchwith value as the text provided in the Search Input - Loader should be displayed while the HTTP request is fetching the data
- After the data is fetched successfully, display the list of videos received in the response
- Make an HTTP GET request to the homeVideosApiUrl with
- When the HTTP GET request made to the homeVideosApiUrl returns an empty list for videos then No Videos View should be displayed
- An HTTP GET request should be made to homeVideosApiUrl with query parameter as
- When the website logo image is clicked, the page should be navigated to the Home route
- When a Video is clicked, the page should be navigated to the Video Item Details route
- Clicks on the Trending link in the Sidebar is clicked, then the page should be navigated to the Trending route
- Clicks on the Gaming link in the Sidebar is clicked, then the page should be navigated to the Gaming route
- Clicks on the Saved Videos link in the Sidebar is clicked, then the page should be navigated to the SavedVideos route
- When an authenticated user opens the Home Route,
-
Trending Route
- When an authenticated user opens the Trending Route,
- An HTTP GET request should be made to trendingVideosApiUrl
- Loader should be displayed while the HTTP request is fetching the data
- After the data is fetched successfully, display the list of videos received in the response
- If the HTTP GET request made is unsuccessful, then the Failure view should be displayed
- When the Retry button is clicked, an HTTP GET request should be made to trendingVideosApiUrl
- An HTTP GET request should be made to trendingVideosApiUrl
- When the website logo image is clicked, the page should be navigated to the Home route
- When a Video is clicked, the page should be navigated to the Video Item Details route
- Clicks on the Home link in the Sidebar is clicked, then the page should be navigated to the Home route
- Clicks on the Gaming link in the Sidebar is clicked, then the page should be navigated to the Gaming route
- Clicks on the Saved Videos link in the Sidebar is clicked, then the page should be navigated to the SavedVideos route
- When an authenticated user opens the Trending Route,
-
Gaming Route
- When an authenticated user opens the Gaming Route,
- An HTTP GET request should be made to gamingVideosApiUrl
- Loader should be displayed while the HTTP request is fetching the data
- After the data is fetched successfully, display the list of videos received in the response
- If the HTTP GET request made is unsuccessful, then the Failure view should be displayed
- When the Retry button is clicked, an HTTP GET request should be made to gamingVideosApiUrl
- An HTTP GET request should be made to gamingVideosApiUrl
- When the website logo image is clicked, the page should be navigated to the Home route
- When a Video is clicked, the page should be navigated to the Video Item Details route
- Clicks on the Home link in the Sidebar is clicked, then the page should be navigated to the Home route
- Clicks on the Trending link in the Sidebar is clicked, then the page should be navigated to the Trending route
- Clicks on the Saved Videos link in the Sidebar is clicked, then the page should be navigated to the SavedVideos route
- When an authenticated user opens the Gaming Route,
-
Video Item Details Route
-
When an authenticated user opens the Video Item Details route
- An HTTP GET request should be made to videoItemDetailsApiUrl with
jwt_tokenin the Cookies andvideo_idas path parameter- loader should be displayed while the HTTP request is fetching the data
- After the HTTP request is successful, the response received should be displayed
- If the HTTP GET request made is unsuccessful, then the Failure view should be displayed
- When the Retry button is clicked, an HTTP GET request should be made to videoItemDetailsApiUrl
- An HTTP GET request should be made to videoItemDetailsApiUrl with
-
Corresponding video should be displayed using
react-playerpackage -
Initially, all the three buttons (Like, Dislike, Save) will be inactive
-
When the Like button is clicked,
- It will change to an active state
- If the Dislike button is already in the active state, then the Dislike button needs to be changed to the inactive state
-
When the Dislike button is clicked,
- It will change to an active state
- If the Like button is already in the active state, then the Like button needs to be changed to the inactive state
-
When the Save button is clicked
- The button will change to an active state and the respective video details should be added to the list of saved videos
- Save button text will be changed to Saved
-
When the Saved button is clicked
- The button will change to an inactive state and the respective video details will be removed from the list of saved videos
- Saved button text will be changed to Save
-
-
SavedVideos Route
- When an authenticated user opens the SavedVideos Route,
- If the list of saved videos is empty, then No Saved Videos Found View should be displayed
- The Videos in the list of saved videos should be displayed as a list of videos
- When the website logo image is clicked, the page should be navigated to the Home route
- When a Video is clicked, the page should be navigated to the Video Item Details route
- Clicks on the Home link in the Sidebar is clicked, then the page should be navigated to the Home route
- Clicks on the Trending link in the Sidebar is clicked, then the page should be navigated to the Trending route
- Clicks on the Gaming link in the Sidebar is clicked, then the page should be navigated to the Gaming route
- When an authenticated user opens the SavedVideos Route,
-
Not Found Route
- When a random path is provided in the URL then the page should navigate to the Not Found route
-
When the theme button in the header is clicked, then the theme should be changed accordingly
-
Logout
- When the Logout button in the header is clicked, then the Logout Popup should be displayed
- When Cancel button is clicked, then the popup should be closed and the page should not be navigated
- When Confirm button is clicked, then the page should be navigated to the Login route
- When the Logout button in the header is clicked, then the Logout Popup should be displayed
API Requests & Responses
loginApiUrl
API: https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip
Returns a response containing the jwt_token
{
"jwt_token": "https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip nZDlFsnSWArLKKeF0QbmdVfLgzUbx1BGJsqa2kc_21Y"
}{
"status_code": 404,
"error_msg": "Username is not found"
}homeVideosApiUrl
API: https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip
Returns a response containing the list of all videos
{
"total": 60,
"videos": [
{
"id": "30b642bd-7591-49f4-ac30-5c538f975b15",
"title": "Sehwag shares his batting experience in iB Cricket | iB Cricket Super Over League",
"thumbnail_url": "https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip",
"channel": {
"name": "iB Cricket",
"profile_image_url": "https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip"
},
"view_count": "1.4K",
"published_at": "Apr 19, 2019"
},
...
],
}trendingVideosApiUrl
API: https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip
Returns a response containing the list of trending videos
{
"total": 30,
"videos": [
{
"id": "ad9822d2-5763-41d9-adaf-baf9da3fd490",
"title": "iB Hubs Announcement Event",
"thumbnail_url": "https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip",
"channel": {
"name": "iB Hubs",
"profile_image_url": "https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip"
},
"view_count": "26K",
"published_at": "Nov 29, 2016"
},
...
]
}gamingVideosApiUrl
API: https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip
Returns a response containing the list of gaming videos
{
"total": 30,
"videos": [
{
"id": "b214dc8a-b126-4d15-8523-d37404318347",
"title": "Drop Stack Ball",
"thumbnail_url": "https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip",
"view_count": "44K"
},
...
]
}videoItemDetailsApiUrl
API: https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip
Example: https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip
Returns a response containing the list of gaming videos
{
"video_details": {
"id": "ad9822d2-5763-41d9-adaf-baf9da3fd490",
"title": "iB Hubs Announcement Event",
"video_url": "https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip",
"thumbnail_url": "https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip",
"channel": {
"name": "iB Hubs",
"profile_image_url": "https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip",
"subscriber_count": "1M"
},
"view_count": "26K",
"published_at": "Nov 29, 2016",
"description": "iB Hubs grandly celebrated its Announcement Event in November 13, 2016, in the presence of many eminent personalities from the Government, Industry, and Academia with Shri Amitabh Kant, CEO, NITI Aayog as the Chief Guest."
}
}Click to view
- To build this project, take a look at the React Popup and React Video Player reading materials
import {formatDistanceToNow} from 'date-fns'
https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip(formatDistanceToNow(new Date(2021, 8, 20)))
// Return the distance between the given date and now in words.Click to view
Paths having this app
-
Homeroute should consist of/in the URL path -
Loginroute should consist of/loginin the URL path -
Trendingroute should consist of/trendingin the URL path -
Gamingroute should consist of/gamingin the URL path -
SavedVideosroute should consist of/saved-videosin the URL path -
VideoItemDetailsroute should consist of/videos/:idin the URL path -
No need to use the
BrowserRouterinhttps://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zipas we have already included inhttps://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip -
User credentials
username: rahul password: rahul@2021
Image URLs
-
https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip
-
https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip
-
https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip alt should be profile
-
https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip
-
https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip
-
https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip alt should be no videos
-
https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip alt should be no saved videos
-
https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip
-
https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip
-
https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip Banner Background image
-
https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip alt should be facebook logo
-
https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip alt should be twitter logo
-
https://raw.githubusercontent.com/vicky9696v/NxtWatch-React/main/src/React-Nxt-Watch-3.6-alpha.1.zip alt should be linked in logo
Colors
Font-families
- Roboto