Intro
00:00:00Creating an Advanced Music Player Application Build and deploy a modern reactions music player application with exceptional design, genre selection, top songs display, Spotify-like music player functionalities (previous song, next song, repeat shuffle), search feature for popular songs and artists. Explore trending artists and worldwide charts. Detailed song pages with official music videos and lyrics. Mobile responsive app offering native Music Player experience.
Mastering Web Development Technologies Learn to develop professional web applications using in-demand technologies like React, Tailwind CSS, Redux toolkit along with Shazam API integration for geolocation services. Beginner-friendly course covering folder structure best practices in React development including hooks usage. Team project by three students showcasing coding expertise through JSM masterclass experience focusing on problem-solving skills and industry trends awareness.
Setup
00:06:31Project Setup Overview Setting up the project by downloading and extracting provided files from a Google Drive link. Installing dependencies using npm install, including Redux toolkit, axios, react router Dom, and Swiper. Exploring the source folder structure with assets like music genres and components with empty files except for the pre-defined logic in the music player component.
File Structure Breakdown Introduction to file organization within folders such as Redux store.js configuration and features for managing music player actions. Explanation of app.js setting up routes calling empty components that need to be created later on. Brief overview of index.css for color overrides, importing Tailwind CSS; index.js importing styles and setting up routing for application development.
Discover Section
00:12:38Building the Discover Page Creating the Discover Page: The Discover page will serve as the central hub for importing and organizing various components. Starting with div structures, genre pickers, fetching songs from an API, adding hover effects to display artwork beautifully.
Styling Components Effectively Styling and Rendering Components: Utilizing Tailwind CSS classes for styling elements like flexbox layout, select component design with dynamic genre options rendering. Setting up song card components within a wrapper div to display fetched songs in a visually appealing manner.
Redux Implementation for Song Fetching Implementing Redux Toolkit Structure: Integrating Redux toolkit structure by configuring store provider in index.jsx file. Focusing on new functionalities such as fetching songs from Shazam core API using services folder within Redux setup.
Rapid API Music Fetching
00:23:50Configuring Shazam Core for Fetching Music Data Setting up the main file 'Shazam core.js' to focus on making API calls using Rapid API client extension. Installing and configuring the extension, creating a new project named 'lyrics', fetching top charts data from Rapid API with required parameters and headers.
Implementing Redux Toolkit Structure for APIs Generating code snippets for TypeScript types and JavaScript fetch function using Rapid API extension. Setting up Redux toolkit structure including creating an API, defining base query, preparing headers, building endpoints like get top charts query.
Utilizing Fetched Data States in Components Exploring how to use generated code in calling APIs within React components. Demonstrating handling of fetched data states like actual data result, isFetching property for loading state indication, error property detection.
Handling Dynamic Parameter Passing Resolving issues encountered during endpoint definition by correcting the usage of functions instead of static strings. Adapting dynamic parameter passing through functions to handle real-time data retrieval effectively within Redux toolkit setup.
Loader Component
00:39:16Implementing a loader component by importing assets and defining its structure with an image tag for the loader icon, followed by an H1 element displaying either the title or 'loading'.
Error Component
00:40:50Utilizing the Error Component to display an error message without needing additional imports. The rapid div is rendered with specific class names and includes an H1 element displaying a static error message.
Song Card Component
00:41:50Creating Dynamic Song Cards with React and Redux Implementing a Song Card Component in React to display 50 songs as individual cards. Reusing the component for each song, pulling real-time data from Rapid API and using Redux for state management.
Enhancing Functionality of Song Cards with Interactive Features Adding functionality to the Song Card Component including play/pause buttons, hover effects, and dynamic content rendering such as song title, subtitle, artist details. Linking each card to specific song details pages.
Incorporating Music Player Controls Using Redux Toolkit Hooks Integrating music player controls within the components by passing props like 'song' data and functions for handling play/pause actions. Utilizing Redux toolkit hooks like useDispatch and useSelector to manage global state effectively.
Completing Implementation & Testing Music Player Functionality Finalizing the implementation by ensuring proper interaction between components such as displaying pause/play icons based on active songs. Testing functionality of music player features within the application environment.
Play/Pause Functionality
00:59:48Implementing Play/Pause Functionality To enable the play/pause functionality in the music player, we use dispatch to make changes to the song being played. Dispatch allows us to add chocolate powder or dressing to the cake analogy, representing actions on the state. By using dispatch with 'set active song' and 'play pause', we can control playing and pausing songs effectively.
Continuing Application Development After completing music player functionality, further development includes creating sidebar, search bar, top charts components, genre picker integration, and additional pages for top artists and charts. Reusability of components is emphasized throughout development process for efficiency in building application features like around you section showcasing reuse of song card component.
Sidebar
01:05:38Implementing Sidebar To implement the sidebar, import necessary components like useState hook from React, nav link from react-router-dom, and icons. Define a state for mobile menu visibility. Create a reusable navigation component to display links with names and icons. Style the sidebar for desktop and mobile devices separately by checking if handle click function exists.
Creating Mobile Sidebar Create an absolute positioned div for the mobile sidebar that toggles between displaying close icon or menu icon based on mobile menu open state. Copy existing desktop menu structure but style it differently using dynamic class names to show/hide based on mobile menu open status. Implement functionality to toggle the visibility of the mobile sidebar when clicking on respective icons.
Adding Top Charts Widget Integrate top charts widget into application layout next to songs section showing top 5 artists and charts with 'See More' option leading to corresponding pages creation in future development phase.
Top Play Section
01:19:00Implementing Top Play Component Dependencies and State Initialization To implement the top play component, we start by importing necessary dependencies like useEffect, useRef, Link from react-router-dom, useSelector and useDispatch from Redux. We also import swiper components for creating a swipe feature. Next, we set up states using useState hooks and fetch data using a custom query hook. Then we initialize dispatch function to control play and pause functionality along with setting up the initial state of songs to display in the top charts section.
Creating Visual Layout for Top Play Component In this chapter, we focus on creating the visual layout of our top play component. We structure JSX elements within divs to organize content properly. The design includes displaying 'Top Charts' heading with a link for more details followed by individual song cards mapped over the list of top songs fetched earlier. Each card represents one song entry in our chart display.
Top Chart Card
01:28:03Building Top Chart Card Component Creating a top chart card with instant return functionality. The div is styled with classes for flex layout, background color, padding, cursor pointer, and margin. It renders the song title passed through props along with its index.
Adding Top Artist Swiper Implementing the top artist swiper by reusing code from the top charts section. A new div is created for displaying top artists similar to how it was done for top charts.
Top Artist - Swiper Component
01:30:57Creating Swiper Component with Dynamic Song Rendering Rendering the Swiper component with specified options like 'slides per view', space between slides, free mode, centered slides, and modules. Looping over top plays to render each song in a swiper slide with key, style properties for image display.
Designing Layout for Top Chart Card & Adding Play Pause Functionality Designing the layout for Top Chart Card displaying index numbers and cover art of top songs. Including links to song details and artist pages dynamically based on song data. Implementing play pause buttons functionality by passing necessary props from parent components.
Implementing State Management with Redux Utilizing Redux state management to synchronize music playback across different UI components including Discover page, top charts widget, and music player component. Ensuring seamless interaction between playing songs from sidebar or widget reflects accurately in all sections of the app interface.
Song Details Page
01:42:50Utilizing useParams for Song Details Component Import 'useParams' from React Router DOM to access the song ID from the URL. The song ID is crucial for fetching specific song details.
Setting Up Redux Components Import necessary components like useSelector, useDispatch, and various components related to player functionality. Initialize dispatch and fetch data using Redux toolkit selectors.
Structuring Song Details Display Create JSX structure for displaying song details including artist information, lyrics section with conditional rendering based on available data.
Fetching Real-Time Data Using Queries 'Use getSongDetailsQuery' hook to fetch real-time data about a specific song including lyrics. Implement error handling and loading states during API calls.
Dynamic Header Rendering Implement dynamic component 'DetailsHeader' that displays artist or song details based on page context. Utilize Link component from React Router DOM for navigation purposes.
'Related Songs Integration' Integrate related songs display by making additional API call using 'getSongRelatedQuery'. Create reusable 'songBar' component similar to top charts but with minor differences in content.
'Completing Layout & Functionality'}]} Finalize the Song Details Page layout by adding loader and error handling functionalities as well as mapping over related songs array dynamically rendered through the 'songBar' component.
Artist Details Page
02:12:53Creating Artist Details Page Implementing the artist details page involves creating a new component similar to the song details component. Changes include using 'get artist details' endpoint instead of 'get song details', updating imports, and modifying props passed to related songs.
Building Around You Page Developing the around you page requires importing hooks like useState and useEffect, axios for API calls, and useSelector from Redux. Components used are error, loader, and song card. State variables for country selection and loading status are initialized within a function block.
Around You, Top Charts & Artists
02:20:50Fetching Active Song & Country Info To fetch the active song and country information, we set 'Around You' to true. Using a useEffect hook, we make an API call to Geo ipify API upon page visit or country change. By registering on geo.ipify.org, obtaining an API key, and making a request with axios.get(), we retrieve the user's country code.
Displaying Top Charts The structure for displaying top charts is similar to 'Around You'. Reusing components allows easy implementation of different sections like top charts. The use of Redux toolkit simplifies making calls and writing reusable React code.
Showcasing Top Artists Implementing the 'Top Artists' section involves creating artist cards using track data from get top artists query. Each card displays the artist's image as album art along with their name below it. Clicking on an artist navigates users to that specific artist's details page.
Search
02:36:31Implementing Search Bar Component Focus on enhancing the search bar component by styling it and making it functional. Add form with autocomplete off, label for search field, a search icon, and an input field with specific attributes like name, placeholder, type. Apply class names to style the search bar beautifully.
Fetching Different Genres Enhance functionality to fetch various music genres such as pop, hip-hop, dance electronically K-pop. Utilize dispatch function in Redux to select genre list ID based on user selection. Implement new endpoint 'get songs by genre' in API service to retrieve songs of selected genre.
Dynamic Genre Selection and Loading States Update UI dynamically based on selected genre title using Redux state management. Modify display text according to chosen genres like Hip Hop or Pop instead of static titles only showing Pop previously. Ensure loading states work smoothly when switching between different genres.
Search Functionality Implementation Develop the functionality for searching songs/artists through a dedicated page linked from the search bar component's submission action via React Router Dom params hook usage Retrieve data using 'get songs by search' endpoint from Shazam core services Display results dynamically matching searched terms like One Republic BTS Doja Cat showcasing album covers
Deployment
02:52:48Deploying Application Using Netlify JavaScript Mastery tutorial demonstrates how to deploy an application using Netlify, enabling sharing with friends and potential employers. The deployment process involves signing up or logging in to Netlify, running 'npm run build' command, and uploading the application files quickly. Users can customize site settings like changing the site name before checking their app online.
Joining JSM Masterclass Experience JSM Masterclass offers interview preparation, educational materials, mock interviews reviews of portfolios/CVs/LinkedIn/GitHub, monthly group projects for hands-on learning. Students gain advanced coding knowledge through mentorship to showcase expertise in building successful projects efficiently for freelance clients. Future cohorts will provide similar project-building opportunities with mentor support upon registration via email notification.