<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Abhirup Kumar Bhowmick</title>
    <description>The latest articles on Forem by Abhirup Kumar Bhowmick (@abhirup2003).</description>
    <link>https://forem.com/abhirup2003</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1236380%2F2c2a61af-ebdd-4d15-a7c6-688438fe408b.jpg</url>
      <title>Forem: Abhirup Kumar Bhowmick</title>
      <link>https://forem.com/abhirup2003</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/abhirup2003"/>
    <language>en</language>
    <item>
      <title>Building a Music Recommendation System using Emotion Detection</title>
      <dc:creator>Abhirup Kumar Bhowmick</dc:creator>
      <pubDate>Tue, 06 May 2025 04:13:11 +0000</pubDate>
      <link>https://forem.com/abhirup2003/building-a-music-recommendation-system-using-emotion-detection-10d5</link>
      <guid>https://forem.com/abhirup2003/building-a-music-recommendation-system-using-emotion-detection-10d5</guid>
      <description>&lt;h1&gt;
  
  
  Music Recommendation Through the Lens of Emotion Detection
&lt;/h1&gt;

&lt;p&gt;In today's digital age, personalized experiences are paramount. From tailored shopping suggestions to curated news feeds, we've come to expect technology to understand and cater to our individual preferences. Music is no exception. While traditional music recommendation systems often rely on listening history, genre preferences, or collaborative filtering, a more nuanced approach involves understanding the listener's current emotional state. This blog post explores the fascinating intersection of emotion detection and music recommendation, detailing how we built a system that recommends music based on how you're feeling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Unveiling Emotions: The Foundation of Our System
&lt;/h2&gt;

&lt;p&gt;The first crucial step in building an emotion-aware music recommendation system is accurately detecting human emotions. This is a complex task, as emotions are subtle and multifaceted. Our approach focused on analyzing facial expressions, a powerful indicator of a person's internal state. We utilized the FER2013 dataset, which is widely used for facial emotion recognition and contains images categorized into seven distinct emotions: angry, disgusted, fearful, happy, neutral, sad, and surprised.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F72gkda5se1xjo2futkuv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F72gkda5se1xjo2futkuv.png" alt="Image description" width="800" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We explored various methods for facial emotion recognition, primarily leveraging the power of Convolutional Neural Networks (CNNs). CNNs are a class of deep learning models particularly well-suited for analyzing visual data like images. We experimented with building custom CNN architectures from scratch, carefully designing layers and configurations to effectively learn features from facial images that correlate with different emotions.&lt;/p&gt;

&lt;p&gt;Our initial attempts involved a VGG-inspired architecture. We carefully designed its layers and configurations to effectively learn features from facial images that correlate with different emotions. Through training on the FER2013 dataset, this model yielded an accuracy of 51.98%.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftmh9ri2k1goq5kpvt8ly.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftmh9ri2k1goq5kpvt8ly.png" alt="Image description" width="800" height="564"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3czvziylz5mlhj45vfw6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3czvziylz5mlhj45vfw6.png" alt="Image description" width="800" height="564"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Building upon this, we then explored a custom ResNet-inspired model. This architecture, known for its deeper structure and residual connections, showed improved performance in learning complex facial features. Training this custom ResNet-inspired model on the FER2013 dataset resulted in a higher accuracy of 73.15%.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqklak9xp1hf4jlvks1hc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqklak9xp1hf4jlvks1hc.png" alt="Image description" width="800" height="564"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxt6f3nsvab0x2z5ezw5e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxt6f3nsvab0x2z5ezw5e.png" alt="Image description" width="800" height="564"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In addition to custom models, we also investigated the use of pre-trained models. These models, trained on massive datasets for image recognition tasks, have already learned to identify a wide range of visual patterns. We explored fine-tuning a pre-trained ResNet50 model, adapting its learned knowledge to the specific task of facial emotion recognition. This involved adjusting the model's later layers to classify emotions based on the features it had already learned to extract. This approach proved to be the most effective, resulting in a final accuracy of 92.8%. The fine-tuned pre-trained ResNet50 model consistently outperformed the custom CNN architectures, demonstrating its effectiveness in this task. This is likely due to the vast amount of data the pre-trained model was initially exposed to, allowing it to develop a robust understanding of visual hierarchies and features that are also relevant to facial expressions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fafdn80ry4ovor5otvyhz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fafdn80ry4ovor5otvyhz.png" alt="Image description" width="800" height="329"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Crafting the Soundtrack to Your Mood: The Music Recommendation Engine
&lt;/h2&gt;

&lt;p&gt;With a reliable emotion detection system in place, the next step was to build a music recommendation engine that could leverage this emotional understanding. Our goal was to provide music that aligns with or helps to enhance the detected emotion.&lt;/p&gt;

&lt;p&gt;Our music recommendation system was built around a curated collection of songs categorized by emotion. We compiled lists of songs associated with various emotional states, such as happy, sad, angry, neutral, fearful, disgusted, and surprised. This categorization was based on a combination of factors, including lyrical content, musical style, and common associations.&lt;/p&gt;

&lt;p&gt;To access and play music, we integrated with a music streaming service using the Spotipy library, a Python library for the Spotify Web API. This allowed us to programmatically search for and play songs from our categorized lists based on the emotion detected.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Harmony of Emotion and Music: Bringing It All Together
&lt;/h2&gt;

&lt;p&gt;The true innovation of our system lies in the seamless integration of emotion detection and music recommendation. The process unfolds as follows:&lt;/p&gt;

&lt;p&gt;First, the system captures a facial image of the user. This image is then fed into the trained emotion detection model. The model analyzes the facial features and outputs a predicted emotional state.&lt;/p&gt;

&lt;p&gt;Once the emotion is detected (e.g., happy, sad, calm), the system accesses the corresponding category of songs in our curated music collection. Using the Spotipy library, it then selects and plays a song from that category.&lt;/p&gt;

&lt;p&gt;This creates a dynamic and personalized music listening experience. Instead of relying on static preferences, the system adapts to the user's current mood, offering a soundtrack that resonates with their feelings. Feeling down? The system might recommend uplifting tunes. Feeling stressed? Perhaps calming melodies are in order.&lt;/p&gt;

&lt;p&gt;By combining the power of computer vision for emotion detection with a carefully curated music library and seamless integration with a music streaming service, we've created a system that goes beyond traditional recommendation methods, offering a truly emotionally intelligent music experience. This approach opens up exciting possibilities for more personalized and empathetic interactions between humans and technology.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>tensorflow</category>
      <category>emotiondetect</category>
      <category>cnn</category>
    </item>
    <item>
      <title>How I Encountered the Problem and Built the Solution: PrepiQ</title>
      <dc:creator>Abhirup Kumar Bhowmick</dc:creator>
      <pubDate>Mon, 29 Jul 2024 12:17:44 +0000</pubDate>
      <link>https://forem.com/abhirup2003/how-i-encountered-the-problem-and-built-the-solution-prepiq-3lkh</link>
      <guid>https://forem.com/abhirup2003/how-i-encountered-the-problem-and-built-the-solution-prepiq-3lkh</guid>
      <description>&lt;h3&gt;
  
  
  The Problem: A Personal Struggle with Confidence
&lt;/h3&gt;

&lt;p&gt;For many of us, placement season is a really anxious time. As I prepared for my interviews, I became aware that, in spite of my thorough preparation, my confidence was lacking. It was unbearable to be asked difficult questions, especially ones that were customized to my credentials and the job description. I was aware that many of my friends felt the same way I did about this challenge. Even though we had the abilities and expertise needed for the position, we were all in the same situation — we lacked the confidence to shine during our interviews.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Eureka Moment: An Idea to Solve the Problem
&lt;/h3&gt;

&lt;p&gt;I had an idea one evening while watching a YouTube short: what if there was a way to mimic actual interview situations and get tailored feedback? What if we could use technology to create interview questions based on our job descriptions and resumes? This thought lit a fire under me. I was committed to developing a solution that would give self-conscious job seekers like myself the confidence they need to ace their interviews.&lt;/p&gt;

&lt;h3&gt;
  
  
  Building the Solution: The Birth of &lt;a href="https://prepiq.vercel.app" rel="noopener noreferrer"&gt;PrepiQ&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;I started my journey of developing, testing, and polishing with this aim in mind. &lt;a href="https://prepiq.vercel.app/" rel="noopener noreferrer"&gt;PrepiQ&lt;/a&gt; was created after 2 weeks of unrelenting work and restless nights. &lt;a href="https://prepiq.vercel.app/" rel="noopener noreferrer"&gt;PrepiQ&lt;/a&gt; is a SaaS mock interview driven by AI that aims to revolutionize interview preparation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why use &lt;a href="https://prepiq.vercel.app/" rel="noopener noreferrer"&gt;PrepiQ&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Personalized Interview Questions:&lt;/strong&gt; &lt;a href="https://prepiq.vercel.app/" rel="noopener noreferrer"&gt;PrepiQ&lt;/a&gt; creates interview questions based on your résumé, job description, firm name, and description using the Gemini 1.5 Flash (the most recent iteration of the Gemini Model). This gives you a major advantage over general interview preparation techniques as you get to practice with questions that are particularly relevant to the positions you are looking for.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2470%2F0%2Ac3dTt6aMyrVSkPU9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2470%2F0%2Ac3dTt6aMyrVSkPU9.png" alt="Personalized Interview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. AI Mock Interview:&lt;/strong&gt; You may practice for actual interviews using &lt;a href="https://prepiq.vercel.app/" rel="noopener noreferrer"&gt;PrepiQ&lt;/a&gt;. With the help of our immersive platform, you may rehearse answering questions in a setting that is scheduled just like an interview. This enhances your ability to respond appropriately and helps you become more at ease under pressure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2A8Dn-wx-qZIq9RTcy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2800%2F0%2A8Dn-wx-qZIq9RTcy.png" alt="AI Mock Interview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Comprehensive Feedback:&lt;/strong&gt; One of the standout features of &lt;a href="https://prepiq.vercel.app/" rel="noopener noreferrer"&gt;PrepiQ&lt;/a&gt; is its detailed feedback mechanism. After each mock interview, your video clip is transcribed to text, and then you receive personalized feedback highlighting your strengths and areas for improvement. Don’t worry, we don’t store your video. This feedback is crucial in helping you refine your answers and boost your confidence.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2448%2F0%2APP8gOR6vnGo2Iyss.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2448%2F0%2APP8gOR6vnGo2Iyss.png" alt="Comprehensive Feedback"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Credit Based Plans:&lt;/strong&gt; Our plans are cheaper than any other interview tool present on the internet. On signup, you get 5 credits. 1 credit for generating 10 practice questions and 4 credits for creating an interview. No credits are charged for generating answers to the question and also for creating custom jobs. Even if you exhaust your credits, we have 3 paid plans to get you covered. The &lt;em&gt;**Lite *&lt;/em&gt;&lt;em&gt;plan offers 10 credits, the *&lt;/em&gt;&lt;em&gt;Plus *&lt;/em&gt;&lt;em&gt;plan offers 25 credits, and the *&lt;/em&gt;&lt;em&gt;Pro *&lt;/em&gt;*plan covers 50 credits.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2704%2F1%2ACN5tqZjHdbWOk_OIkh8DEg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2704%2F1%2ACN5tqZjHdbWOk_OIkh8DEg.png" alt="Credit Based Plans"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Facing interviews with confidence is a game changer in the competitive job market. By providing personalized interview questions, AI mock interviews, and comprehensive feedback, PrepiQ equips you with the skills and confidence you need to ace your interviews.&lt;/p&gt;

&lt;p&gt;So, what are you waiting for? Check out &lt;a href="https://prepiq.vercel.app" rel="noopener noreferrer"&gt;PrepiQ&lt;/a&gt; now.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Guys, if this blog was useful for you, please give it a clap and share it with your friends who also want to crack interviews. And if you want more articles like this, follow me on Dev. Thanks for reading!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>interview</category>
      <category>career</category>
      <category>ai</category>
      <category>saas</category>
    </item>
    <item>
      <title>Build a Mobile Search Engine using Next.js in 10 minutes.</title>
      <dc:creator>Abhirup Kumar Bhowmick</dc:creator>
      <pubDate>Tue, 26 Dec 2023 07:24:25 +0000</pubDate>
      <link>https://forem.com/abhirup2003/build-a-mobile-search-engine-using-nextjs-in-10-minutes-2kpg</link>
      <guid>https://forem.com/abhirup2003/build-a-mobile-search-engine-using-nextjs-in-10-minutes-2kpg</guid>
      <description>&lt;h3&gt;
  
  
  A quick guide to building your own mobile search engine using Next.js
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmh0dyfqf4whkk83r4jy3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmh0dyfqf4whkk83r4jy3.png" alt="Mobile Search Engine" width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have you gone through all of NextJS 14’s features? It has evolved significantly and is now better than ever. If you’re having trouble building a website using Next.js 14, you’ve come to the right spot. In this article, I’m going to show you how to use Next.js 14 with Tailwind CSS to create a completely responsive mobile search engine.&lt;/p&gt;

&lt;p&gt;Project: &lt;a href="https://mobwiki.vercel.app/" rel="noopener noreferrer"&gt;https://mobwiki.vercel.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Github: &lt;a href="https://github.com/abhirupkumar/mobwiki" rel="noopener noreferrer"&gt;https://github.com/abhirupkumar/mobwiki&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started with Next.Js 14
&lt;/h2&gt;

&lt;p&gt;The first step will be to create a new project. The new project should be created in a directory, so open a terminal and create or go to that directory. Run the following command in a terminal once you’re there to start the project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    npx create-next-app@latest mobwiki
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create the project in the following way:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ucwwqq3fl6hwq494vdf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ucwwqq3fl6hwq494vdf.png" alt="Installing Next.js Guide" width="800" height="154"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your project will look like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsar413amjvp8ujsysfy2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsar413amjvp8ujsysfy2.png" alt="Sample Code" width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now as you can see, open the terminal and run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open your browser and search &lt;a href="http://localhost:3000/" rel="noopener noreferrer"&gt;http://localhost:3000/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6nhzyl3w7bnn06haatnh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6nhzyl3w7bnn06haatnh.png" alt="Sample Page" width="800" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the follow command in the terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    npm install @emotion/react @emotion/styled @mui/material react-alice-carousel react-icons
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that the setup part is complete, let’s start building the website.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let the game begin
&lt;/h2&gt;

&lt;p&gt;First, delete all the contents of global.css and paste this code there.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    @tailwind base;
    @tailwind components;
    @tailwind utilities;

    .prodimg-border{
      border-top-left-radius: 15px;
      border-top-right-radius: 15px;
    }

    .prod-sideimg{
      box-shadow: 0px 0px 2px;
      border-radius: 10px;
    }

    .prod-shadow {
      box-shadow: 0px 0px 2.5px;
      border-radius: 15px;
    }

    .lds-ripple {
      display: inline-block;
      position: relative;
      width: 80px;
      height: 80px;
    }
    .lds-ripple div {
      position: absolute;
      border: 4px solid #858585;
      opacity: 1;
      border-radius: 50%;
      animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
    }
    .lds-ripple div:nth-child(2) {
      animation-delay: -0.5s;
    }
    @keyframes lds-ripple {
      0% {
        top: 36px;
        left: 36px;
        width: 0;
        height: 0;
        opacity: 0;
      }
      4.9% {
        top: 36px;
        left: 36px;
        width: 0;
        height: 0;
        opacity: 0;
      }
      5% {
        top: 36px;
        left: 36px;
        width: 0;
        height: 0;
        opacity: 1;
      }
      100% {
        top: 0px;
        left: 0px;
        width: 72px;
        height: 72px;
        opacity: 0;
      }
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now create twofolders: utils, and components, just like mentioned in the below image.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsyqhu6vmqm5tmzmnanev.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsyqhu6vmqm5tmzmnanev.png" alt="Format of all the folders" width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And also create an assets folder inside the public folder. This folder will contain some images. And the utils folder will contain the data.json file, which contains all the data about different mobiles.&lt;/p&gt;

&lt;p&gt;Download Link: &lt;a href="https://github.com/abhirupkumar/mobwiki-starter-utils" rel="noopener noreferrer"&gt;https://github.com/abhirupkumar/mobwiki-starter-utils&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu1dza5z2iy2yo2z1ojgv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu1dza5z2iy2yo2z1ojgv.png" alt="Format of the folder" width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now set serverActions to true in next.config.js&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    /** @type {import('next').NextConfig} */
    const nextConfig = {
        experimental: {
            serverActions: true,
        }
    }

    module.exports = nextConfig
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now create an action.js file in the app folder. It will contain all the server functions that we will be using, such as handleSearch and SortDataByTag. The function handleSearch will be used to redirect to the mentioned query, and SortDataByTag will be used to sort the data based on the tag given.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "use server";

    import { redirect } from "next/navigation";

    export async function handleSearch(formData) {
        const value = formData.get("search");
        redirect(`/search?query=${value}`);
    }

    export async function handleData(dataJson, val, pageNos, order, tag) {
        const search_value = val.toLowerCase().split(" ");
        var newData = [];
        for (let i = 0; i &amp;lt; dataJson.length; i++) {
            let chk = true;
            for (let j = 0; j &amp;lt; search_value.length; j++) {
                if (!dataJson[i].name.toLowerCase().includes(search_value[j])) {
                    chk = false;
                    break;
                }
            }
            if (chk) {
                newData.push(dataJson[i]);
            }
        }

        if (order != null) {
            newData = await SortDataByTag(order, tag, newData);
        }

        let page = 1;
        if (pageNos != null) page = parseInt(pageNos);

        const productsPerPage = 15;
        const startIndex = (page - 1) * productsPerPage;
        const endIndex = startIndex + productsPerPage;
        const totalPages = Math.ceil(newData.length / productsPerPage);

        const data = newData.slice(startIndex, endIndex);

        return { data, page, totalPages }
    }

    export async function SortDataByTag(order, tag, data) {
        if (order === "asc") {
            data.sort((a, b) =&amp;gt; {
                if (tag === "price") {
                    let pa = a.price.replace('.', "").replace(',', "").replace(' ', "")
                    let intpa = parseInt(pa);
                    let pb = b.price.replace('.', "").replace(',', "").replace(' ', "")
                    let intpb = parseInt(pb);
                    return intpa - intpb;
                }
                else {
                    let sa = parseFloat(a.stars)
                    let sb = parseFloat(b.stars)
                    return sa - sb;
                }
            })
        }
        else {
            data.sort((a, b) =&amp;gt; {
                if (tag === "price") {
                    let pa = a.price.replace('.', "").replace(',', "").replace(' ', "")
                    let intpa = parseInt(pa);
                    let pb = b.price.replace('.', "").replace(',', "").replace(' ', "")
                    let intpb = parseInt(pb);
                    return intpb - intpa;
                }
                else {
                    let sa = parseFloat(a.stars)
                    let sb = parseFloat(b.stars)
                    return sb - sa;
                }
            })
        }

        return data;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, create Header.js file in the components folder and paste the following code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "use client";
    import Link from "next/link";
    import React, { useState } from "react";

    export default function Header() {
        const [navbarOpen, setNavbarOpen] = useState(false);

        return (
            &amp;lt;div className="fixed top-0 w-full z-30 clearNav bg-opacity-90 transition duration-300 ease-in-out bg-white"&amp;gt;
                &amp;lt;div className="flex flex-col max-w-6xl px-4 mx-auto md:items-center md:justify-between md:flex-row md:px-6 lg:px-8"&amp;gt;
                    &amp;lt;div className="flex flex-row items-center justify-between p-4"&amp;gt;
                        &amp;lt;Link
                            href="/"
                            className="text-lg font-semibold rounded-lg tracking-widest focus:outline-none focus:shadow-outline"
                        &amp;gt;
                            &amp;lt;h1 className="text-4xl Avenir tracking-tighter text-gray-900 md:text-4x1 lg:text-3xl"&amp;gt;
                                MOBWiKi
                            &amp;lt;/h1&amp;gt;
                        &amp;lt;/Link&amp;gt;
                        &amp;lt;button
                            className="text-white cursor-pointer leading-none px-3 py-1 md:hidden outline-none focus:outline-none "
                            type="button"
                            aria-label="button"
                            onClick={() =&amp;gt; setNavbarOpen(!navbarOpen)}
                        &amp;gt;
                            &amp;lt;svg
                                xmlns="http://www.w3.org/2000/svg"
                                width="24"
                                height="24"
                                viewBox="0 0 24 24"
                                fill="none"
                                stroke="#191919"
                                strokeWidth="2"
                                strokeLinecap="round"
                                strokeLinejoin="round"
                                className="feather feather-menu"
                            &amp;gt;
                                &amp;lt;line x1="3" y1="12" x2="21" y2="12"&amp;gt;&amp;lt;/line&amp;gt;
                                &amp;lt;line x1="3" y1="6" x2="21" y2="6"&amp;gt;&amp;lt;/line&amp;gt;
                                &amp;lt;line x1="3" y1="18" x2="21" y2="18"&amp;gt;&amp;lt;/line&amp;gt;
                            &amp;lt;/svg&amp;gt;
                        &amp;lt;/button&amp;gt;
                    &amp;lt;/div&amp;gt;
                    &amp;lt;div
                        className={
                            "md:flex flex-grow items-center" +
                            (navbarOpen ? " flex" : " hidden")
                        }
                    &amp;gt;
                        &amp;lt;nav className="flex-col flex-grow "&amp;gt;
                            &amp;lt;ul className="flex flex-grow justify-end flex-wrap items-center"&amp;gt;
                                &amp;lt;li&amp;gt;
                                    &amp;lt;Link
                                        href="/"
                                        className="font-medium text-gray-600 hover:text-gray-900 px-5 py-3 flex items-center transition duration-150 ease-in-out"
                                    &amp;gt;
                                        Mobiles
                                    &amp;lt;/Link&amp;gt;
                                &amp;lt;/li&amp;gt;
                            &amp;lt;/ul&amp;gt;
                        &amp;lt;/nav&amp;gt;
                    &amp;lt;/div&amp;gt;
                &amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
        );
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create the MobileSlider.js file in the components folder. This will be our mobile slider. We will be using Alice Caraousel to build this slider.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "use client";

    import React, { useEffect, useState } from 'react';
    import AliceCarousel from 'react-alice-carousel';
    import "react-alice-carousel/lib/alice-carousel.css";
    import dataJson from '../utils/data.json';
    import Link from 'next/link';
    import { RiArrowLeftSLine, RiArrowRightSLine } from 'react-icons/ri'
    import { AiFillStar } from 'react-icons/ai'

    const responsive = {
        2000: {
            items: 5,
        },
        1316: {
            items: 4,
        },
        880: {
            items: 3,
        },
        300: {
            items: 2,
        },
        0: {
            items: 1,
        }
    };

    const MobileSlider = () =&amp;gt; {

        const [data, setData] = useState([])
        useEffect(() =&amp;gt; {
            setData(dataJson)
        }, [])

        const renderNextButton = ({ isDisabled }) =&amp;gt; {
            return &amp;lt;RiArrowRightSLine className="cursor-pointer h-10 w-10 absolute right-0 top-[45%]" /&amp;gt;
        };

        const renderPrevButton = ({ isDisabled }) =&amp;gt; {
            return &amp;lt;RiArrowLeftSLine className="cursor-pointer h-10 w-10 absolute left-0 top-[45%]" /&amp;gt;
        };

        return (
            &amp;lt;div className="flex flex-wrap w-full my-20 flex-col items-center text-center"&amp;gt;
                {data.length &amp;gt; 0 ? &amp;lt;AliceCarousel
                    responsive={responsive}
                    mouseTracking
                    infinite
                    controlsStrategy={"default"}
                    autoPlayStrategy='all'
                    autoPlayInterval={1000}
                    disableDotsControls
                    keyboardNavigation
                    style={{
                        width: "100%",
                        justifyContent: "center",
                    }}
                    renderPrevButton={renderPrevButton}
                    renderNextButton={renderNextButton}&amp;gt;
                    {data.length &amp;gt; 0 &amp;amp;&amp;amp; data.map((index, item) =&amp;gt; {
                        const rawstars = data[item]?.stars
                        const stars = rawstars.substring(0, rawstars.indexOf(" "));
                        return &amp;lt;div key={index} className="lg:w-[310px] md:w[250px] prod-shadow  lg:h-auto cursor-pointer m-2"&amp;gt;
                            &amp;lt;Link href={data[item]?.url} rel="noopener noreferrer" target="_blank"&amp;gt;
                                &amp;lt;div className="flex justify-center md:h-[380px] h-[200px] relative overflow-hidden"&amp;gt;
                                    &amp;lt;img alt="ecommerce" className="m-auto md:m-0 md:h-[380px] h-[200px] prodimg-border block" src={data[item]?.image_src} loading='lazy' /&amp;gt;
                                &amp;lt;/div&amp;gt;
                                &amp;lt;div className="text-center mx-[10px] md:text-justify flex flex-col lg:h-[195px] h-[162px] justify-evenly"&amp;gt;
                                    &amp;lt;h3 className="text-gray-500 mx-auto text-xs tracking-widest title-font"&amp;gt;AMAZON&amp;lt;/h3&amp;gt;
                                    &amp;lt;h2 className="text-gray-900 mx-auto text-left title-font lg:text-[15px] text-[0.63rem] font-medium"&amp;gt;{data[item]?.name}&amp;lt;/h2&amp;gt;
                                    &amp;lt;div className="mt-1 flex space-x-8"&amp;gt;
                                        &amp;lt;p className="text-left text-black font-semibold md:text-base text-xs"&amp;gt;₹ {data[item]?.price}&amp;lt;/p&amp;gt;
                                        &amp;lt;div className="flex items-center space-x-2"&amp;gt;
                                            &amp;lt;p className="text-black items-center flex font-semibold md:text-base text-xs"&amp;gt;{stars} &amp;lt;AiFillStar className="text-yellow-400" /&amp;gt;&amp;lt;/p&amp;gt;
                                            &amp;lt;div className="text-sm font-medium text-gray-900 md:block hidden underline hover:no-underline dark:text-white"&amp;gt;{data[item]?.rating}&amp;lt;/div&amp;gt;
                                        &amp;lt;/div&amp;gt;
                                    &amp;lt;/div&amp;gt;
                                &amp;lt;/div&amp;gt;
                            &amp;lt;/Link&amp;gt;
                        &amp;lt;/div&amp;gt;
                    })}
                &amp;lt;/AliceCarousel&amp;gt;
                    :
                    &amp;lt;div className="lds-ripple"&amp;gt;
                        &amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;
                        &amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;
                    &amp;lt;/div&amp;gt;}
            &amp;lt;/div&amp;gt;
        )
    }

    export default MobileSlider
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create the SliderPage.js file in the components folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "use client";

    import React from 'react';
    import AliceCarousel from 'react-alice-carousel';
    import "react-alice-carousel/lib/alice-carousel.css";
    import { RiArrowLeftSLine, RiArrowRightSLine } from 'react-icons/ri';

    const SliderPage = () =&amp;gt; {

        const renderNextButton = ({ isDisabled }) =&amp;gt; {
            return &amp;lt;RiArrowRightSLine className="cursor-pointer h-12 w-12 absolute right-0 top-[45%]" /&amp;gt;
        };

        const renderPrevButton = ({ isDisabled }) =&amp;gt; {
            return &amp;lt;RiArrowLeftSLine className="cursor-pointer h-12 w-12 absolute left-0 top-[45%]" /&amp;gt;
        };

        return (
            &amp;lt;div className='max-w-[1300px] w-full mx-auto'&amp;gt;
                &amp;lt;AliceCarousel
                    autoPlay={true}
                    playButtonEnabled={true}
                    infinite={true}
                    autoPlayInterval={4000}
                    renderPrevButton={renderPrevButton}
                    renderNextButton={renderNextButton}&amp;gt;
                    &amp;lt;img alt="banner1" src="./assets/img1.jpg" className='rounded-xl' loading="lazy" /&amp;gt;
                    &amp;lt;img alt="banner2" src="./assets/img2.jpg" className='rounded-xl' loading="lazy" /&amp;gt;
                    &amp;lt;img alt="banner3" src="./assets/img3.jpg" className='rounded-xl' loading="lazy" /&amp;gt;
                    &amp;lt;img alt="banner4" src="./assets/img4.jpg" className='rounded-xl' loading="lazy" /&amp;gt;
                &amp;lt;/AliceCarousel&amp;gt;

            &amp;lt;/div&amp;gt;
        )
    }

    export default SliderPage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create the PagenationPart.js file in the components folder. This is only the pagination part.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "use client";

    import { Pagination } from '@mui/material'
    import { useRouter } from 'next/navigation';
    import React from 'react'

    const PagenationPart = ({ query, page, totalPages }) =&amp;gt; {

        const router = useRouter()

        const handlePageChange = (event, value) =&amp;gt; {
            router.push(`/search?query=${query}&amp;amp;page=${value}`)
        }

        return (
            &amp;lt;div className='my-10'&amp;gt;
                &amp;lt;Pagination
                    count={totalPages}
                    page={page}
                    onChange={handlePageChange}
                    variant="outlined" color="primary"
                /&amp;gt;
            &amp;lt;/div&amp;gt;
        )
    }

    export default PagenationPart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create the Table.js file in the components folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "use client"

    import Link from 'next/link';
    import { useRouter } from 'next/navigation';
    import React, { useEffect, useState } from 'react'
    import { AiFillStar } from 'react-icons/ai';
    import { RiArrowDownSFill, RiArrowUpSFill } from 'react-icons/ri';

    const Table = ({ query, page, data }) =&amp;gt; {

        const router = useRouter();

        const handleSort = (order, tag) =&amp;gt; {
            var newlink = `/search?query=${query}`
            if (page != null)
                newlink += `&amp;amp;page=${page}`
            newlink += `&amp;amp;order=${order}&amp;amp;tag=${tag}`
            router.push(newlink);
        }

        return (
            &amp;lt;div className="overflow-x-auto md:px-12 px-2"&amp;gt;
                &amp;lt;table className="w-full text-sm text-left text-gray-500 dark:text-gray-400"&amp;gt;
                    &amp;lt;thead className="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400"&amp;gt;
                        &amp;lt;tr&amp;gt;
                            &amp;lt;th scope="col" className="px-6 py-3 w-[10rem]"&amp;gt;
                                Image
                            &amp;lt;/th&amp;gt;
                            &amp;lt;th scope="col" className="px-6 py-3 w-[22rem]"&amp;gt;
                                Product Name
                            &amp;lt;/th&amp;gt;
                            &amp;lt;th scope="col" className="px-6 py-3"&amp;gt;
                                Site
                            &amp;lt;/th&amp;gt;
                            &amp;lt;th scope="col" className="px-6 py-3"&amp;gt;
                                &amp;lt;div className="flex justify-center items-center"&amp;gt;
                                    Star
                                    &amp;lt;div className='flex flex-col items-center'&amp;gt;
                                        &amp;lt;button className='text-[16px] -mb-[10px]' onClick={() =&amp;gt; handleSort("asc", "star")}&amp;gt;
                                            &amp;lt;RiArrowUpSFill value="asc-price" /&amp;gt;
                                        &amp;lt;/button&amp;gt;
                                        &amp;lt;button className='text-[16px]' onClick={() =&amp;gt; handleSort("desc", "star")} &amp;gt;
                                            &amp;lt;RiArrowDownSFill value="desc-price" /&amp;gt;
                                        &amp;lt;/button&amp;gt;
                                    &amp;lt;/div&amp;gt;
                                &amp;lt;/div&amp;gt;
                            &amp;lt;/th&amp;gt;
                            &amp;lt;th scope="col" className="px-6 py-3"&amp;gt;
                                &amp;lt;div className="flex justify-center items-center"&amp;gt;
                                    Price
                                    &amp;lt;div className='flex flex-col items-center'&amp;gt;
                                        &amp;lt;button className='text-[16px] -mb-[10px]' onClick={() =&amp;gt; handleSort("asc", "price")}&amp;gt;
                                            &amp;lt;RiArrowUpSFill value="asc-price" /&amp;gt;
                                        &amp;lt;/button&amp;gt;
                                        &amp;lt;button className='text-[16px]' onClick={() =&amp;gt; handleSort("desc", "price")} &amp;gt;
                                            &amp;lt;RiArrowDownSFill value="desc-price" /&amp;gt;
                                        &amp;lt;/button&amp;gt;
                                    &amp;lt;/div&amp;gt;
                                &amp;lt;/div&amp;gt;
                            &amp;lt;/th&amp;gt;
                        &amp;lt;/tr&amp;gt;
                    &amp;lt;/thead&amp;gt;
                    &amp;lt;tbody&amp;gt;
                        {data.length &amp;gt; 0 &amp;amp;&amp;amp; data.map((index, item) =&amp;gt; {
                            const rawstars = data[item]?.stars
                            const stars = rawstars.substring(0, rawstars.indexOf(" "));
                            return &amp;lt;tr key={data[item]?.url} className="bg-white border-b dark:bg-gray-800 dark:border-gray-700"&amp;gt;
                                &amp;lt;td className="pr-6 py-2"&amp;gt;
                                    &amp;lt;a href={data[item]?.url} rel="noopener noreferrer" target="_blank"&amp;gt;
                                        &amp;lt;img alt={`image-${index + 1}`} className="" src={data[item]?.image_src} loading='lazy' /&amp;gt;
                                    &amp;lt;/a&amp;gt;
                                &amp;lt;/td&amp;gt;
                                &amp;lt;td className="px-6 py-2 text-black font-semibold"&amp;gt;
                                    &amp;lt;a href={data[item]?.url} rel="noopener noreferrer" target="_blank"&amp;gt;
                                        {data[item]?.name}
                                    &amp;lt;/a&amp;gt;
                                &amp;lt;/td&amp;gt;
                                &amp;lt;td className="px-6 py-2 text-black font-semibold"&amp;gt;
                                    AMAZON
                                &amp;lt;/td&amp;gt;
                                &amp;lt;td className="px-6 py-2"&amp;gt;
                                    &amp;lt;div className='flex items-center space-x-1 text-black font-semibold'&amp;gt;
                                        &amp;lt;p className='font-medium'&amp;gt;{stars}&amp;lt;/p&amp;gt;
                                        &amp;lt;AiFillStar className="text-yellow-400" /&amp;gt;
                                    &amp;lt;/div&amp;gt;
                                &amp;lt;/td&amp;gt;
                                &amp;lt;td className="px-6 py-2 text-black font-semibold"&amp;gt;
                                    ₹ {data[item].price}
                                &amp;lt;/td&amp;gt;
                            &amp;lt;/tr&amp;gt;
                        })}
                    &amp;lt;/tbody&amp;gt;
                &amp;lt;/table&amp;gt;
            &amp;lt;/div&amp;gt;
        )
    }

    export default Table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wow! We have built a lot of components. Now let’s get onto assembling them by adding them to the page file in the app directory. Change the code of the page.js file to this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import MobileSlider from '@/components/MobileSlider'
    import SliderPage from '@/components/SliderPage'
    import { AiOutlineSearch } from 'react-icons/ai'
    import { handleSearch } from './action';

    export default function Home() {

      return (
        &amp;lt;&amp;gt;
          &amp;lt;form className="flex flex-1 mt-10 justify-end items-center lg:mx-10 mx-2" action={handleSearch}&amp;gt;
            &amp;lt;input className='border-2 border-gray-300 bg-white h-12 px-5 lg:w-[50vw] w-[80vw] pr-16 flex rounded-xl text-sm focus:outline-none' type="search" name="search" placeholder="Search for any mobile..." /&amp;gt;
            &amp;lt;button type="submit" className="absolute mx-2 text-xl bg-blue-800 p-2 rounded-xl text-white flex"&amp;gt;
              &amp;lt;AiOutlineSearch /&amp;gt;
            &amp;lt;/button&amp;gt;
          &amp;lt;/form&amp;gt;
          &amp;lt;MobileSlider /&amp;gt;
          &amp;lt;SliderPage /&amp;gt;
        &amp;lt;/&amp;gt;
      )
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And add this to your layout.js file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import MobileSlider from '@/components/MobileSlider'
    import SliderPage from '@/components/SliderPage'
    import { AiOutlineSearch } from 'react-icons/ai'
    import { handleSearch } from './action';

    export default function Home() {

      return (
        &amp;lt;&amp;gt;
          &amp;lt;form className="flex flex-1 mt-10 justify-end items-center lg:mx-10 mx-2" action={handleSearch}&amp;gt;
            &amp;lt;input className='border-2 border-gray-300 bg-white h-12 px-5 lg:w-[50vw] w-[80vw] pr-16 flex rounded-xl text-sm focus:outline-none' type="search" name="search" placeholder="Search for any mobile..." /&amp;gt;
            &amp;lt;button type="submit" className="absolute mx-2 text-xl bg-blue-800 p-2 rounded-xl text-white flex"&amp;gt;
              &amp;lt;AiOutlineSearch /&amp;gt;
            &amp;lt;/button&amp;gt;
          &amp;lt;/form&amp;gt;
          &amp;lt;MobileSlider /&amp;gt;
          &amp;lt;SliderPage /&amp;gt;
        &amp;lt;/&amp;gt;
      )
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a search folder in app directory and add loading.js in that folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import React from 'react'

    const loading = () =&amp;gt; {
        return (
            &amp;lt;div className="lds-ripple"&amp;gt;
                &amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;
                &amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
        )
    }

    export default loading
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add page.js to the search file. When the user searches for something, this page is shown, where all the mobile phones as per his search are shown.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import React from 'react'
    import { AiFillStar, AiOutlineSearch } from 'react-icons/ai';
    import { handleData, handleSearch } from '../action';
    import dataJson from '../../utils/data.json';
    import Table from '@/components/Table';
    import PagenationPart from '@/components/PagenationPart';

    const Search = async ({ searchParams }) =&amp;gt; {
        const { data, page, totalPages } = await handleData(dataJson, searchParams.query ?? "", searchParams.page ?? null, searchParams.order ?? null, searchParams.tag ?? null)

        return (
            &amp;lt;div className='flex flex-col w-full justify-center items-center'&amp;gt;
                &amp;lt;form className="flex mt-10 justify-center items-center lg:mx-10 mx-2" action={handleSearch}&amp;gt;
                    &amp;lt;div className="flex justify-end items-center"&amp;gt;
                        &amp;lt;input className='border-2 border-gray-300 bg-white h-12 md:w-[30rem] w-[20rem] px-5 flex-1 pr-16 flex rounded-xl text-sm focus:outline-none' type="search" name="search" placeholder="Search for any mobile..." /&amp;gt;
                        &amp;lt;button type="submit" className="absolute mx-2 text-xl bg-blue-800 p-2 rounded-xl text-white flex"&amp;gt;
                            &amp;lt;AiOutlineSearch /&amp;gt;
                        &amp;lt;/button&amp;gt;
                    &amp;lt;/div&amp;gt;
                &amp;lt;/form&amp;gt;
                {data.length &amp;gt; 0 &amp;amp;&amp;amp; &amp;lt;PagenationPart query={searchParams.query ?? ""} page={page} totalPages={totalPages} /&amp;gt;}
                &amp;lt;Table query={searchParams.query ?? ""} page={page} data={data} /&amp;gt;
                {data.length &amp;gt; 0 &amp;amp;&amp;amp; &amp;lt;PagenationPart page={page} totalPages={totalPages} /&amp;gt;}

            &amp;lt;/div&amp;gt;
        )
    }

    export default Search
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flfox9negitunzdsemw05.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flfox9negitunzdsemw05.png" alt="Search Page" width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congratulations your project is complete now. You can host your website for free on Netlify or Vercel. You may even host it on Hostinger, Digital Ocean, or any other premium service if you desire.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;You may, of course, modify the code to make more unique websites. Next includes an extensive list of features that make frontend and backend development simple. I hope you enjoyed my blog and learned something new.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Guys, if you enjoyed this, please give it a clap and share it with your friends who also want to learn and implement Next.js. And if you want more articles like this, follow me on dev.to . If you missed anything or want to &lt;a href="https://github.com/abhirupkumar/mobwiki" rel="noopener noreferrer"&gt;check out the full code here&lt;/a&gt;. Thanks for reading!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>webscraping</category>
    </item>
    <item>
      <title>Typescript vs Javascript</title>
      <dc:creator>Abhirup Kumar Bhowmick</dc:creator>
      <pubDate>Tue, 19 Dec 2023 04:48:04 +0000</pubDate>
      <link>https://forem.com/abhirup2003/typescript-vs-javascript-19fn</link>
      <guid>https://forem.com/abhirup2003/typescript-vs-javascript-19fn</guid>
      <description>&lt;h3&gt;
  
  
  Why choose typescript over javascript?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Yh4E3f5A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/v2/resize:fit:720/format:png/1%2Af76RSGKQzHLUoQ7oakJRtA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Yh4E3f5A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/v2/resize:fit:720/format:png/1%2Af76RSGKQzHLUoQ7oakJRtA.png" alt="Typescript vs Javascript" width="720" height="720"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Are you a web developer or a web enthusiast who is using React.js, Vue.js, or Next.js for building web apps? If yes, then you should definitely check out TypeScript. In this blog, I will mostly talk about the difference between typescript and javascript and why you should prefer .ts (.tsx) over .js (.jsx).&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Javascript&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;JavaScript is a versatile, high-level programming language primarily used for web development. It empowers browsers to dynamically update content, enhance user interactions, and create responsive interfaces. Its event-driven paradigm and ability to manipulate Document Object Model (DOM) elements make it a crucial tool for building interactive and engaging websites.&lt;/p&gt;

&lt;p&gt;You can guarantee that JavaScript is used whenever a web page does anything more than just sit there and show you static data. Examples of such features include interactive maps, dynamic 2D and 3D visuals, scrolling video jukeboxes, and timely content updates. It is the third layer in the stack of common web technologies, the first two of which are HTML and CSS.&lt;/p&gt;

&lt;p&gt;In the ever-evolving landscape of web development, the choice between TypeScript and JavaScript is a crucial decision that can significantly impact the quality and maintainability of your code. While both languages serve as the backbone of modern web applications, TypeScript emerges as a powerful contender, offering a plethora of advantages that go beyond the capabilities of its predecessor, JavaScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  Typescript
&lt;/h2&gt;

&lt;p&gt;TypeScript is a superset of JavaScript, introducing static typing to enhance code reliability and maintainability. Developed by Microsoft, it compiles to plain JavaScript and supports the latest ECMAScript features. TypeScript introduces interfaces, classes, and other object-oriented programming concepts, enabling developers to define and enforce clear data structures. Its static typing helps catch potential errors during development, leading to more robust applications. With a strong tooling ecosystem and wide industry adoption, TypeScript facilitates scalable and maintainable codebases, making it an excellent choice for large-scale web and server-side development projects, where type safety and code organization are crucial considerations.&lt;/p&gt;

&lt;p&gt;Several Big Tech Companies like Google, Microsoft, Meta, Netflix, Airbnb have add Typescript to their tech stacks. TypeScript is used in all major applications which we usually use in our daily life such as Gmail, Google Search, Youtube, Visual Studio Code ( for developers), Office 365, Facebook, Instagram, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages of using TypeScript over JavaScript
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Static Typing
&lt;/h3&gt;

&lt;p&gt;Static Typing requires developers to explicitly specify variable types. Take the variable “num” in TypeScript, for instance. The code won’t execute without assigning a type, like Integer, Float, List, or another. TypeScript enforces static typing, offering benefits like early bug detection and quicker code completion.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// JavaScript (No Static Typing)&lt;br&gt;
let str = "Hello, World!";&lt;br&gt;
console.log(str);

&lt;p&gt;// Attempting to assign a different type later is allowed&lt;br&gt;
str = 42;&lt;br&gt;
console.log(str); // This would execute without error in JS&lt;/p&gt;

&lt;p&gt;// TypeScript (Static Typing)&lt;br&gt;
let str: string = "Hello, World!";&lt;br&gt;
console.log(str);&lt;/p&gt;

&lt;p&gt;// Attempting to assign a different type results in a compile-time error&lt;br&gt;
// Uncommenting the line below would result in a TypeScript compilation error&lt;br&gt;
// str = 42;&lt;br&gt;
// console.log(str);&lt;br&gt;
&lt;/p&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Interchangeable&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;TypeScript is an extension of JavaScript, allowing seamless integration of JavaScript code and libraries. All legitimate TypeScript code is equivalent to valid JavaScript code. A JavaScript file saved in TypeScript with a.ts extension runs without any problems. TypeScript and JavaScript are essentially equivalent, thus you can progressively integrate TypeScript into an existing JavaScript codebase. All that’s required to convert a JavaScript file to TypeScript is to add types to each module. Although every line of JavaScript is also TypeScript, it’s important to remember that TypeScript has extra features for better development, such as static typing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Typecasting
&lt;/h3&gt;

&lt;p&gt;The reason to use TypeScript over JavaScript is that it also allows TypeCasting. It indicates the problem while writing, making it simple and quick to answer the inquiry. It also becomes simple to transform a variable from one type to another with TypeCasting. You may instantly modify a variable’s type with TypeCasting to suit your needs. For type castings, the &amp;lt;&amp;gt; operator or the “as” keyword work well. Additionally, it provides you with tips when you run into trouble creating code, making it simpler. The compilation error is shown by TypeScript during development.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// TypeScript example demonstrating Type Casting

&lt;p&gt;// Example 1: Using "as" keyword&lt;br&gt;
let stringValue: any = "42";&lt;br&gt;
let numberValue1: number = stringValue as number;&lt;br&gt;
console.log(&lt;code&gt;Using "as" keyword: ${numberValue1}&lt;/code&gt;);&lt;/p&gt;

&lt;p&gt;// Example 2: Using &amp;lt; &amp;gt; operator&lt;br&gt;
let anotherStringValue: any = "77";&lt;br&gt;
let numberValue2: number = &amp;lt;number&amp;gt;anotherStringValue;&lt;br&gt;
console.log(&lt;code&gt;Using &amp;amp;lt; &amp;amp;gt; operator: ${numberValue2}&lt;/code&gt;);&lt;br&gt;
&lt;/p&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Interface Support&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;Unlike JavaScript, TypeScript allows types to be defined using interfaces. An interface specifies the methods and attributes that an object must have, but it does not actually implement them. This language construct is very useful when working with other developers.&lt;/p&gt;

&lt;p&gt;The example shows how to use TypeScript’s capabilities to implement standard Object Oriented Progarmming patterns —&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Define an interface for a BankAccount&lt;br&gt;
interface BankAccount {&lt;br&gt;
  accountNumber: string;&lt;br&gt;
  balance: number;&lt;br&gt;
  deposit(amount: number): void;&lt;br&gt;
  withdraw(amount: number): void;&lt;br&gt;
}

&lt;p&gt;// Implement a class for SavingsAccount that implements BankAccount&lt;br&gt;
class SavingsAccount implements BankAccount {&lt;br&gt;
  constructor(public accountNumber: string, public balance: number) {}&lt;/p&gt;

&lt;p&gt;deposit(amount: number): void {&lt;br&gt;
    this.balance += amount;&lt;br&gt;
    console.log(&lt;code&gt;Deposited ${amount}. New balance: ${this.balance}&lt;/code&gt;);&lt;br&gt;
  }&lt;/p&gt;

&lt;p&gt;withdraw(amount: number): void {&lt;br&gt;
    if (amount &amp;lt;= this.balance) {&lt;br&gt;
      this.balance -= amount;&lt;br&gt;
      console.log(&lt;code&gt;Withdrawn ${amount}. New balance: ${this.balance}&lt;/code&gt;);&lt;br&gt;
    } else {&lt;br&gt;
      console.log("Insufficient funds!");&lt;br&gt;
    }&lt;br&gt;
  }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;// Implement a class for CurrentAccount that implements BankAccount&lt;br&gt;
class CurrentAccount implements BankAccount {&lt;br&gt;
  constructor(public accountNumber: string, public balance: number) {}&lt;/p&gt;

&lt;p&gt;deposit(amount: number): void {&lt;br&gt;
    this.balance += amount;&lt;br&gt;
    console.log(&lt;code&gt;Deposited ${amount}. New balance: ${this.balance}&lt;/code&gt;);&lt;br&gt;
  }&lt;/p&gt;

&lt;p&gt;withdraw(amount: number): void {&lt;br&gt;
    // Current accounts allow overdraft up to a certain limit&lt;br&gt;
    const overdraftLimit = 1000;&lt;br&gt;
    if (amount &amp;lt;= this.balance + overdraftLimit) {&lt;br&gt;
      this.balance -= amount;&lt;br&gt;
      console.log(&lt;code&gt;Withdrawn ${amount}. New balance: ${this.balance}&lt;/code&gt;);&lt;br&gt;
    } else {&lt;br&gt;
      console.log("Exceeds overdraft limit!");&lt;br&gt;
    }&lt;br&gt;
  }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;// Example usage&lt;br&gt;
const savingsAccount = new SavingsAccount("SA123", 1000);&lt;br&gt;
savingsAccount.deposit(500);&lt;br&gt;
savingsAccount.withdraw(200);&lt;/p&gt;

&lt;p&gt;const currentAccount = new CurrentAccount("CA456", 2000);&lt;br&gt;
currentAccount.deposit(1000);&lt;br&gt;
currentAccount.withdraw(2500);&lt;br&gt;
&lt;/p&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Conclusion&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;In conclusion, TypeScript stands out as a powerful superset of JavaScript, offering static typing and other features that enhance the development experience. Its capacity to detect errors early, improve code maintainability, and support modern ECMAScript features makes it a valuable tool for developers. The seamless interoperability with existing JavaScript codebases facilitates a smooth transition and adoption process. However, the choice between TypeScript and JavaScript ultimately depends on the specific needs and preferences of the development team and the company’s goals. The decision to embrace TypeScript or stick with JavaScript reflects the flexibility within the development landscape, allowing companies to choose the approach that best aligns with their project requirements and development philosophies.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Guys, if you enjoyed this, please give it a clap and share it with your friends who are about to begin learning web or android development. And if you want more articles like this, follow me on Medium.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>fullstack</category>
    </item>
    <item>
      <title>Building Netflix Clone with NextJs 13.4: Part 2</title>
      <dc:creator>Abhirup Kumar Bhowmick</dc:creator>
      <pubDate>Tue, 19 Dec 2023 04:23:35 +0000</pubDate>
      <link>https://forem.com/abhirup2003/building-netflix-clone-with-nextjs-134-part-2-1khg</link>
      <guid>https://forem.com/abhirup2003/building-netflix-clone-with-nextjs-134-part-2-1khg</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kwCU6J3o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/v2/resize:fit:1000/format:png/1%2ABSloxzIr-wN2LW2YDrjiMg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kwCU6J3o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/v2/resize:fit:1000/format:png/1%2ABSloxzIr-wN2LW2YDrjiMg.png" alt="Netflix Clone" width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Github Link:&lt;/strong&gt; &lt;a href="https://github.com/abhirupkumar/Netflix-Clone/" rel="noopener noreferrer"&gt;https://github.com/abhirupkumar/Netflix-Clone&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project Link:&lt;/strong&gt; &lt;a href="https://netflix-akb.vercel.app/" rel="noopener noreferrer"&gt;https://netflix-akb.vercel.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create a hooks folder in the root directory. The hooks folder will have two files, useAuth.tsx and useList.tsx. useAuth.tsx is for checking whether the user is authenticated and subscribed or not.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  import {
        createUserWithEmailAndPassword,
        onAuthStateChanged,
        signInWithEmailAndPassword,
        signOut,
        User,
      } from 'firebase/auth';
      import { useRouter } from 'next/navigation';
      import { createContext, useContext, useEffect, useMemo, useState } from 'react';
      import { auth, db } from '../firebase';
    import { doc, getDoc } from 'firebase/firestore';

    interface Props{
      id: string;
      name: string;
      amount: number;
      expiry: Date;
    }

      interface IAuth {
        user: User | null
        signUp: (email: string, password: string) =&amp;gt; Promise&amp;lt;void&amp;gt;
        signIn: (email: string, password: string) =&amp;gt; Promise&amp;lt;void&amp;gt;
        logout: () =&amp;gt; Promise&amp;lt;void&amp;gt;
        planDetails: Props | null
        error: string | null
        loading: boolean
      }

      const AuthContext = createContext&amp;lt;IAuth&amp;gt;({
        user: null,
        signUp: async () =&amp;gt; {},
        signIn: async () =&amp;gt; {},
        logout: async () =&amp;gt; {},
        planDetails: null,
        error: null,
        loading: false,
      })

      interface AuthProviderProps {
        children: React.ReactNode
      }

      export const AuthProvider = ({ children }: AuthProviderProps) =&amp;gt; {
        const [loading, setLoading] = useState(false)
        const [user, setUser] = useState&amp;lt;User | null&amp;gt;(null)
        const [error, setError] = useState(null)
        const [planDetails, setPlanDetails] = useState&amp;lt;Props | null&amp;gt;(null)
        const [initialLoading, setInitialLoading] = useState(true)
        const router = useRouter()

        // Persisting the user
        useEffect(
          () =&amp;gt;
            onAuthStateChanged(auth, (user) =&amp;gt; {
              if (user) {
                // Logged in...
                setUser(user)
                fetchSubs(user);
                setLoading(false)
              } else {
                // Not logged in...
                setUser(null)
                setLoading(false)
                router.push('/login')
              }

              setInitialLoading(false)
            }),
          [auth])

          useEffect(() =&amp;gt; {
            if(error!=null){
              setLoading(false)
              setError(null);
            }
          }, [error])

        const fetchSubs = async (userD: User) : Promise&amp;lt;void&amp;gt; =&amp;gt; {
          const isSub = await isSubscribed(userD);
        }

        const signUp = async (email: string, password: string) =&amp;gt; {
          setLoading(true)

          await createUserWithEmailAndPassword(auth, email, password)
            .then((userCredential) =&amp;gt; {
              setUser(userCredential.user)
              router.push('/')
              setLoading(false)
            })
            .catch((err) =&amp;gt; {
              alert(err.message)
              setError(err.message)
            })
            .finally(() =&amp;gt; {
              setLoading(false)})
        }

        const signIn = async (email: string, password: string) =&amp;gt; {
          setLoading(true)

          await signInWithEmailAndPassword(auth, email, password)
            .then((userCredential) =&amp;gt; {
              setUser(userCredential.user)
              router.push('/')
              setLoading(false)
            })
            .catch((err) =&amp;gt; {
              alert(err.message)
              setError(err.message)
            })
            .finally(() =&amp;gt; {
              setLoading(false)})
        }

        const isSubscribed = async (user: User | null) : Promise&amp;lt;boolean | null&amp;gt; =&amp;gt; {
          if(user == null) return null;
          const userRef =  doc(db, "subscriptions", user.uid);
          const docSnap = await getDoc(userRef);
          if(!docSnap.exists()) return false;
          else{
            const data = docSnap.data();
            const newdate = new Date().toISOString()
            const expiryDate = data.subscriptionExpiryDate
            if(newdate &amp;gt; expiryDate){
              return false;
            }
            else{
              setPlanDetails({id: data.subscriptionPlanId, name: data.subscriptionPlan, amount: data.subscriptionAmount, expiry: expiryDate})
              return true;
            }
          }
        }

        const logout = async () =&amp;gt; {
          setLoading(true)

          signOut(auth)
            .then(() =&amp;gt; {
              setUser(null)
            })
            .catch((err) =&amp;gt; {
              alert(err.message)
              setError(err.message)
            })
            .finally(() =&amp;gt; {
              setLoading(false)})
        }

        const memoedValue = useMemo(
          () =&amp;gt; ({
            user,
            signUp,
            signIn,
            logout,
            planDetails,
            loading,
            error,
          }),
          [user, loading]
        )

        return (
          &amp;lt;AuthContext.Provider value={memoedValue}&amp;gt;
            {!initialLoading &amp;amp;&amp;amp; children}
          &amp;lt;/AuthContext.Provider&amp;gt;
        )
      }

      export default function useAuth() {
        return useContext(AuthContext)
      }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In useList.tsx, we add all the favourite movies to the user’s list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import { collection, DocumentData, onSnapshot } from 'firebase/firestore'
    import { useEffect, useState } from 'react'
    import { db } from '../firebase'
    import { Movie } from '../typings'

    function useList(uid: string | undefined) {
      const [list, setList] = useState&amp;lt;Movie[] | DocumentData[]&amp;gt;([])

      useEffect(() =&amp;gt; {
        if (!uid) return

        return onSnapshot(
          collection(db, 'customers', uid, 'myList'),
          (snapshot) =&amp;gt; {
            setList(
              snapshot.docs.map((doc) =&amp;gt; ({
                id: doc.id,
                ...doc.data(),
              }))
            )
          }
        )
      }, [db, uid])

      return list
    }

    export default useList
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now change the App.tsx page as we need to AuthContext for authentication.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "use client";

    import { AuthProvider } from '@/hooks/useAuth';
    import React from 'react'
    import { RecoilRoot } from 'recoil'

    const App = ({
        children,
      }: {
        children: React.ReactNode
      }) =&amp;gt; {
      return (
        &amp;lt;html lang="en"&amp;gt;
          &amp;lt;body&amp;gt;
            &amp;lt;RecoilRoot&amp;gt;
            &amp;lt;AuthProvider&amp;gt;
              {children}
              &amp;lt;/AuthProvider&amp;gt;
            &amp;lt;/RecoilRoot&amp;gt;
          &amp;lt;/body&amp;gt;
        &amp;lt;/html&amp;gt;
      )
    }

    export default App
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lets create all the Apis required in this project. So, create a api folder in app folder. Within the api folder create &lt;em&gt;create-razorpay-order&lt;/em&gt; folder and within it create route.ts file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import { NextRequest, NextResponse } from 'next/server';
    import razorpay from 'razorpay';

    export async function POST(req: NextRequest) {
        try {
            const { amount } = await req.json();
            const razorpayInstance = new razorpay({
              key_id: &amp;lt;string&amp;gt;process.env.RAZORPAY_KEY,
              key_secret: &amp;lt;string&amp;gt;process.env.RAZORPAY_SECRET,
            });

            const payment_capture = 1;
            const options = {
              amount: (amount * 100).toString(), // Amount in paise or smallest currency unit
              currency: 'INR',
              receipt: 'order_receipt',
              payment_capture,
            };

            const order = await razorpayInstance.orders.create(options);
            return NextResponse.json({ id: order.id });
        } catch (error) {
            return NextResponse.json({ error: 'Failed to create Razorpay order' });
        }
    };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Agin within the api folder create &lt;em&gt;create-razorpay-subscription&lt;/em&gt; folder and within it create route.ts file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import { NextRequest, NextResponse } from 'next/server';
    import razorpay from 'razorpay';

    export async function POST(req: NextRequest) {
        try {
          const { orderId, planType, planId, email, userId, amount } = await req.json();
            const razorpayInstance = new razorpay({
              key_id: &amp;lt;string&amp;gt;process.env.RAZORPAY_KEY,
              key_secret: &amp;lt;string&amp;gt;process.env.RAZORPAY_SECRET,
            });

            razorpayInstance.subscriptions.create({
              plan_id: planId,
              total_count: 1,
              quantity: 1,
              customer_notify: 1,
              addons: [
                {
                  item: {
                    name: userId,
                    amount: amount*100,
                    currency: "INR"
                  }
                }
              ],
              notes: {
                planType,
                orderId,
              },
              notify_info: {
                notify_email: email,
              }
            })

            return NextResponse.json({ success: true });
        } catch (error) {
            return NextResponse.json({ success: false, error: 'Payment verification failed' });
        }
    };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a folder components in root directory. Create Banner.tsx file in components folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "use client";

    import { modalState, movieState } from '@/atoms/modalAtom';
    import { baseUrl } from '@/constants/movie';
    import { Movie } from '@/typings'
    import Image from 'next/image'
    import React, { useEffect, useState } from 'react'
    import { FaPlay } from 'react-icons/fa'
    import { HiOutlineInformationCircle } from 'react-icons/hi'
    import { useRecoilState } from 'recoil';

    interface Props {
      netflixOriginals: Movie[]
    }

    const Banner = ({ netflixOriginals } : Props) =&amp;gt; {
      const [movie, setMovie] = useState&amp;lt;Movie | null&amp;gt;(null)
      const [showModal, setShowModal] = useRecoilState(modalState)
      const [currentMovie, setCurrentMovie] = useRecoilState(movieState)

      const truncate = (str: string) =&amp;gt; {
        return str.length &amp;gt; 250 ? str.substring(0, 250) + "..." : str;
      }

      useEffect(() =&amp;gt; {
        setMovie(
          netflixOriginals[Math.floor(Math.random() * netflixOriginals.length)]
        );
      }, [netflixOriginals])

      return (
        &amp;lt;div className="flex flex-col space-y-2 pt-16 md:space-y-4 lg:h-[65vh] lg:justify-end"&amp;gt;
          &amp;lt;div className="absolute top-0 left-0 -z-10 h-[95vh] w-screen"&amp;gt;
            {(movie?.backdrop_path || movie?.poster_path) &amp;amp;&amp;amp; &amp;lt;Image
              src={`${baseUrl}${movie?.backdrop_path || movie?.poster_path}`}
              fill={true}
              object-fit="cover"
              alt="banner-image"
              priority={true}
            /&amp;gt;}
          &amp;lt;/div&amp;gt;

          &amp;lt;h1 className="text-2xl font-bold md:text-4xl lg:text-6xl"&amp;gt;
            {movie?.title || movie?.name || movie?.original_name}
          &amp;lt;/h1&amp;gt;
          &amp;lt;p className="max-w-xs text-xs text-shadow-md md:max-w-lg md:text-lg lg:max-w-xl lg:text-lg"&amp;gt;
            {movie?.overview &amp;amp;&amp;amp; truncate(movie?.overview)}
          &amp;lt;/p&amp;gt;

          &amp;lt;div className="flex space-x-3"&amp;gt;
            &amp;lt;button className="bannerButton bg-white text-black" onClick={() =&amp;gt; {
                setCurrentMovie(movie)
                setShowModal(true)
              }}&amp;gt;
              &amp;lt;FaPlay className="h-4 w-4 text-black md:h-7 md:w-7" onClick={() =&amp;gt; {
                setCurrentMovie(movie)
                setShowModal(true)
              }} /&amp;gt; Play
            &amp;lt;/button&amp;gt;
            &amp;lt;button
              className="bannerButton bg-[gray]/70"
              onClick={() =&amp;gt; {
                setCurrentMovie(movie)
                setShowModal(true)
              }}
            &amp;gt;
              More Info &amp;lt;HiOutlineInformationCircle className="h-5 w-5 md:h-8 md:w-8" /&amp;gt;
            &amp;lt;/button&amp;gt;
          &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
      )
    }

    export default Banner
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create BasicMenu.tsx file in components folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "use client";

    import Button from '@mui/material/Button'
    import Menu from '@mui/material/Menu'
    import MenuItem from '@mui/material/MenuItem'
    import { useState } from 'react'

    export default function BasicMenu() {
      const [anchorEl, setAnchorEl] = useState&amp;lt;null | HTMLElement&amp;gt;(null)
      const open = Boolean(anchorEl)

      const handleClick = (event: React.MouseEvent&amp;lt;HTMLButtonElement&amp;gt;) =&amp;gt; {
        setAnchorEl(event.currentTarget)
      }

      const handleClose = () =&amp;gt; {
        setAnchorEl(null)
      }

      return (
        &amp;lt;div className="md:!hidden"&amp;gt;
          &amp;lt;Button
            id="basic-button"
            aria-controls={open ? 'basic-menu' : undefined}
            aria-haspopup="true"
            aria-expanded={open ? 'true' : undefined}
            onClick={handleClick}
            className="!capitalize !text-white"
          &amp;gt;
            Browse
          &amp;lt;/Button&amp;gt;
          &amp;lt;Menu
            id="basic-menu"
            anchorEl={anchorEl}
            open={open}
            onClose={handleClose}
            className="menu"
            MenuListProps={{
              'aria-labelledby': 'basic-button',
            }}
          &amp;gt;
            &amp;lt;MenuItem onClick={handleClose}&amp;gt;Home&amp;lt;/MenuItem&amp;gt;
            &amp;lt;MenuItem onClick={handleClose}&amp;gt;TV Shows&amp;lt;/MenuItem&amp;gt;
            &amp;lt;MenuItem onClick={handleClose}&amp;gt;Movies&amp;lt;/MenuItem&amp;gt;
            &amp;lt;MenuItem onClick={handleClose}&amp;gt;New &amp;amp; Popular&amp;lt;/MenuItem&amp;gt;
            &amp;lt;MenuItem onClick={handleClose}&amp;gt;My List&amp;lt;/MenuItem&amp;gt;
          &amp;lt;/Menu&amp;gt;
        &amp;lt;/div&amp;gt;
      )
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now lets create Header.tsx file in components folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "use client";

    import Link from 'next/link'
    import { useEffect, useState } from 'react'
    import useAuth from '@/hooks/useAuth'
    import { BiBell, BiSearch } from 'react-icons/bi'
    import BasicMenu from './BasicMenu';

    function Header() {
      const [isScrolled, setIsScrolled] = useState(false)
      const { logout } = useAuth()

      useEffect(() =&amp;gt; {
        const handleScroll = () =&amp;gt; {
          if (window.scrollY &amp;gt; 0) {
            setIsScrolled(true)
          } else {
            setIsScrolled(false)
          }
        }

        window.addEventListener('scroll', handleScroll)

        return () =&amp;gt; {
          window.removeEventListener('scroll', handleScroll)
        }
      }, [])

      return (
        &amp;lt;header className={`${isScrolled &amp;amp;&amp;amp; 'bg-[#141414]'}`}&amp;gt;
          &amp;lt;div className="flex items-center space-x-2 md:space-x-10"&amp;gt;
            &amp;lt;img
              src="https://rb.gy/ulxxee"
              width={100}
              height={100}
              className="cursor-pointer object-contain"
            /&amp;gt;

            &amp;lt;BasicMenu /&amp;gt;

            &amp;lt;ul className="hidden space-x-4 md:flex"&amp;gt;
              &amp;lt;li className="headerLink"&amp;gt;Home&amp;lt;/li&amp;gt;
              &amp;lt;li className="headerLink"&amp;gt;TV Shows&amp;lt;/li&amp;gt;
              &amp;lt;li className="headerLink"&amp;gt;Movies&amp;lt;/li&amp;gt;
              &amp;lt;li className="headerLink"&amp;gt;New &amp;amp; Popular&amp;lt;/li&amp;gt;
              &amp;lt;li className="headerLink"&amp;gt;My List&amp;lt;/li&amp;gt;
            &amp;lt;/ul&amp;gt;
          &amp;lt;/div&amp;gt;

          &amp;lt;div className="flex items-center space-x-4 text-sm font-light"&amp;gt;
            &amp;lt;BiSearch className="hidden h-6 w-6 sm:inline" /&amp;gt;
            &amp;lt;p className="hidden lg:inline"&amp;gt;Kids&amp;lt;/p&amp;gt;
            &amp;lt;BiBell className="h-6 w-6" /&amp;gt;
            &amp;lt;Link href="/account"&amp;gt;
              &amp;lt;img
                src="https://rb.gy/g1pwyx"
                alt="image"
                className="cursor-pointer rounded"
              /&amp;gt;
            &amp;lt;/Link&amp;gt;
          &amp;lt;/div&amp;gt;
        &amp;lt;/header&amp;gt;
      )
    }

    export default Header
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create Loader.tsx file in components folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    function Loader() {
        return (
          &amp;lt;div className="lds-ripple"&amp;gt;
            &amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;
            &amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;
          &amp;lt;/div&amp;gt;
        )
    }

    export default Loader;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create Membership.tsx file in components folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "use client";

    import React, { useState } from 'react'
    import useAuth from '../hooks/useAuth'
    import Loader from './Loader'
    import { useRouter } from 'next/navigation';
    import { deleteDoc, doc } from 'firebase/firestore';
    import { db } from '@/firebase';

    function Membership () {
        const { user } = useAuth();
        const [loading, setLoading] = useState&amp;lt;boolean&amp;gt;(false)
        const router = useRouter()

        const handleClick = async () : Promise&amp;lt;void&amp;gt; =&amp;gt; {
            setLoading(true);
            if(user == null){
                setLoading(false);
                return;
            }
            const docRef = doc(db, "subscriptions", user.uid);
            await deleteDoc(docRef);
            router.push('/');
        }

        return (
            &amp;lt;div className="mt-6 grid grid-cols-1 gap-x-4 border px-4 md:grid-cols-4 md:border-x-0 md:border-t md:border-b-0 md:px-0"&amp;gt;
                &amp;lt;div className="space-y-2 py-4"&amp;gt;
                    &amp;lt;h4 className="text-lg text-[gray]"&amp;gt;Membership &amp;amp; Billing&amp;lt;/h4&amp;gt;
                    &amp;lt;button
                      disabled={loading}
                    className="h-10 w-3/5 whitespace-nowrap bg-gray-300 py-2 text-sm font-medium text-black shadow-md hover:bg-gray-200 md:w-4/5"
                      onClick={handleClick}
                    &amp;gt;
                    {loading ? (
                        &amp;lt;Loader /&amp;gt;
                    ) : (
                        'Cancel Membership'
                    )}
                    &amp;lt;/button&amp;gt;
                &amp;lt;/div&amp;gt;

                &amp;lt;div className="col-span-3"&amp;gt;
                    &amp;lt;div className="flex flex-col justify-between border-b border-white/10 py-4 md:flex-row"&amp;gt;
                    &amp;lt;div&amp;gt;
                        &amp;lt;p className="font-medium"&amp;gt;{user?.email}&amp;lt;/p&amp;gt;
                    &amp;lt;/div&amp;gt;
                    &amp;lt;div className="md:text-right"&amp;gt;
                        &amp;lt;p className="membershipLink"&amp;gt;Change email&amp;lt;/p&amp;gt;
                        &amp;lt;p className="membershipLink"&amp;gt;Change password&amp;lt;/p&amp;gt;
                    &amp;lt;/div&amp;gt;
                    &amp;lt;/div&amp;gt;

                    &amp;lt;div className="flex flex-col justify-between pt-4 pb-4 md:flex-row md:pb-0"&amp;gt;
                        &amp;lt;div className="flex flex-1 flex-col md:text-right"&amp;gt;
                            &amp;lt;p className="membershipLink"&amp;gt;Manage payment info&amp;lt;/p&amp;gt;
                            &amp;lt;p className="membershipLink"&amp;gt;Add backup payment method&amp;lt;/p&amp;gt;
                            &amp;lt;p className="membershipLink"&amp;gt;Billing Details&amp;lt;/p&amp;gt;
                            &amp;lt;p className="membershipLink"&amp;gt;Change billing day&amp;lt;/p&amp;gt;
                        &amp;lt;/div&amp;gt;
                    &amp;lt;/div&amp;gt;
                &amp;lt;/div&amp;gt;
          &amp;lt;/div&amp;gt;
        );
    }

    export default Membership;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create Model.tsx file in components folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "use client";

      import MuiModal from '@mui/material/Modal'
      import {
        collection,
        deleteDoc,
        doc,
        DocumentData,
        onSnapshot,
        setDoc,
      } from 'firebase/firestore'
      import { useEffect, useState } from 'react'
      import toast, { Toaster } from 'react-hot-toast'
      import { FaPlay } from 'react-icons/fa'
      import ReactPlayer from 'react-player/lazy'
      import { useRecoilState } from 'recoil'
      import { modalState, movieState } from '../atoms/modalAtom'
      import { db } from '../firebase'
      import useAuth from '../hooks/useAuth'
      import { Element, Genre, Movie } from '../typings'
    import { AiOutlineCheck, AiOutlinePlus } from 'react-icons/ai';
    import { BsHandThumbsUp } from 'react-icons/bs';
    import { HiOutlineVolumeOff, HiOutlineVolumeUp } from 'react-icons/hi';
    import { RxCross1 } from 'react-icons/rx';

      function Modal() {
        const [showModal, setShowModal] = useRecoilState(modalState)
        const [movie, setMovie] = useRecoilState(movieState)
        const [trailer, setTrailer] = useState('')
        const [genres, setGenres] = useState&amp;lt;Genre[]&amp;gt;([])
        const [muted, setMuted] = useState(true)
        const { user } = useAuth()
        const [addedToList, setAddedToList] = useState(false)
        const [movies, setMovies] = useState&amp;lt;DocumentData[] | Movie[]&amp;gt;([])

        const toastStyle = {
          background: 'white',
          color: 'black',
          fontWeight: 'bold',
          fontSize: '16px',
          padding: '15px',
          borderRadius: '9999px',
          maxWidth: '1000px',
        }

        useEffect(() =&amp;gt; {
          if (!movie) return

          async function fetchMovie() {
            const data = await fetch(
              `https://api.themoviedb.org/3/${
                movie?.media_type === 'tv' ? 'tv' : 'movie'
              }/${movie?.id}?api_key=${
                process.env.NEXT_PUBLIC_API_KEY
              }&amp;amp;language=en-IN&amp;amp;append_to_response=videos`
            )
              .then((response) =&amp;gt; response.json())
              .catch((err) =&amp;gt; console.log(err.message))

            if (data?.videos) {
              const index = data.videos.results.findIndex(
                (element: Element) =&amp;gt; element.type === 'Trailer'
              )
              setTrailer(data.videos?.results[index]?.key)
            }
            if (data?.genres) {
              setGenres(data.genres)
            }
          }

          fetchMovie()
        }, [movie])

        // Find all the movies in the user's list
        useEffect(() =&amp;gt; {
          if (user) {
            return onSnapshot(
              collection(db, 'customers', user.uid, 'myList'),
              (snapshot) =&amp;gt; setMovies(snapshot.docs)
            )
          }
        }, [db, movie?.id])

        // Check if the movie is already in the user's list
        useEffect(
          () =&amp;gt;
            setAddedToList(
              movies.findIndex((result) =&amp;gt; result.data().id === movie?.id) !== -1
            ),
          [movies]
        )

        const handleList = async () =&amp;gt; {
          if (addedToList) {
            await deleteDoc(
              doc(db, 'customers', user!.uid, 'myList', movie?.id.toString()!)
            )

            toast(
              `${movie?.title || movie?.original_name} has been removed from My List`,
              {
                duration: 8000,
                style: toastStyle,
              }
            )
          } else {
            await setDoc(
              doc(db, 'customers', user!.uid, 'myList', movie?.id.toString()!),
              { ...movie }
            )

            toast(
              `${movie?.title || movie?.original_name} has been added to My List`,
              {
                duration: 8000,
                style: toastStyle,
              }
            )
          }
        }

        const handleClose = () =&amp;gt; {
          setShowModal(false)
        }

        console.log(trailer)

        return (
          &amp;lt;MuiModal
            open={showModal}
            onClose={handleClose}
            className="fixex !top-7 left-0 right-0 z-50 mx-auto w-full max-w-5xl overflow-hidden overflow-y-scroll rounded-md scrollbar-hide"
          &amp;gt;
            &amp;lt;&amp;gt;
              &amp;lt;Toaster position="bottom-center" /&amp;gt;
              &amp;lt;button
                onClick={handleClose}
                className="modalButton absolute right-5 top-5 !z-40 h-9 w-9 border-none bg-[#181818] hover:bg-[#181818]"
              &amp;gt;
                &amp;lt;RxCross1 className="h-6 w-6" /&amp;gt;
              &amp;lt;/button&amp;gt;

              &amp;lt;div className="relative pt-[56.25%]"&amp;gt;
                &amp;lt;ReactPlayer
                  url={`https://www.youtube.com/watch?v=${trailer}`}
                  width="100%"
                  height="100%"
                  style={{ position: 'absolute', top: '0', left: '0' }}
                  playing
                  muted={muted}
                /&amp;gt;
                &amp;lt;div className="absolute bottom-10 flex w-full items-center justify-between px-10"&amp;gt;
                  &amp;lt;div className="flex space-x-2"&amp;gt;
                    &amp;lt;button className="flex items-center gap-x-2 rounded bg-white px-8 text-xl font-bold text-black transition hover:bg-[#e6e6e6]"&amp;gt;
                      &amp;lt;FaPlay className="h-7 w-7 text-black" /&amp;gt;
                      Play
                    &amp;lt;/button&amp;gt;

                    &amp;lt;button className="modalButton" onClick={handleList}&amp;gt;
                      {addedToList ? (
                        &amp;lt;AiOutlineCheck className="h-7 w-7" /&amp;gt;
                      ) : (
                        &amp;lt;AiOutlinePlus className="h-7 w-7" /&amp;gt;
                      )}
                    &amp;lt;/button&amp;gt;

                    &amp;lt;button className="modalButton"&amp;gt;
                      &amp;lt;BsHandThumbsUp className="h-7 w-7" /&amp;gt;
                    &amp;lt;/button&amp;gt;
                  &amp;lt;/div&amp;gt;
                  &amp;lt;button className="modalButton" onClick={() =&amp;gt; setMuted(!muted)}&amp;gt;
                    {muted ? (
                      &amp;lt;HiOutlineVolumeOff className="h-6 w-6" /&amp;gt;
                    ) : (
                      &amp;lt;HiOutlineVolumeUp className="h-6 w-6" /&amp;gt;
                    )}
                  &amp;lt;/button&amp;gt;
                &amp;lt;/div&amp;gt;
              &amp;lt;/div&amp;gt;

              &amp;lt;div className="flex space-x-16 rounded-b-md bg-[#181818] px-10 py-8"&amp;gt;
                &amp;lt;div className="space-y-6 text-lg"&amp;gt;
                  &amp;lt;div className="flex items-center space-x-2 text-sm"&amp;gt;
                    &amp;lt;p className="font-semibold text-green-400"&amp;gt;
                      {movie!.vote_average * 10}% Match
                    &amp;lt;/p&amp;gt;
                    &amp;lt;p className="font-light"&amp;gt;
                      {movie?.release_date || movie?.first_air_date}
                    &amp;lt;/p&amp;gt;
                    &amp;lt;div className="flex h-4 items-center justify-center rounded border border-white/40 px-1.5 text-xs"&amp;gt;
                      HD
                    &amp;lt;/div&amp;gt;
                  &amp;lt;/div&amp;gt;

                  &amp;lt;div className="flex flex-col gap-x-10 gap-y-4 font-light md:flex-row"&amp;gt;
                    &amp;lt;p className="w-5/6"&amp;gt;{movie?.overview}&amp;lt;/p&amp;gt;
                    &amp;lt;div className="flex flex-col space-y-3 text-sm"&amp;gt;
                      &amp;lt;div&amp;gt;
                        &amp;lt;span className="text-[gray]"&amp;gt;Genres: &amp;lt;/span&amp;gt;
                        {genres.map((genre) =&amp;gt; genre.name).join(', ')}
                      &amp;lt;/div&amp;gt;

                      &amp;lt;div&amp;gt;
                        &amp;lt;span className="text-[gray]"&amp;gt;Original language: &amp;lt;/span&amp;gt;
                        {movie?.original_language}
                      &amp;lt;/div&amp;gt;

                      &amp;lt;div&amp;gt;
                        &amp;lt;span className="text-[gray]"&amp;gt;Total votes: &amp;lt;/span&amp;gt;
                        {movie?.vote_count}
                      &amp;lt;/div&amp;gt;
                    &amp;lt;/div&amp;gt;
                  &amp;lt;/div&amp;gt;
                &amp;lt;/div&amp;gt;
              &amp;lt;/div&amp;gt;
            &amp;lt;/&amp;gt;
          &amp;lt;/MuiModal&amp;gt;
        )
      }

      export default Modal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create Page.tsx file in components folder. This will be our home page whcih will contain all the movies data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "use client";

    import React, { useEffect, useState } from 'react'
    import Header from './Header'
    import Banner from './Banner'
    import Row from './Row'
    import { Movie } from '@/typings'
    import useAuth from '@/hooks/useAuth'
    import { useRecoilValue } from 'recoil';
    import { modalState, movieState } from '@/atoms/modalAtom';
    import Modal from './Modal';
    import Plans from './Plan';
    import Loader from './Loader';
    import useList from '@/hooks/useList';
    import { doc, getDoc } from 'firebase/firestore';
    import { db } from '@/firebase';
    import { User } from 'firebase/auth';

    interface Props {
        netflixOriginals: Movie[]
        trendingNow: Movie[]
        topRated: Movie[]
        actionMovies: Movie[]
        comedyMovies: Movie[]
        horrorMovies: Movie[]
        romanceMovies: Movie[]
        documentaries: Movie[]
      }

    const Page = ({netflixOriginals,
        actionMovies,
        comedyMovies,
        documentaries,
        horrorMovies,
        romanceMovies,
        topRated,
        trendingNow,
    } : Props) =&amp;gt; {

        const { loading, user } = useAuth();
        const [subscription, setSubscription] = useState&amp;lt;boolean | null&amp;gt;(null)
        const showModal = useRecoilValue(modalState);
        const movie = useRecoilValue(movieState);
        const list = useList(user?.uid)
        useEffect(() =&amp;gt; {
          if(user != null)
            fetchSubscription()
        }, [user])

        const fetchSubscription = async () : Promise&amp;lt;void&amp;gt; =&amp;gt; {
          const isSub = await isSubscribed(user);
          setSubscription(isSub)

          console.log(subscription)
        }

        const isSubscribed = async (user: User | null) : Promise&amp;lt;boolean | null&amp;gt; =&amp;gt; {
          if(user == null) return null;
          const userRef =  doc(db, "subscriptions", user.uid);
          const docSnap = await getDoc(userRef);
          if(!docSnap.exists()) return false;
          else{
            const data = docSnap.data();
            const newdate = new Date().toISOString()
            const expiryDate = data.subscriptionExpiryDate
            if(newdate &amp;gt; expiryDate){
              return false
            }
            else{
              return true;
            }
          }
        }

        if(user == null) return &amp;lt;Loader /&amp;gt;;
        if (loading || subscription === null) return &amp;lt;Loader /&amp;gt;;

        if (!subscription) return &amp;lt;Plans /&amp;gt;;
        console.log("subscription: ", subscription)

      return (
        &amp;lt;div className={`relative h-screen bg-gradient-to-b lg:h-[140vh] ${
            showModal &amp;amp;&amp;amp; '!h-screen overflow-hidden'
          }`}&amp;gt;
             &amp;lt;Header /&amp;gt;
             &amp;lt;main className="relative pl-4 pb-24 lg:space-y-24 lg:pl-16"&amp;gt;
              &amp;lt;Banner netflixOriginals={netflixOriginals} /&amp;gt;
              &amp;lt;section className="md:space-y-24"&amp;gt;
              &amp;lt;Row title="Trending Now" movies={trendingNow} /&amp;gt;
              &amp;lt;Row title="Top Rated" movies={topRated} /&amp;gt;
              &amp;lt;Row title="Action Thrillers" movies={actionMovies} /&amp;gt;
              {list.length &amp;gt; 0 &amp;amp;&amp;amp; &amp;lt;Row title="My List" movies={list} /&amp;gt;}
              &amp;lt;Row title="Comedies" movies={comedyMovies} /&amp;gt;
              &amp;lt;Row title="Scary Movies" movies={horrorMovies} /&amp;gt;
              &amp;lt;Row title="Romance Movies" movies={romanceMovies} /&amp;gt;
              &amp;lt;Row title="Documentaries" movies={documentaries} /&amp;gt;
              &amp;lt;/section&amp;gt;
             &amp;lt;/main&amp;gt;
             {showModal &amp;amp;&amp;amp; &amp;lt;Modal /&amp;gt;}
          &amp;lt;/div&amp;gt;
      )
    }

    export default Page
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now create PaymentForm.tsx in components folder. This folder is very important for for payment and subcription.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    'use client';

    import React, { useEffect, useState } from 'react';
    import { Plan } from '@/typings';
    import { User } from 'firebase/auth';
    import { addDoc, collection, doc, getDoc, getDocs, query, setDoc, updateDoc } from 'firebase/firestore';
    import { db } from '@/firebase';
    import Razorpay from 'razorpay';
    import Loader from './Loader';
    import { useRouter } from 'next/navigation';
    import useAuth from '@/hooks/useAuth';

    declare global {
        interface Window {
          Razorpay: any;
        }
      }

    interface Props {
      selectedPlan: Plan;
      previousPlan: Plan | null;
      user: User | null,
      handleClose: () =&amp;gt; void;
    }

    const initializeRazorpay = async (): Promise&amp;lt;any&amp;gt; =&amp;gt; {
        return new Promise((resolve) =&amp;gt; {
          const script = document.createElement("script");
          script.src = "https://checkout.razorpay.com/v1/checkout.js";

          script.onload = () =&amp;gt; {
            resolve(true);
          };
          script.onerror = () =&amp;gt; {
            resolve(false);
          };

          document.body.appendChild(script);
        });
      }

    const PaymentForm: React.FC&amp;lt;Props&amp;gt; = ({ selectedPlan, previousPlan, user, handleClose }) =&amp;gt; {
      const [paymentCompleted, setPaymentCompleted] = useState(false);
      const [amount, setAmount] = useState(selectedPlan.amount);
      const [loading, setLoading] = useState(false);
      const router = useRouter()

      useEffect(() =&amp;gt; {
        if(previousPlan != null) setAmount(selectedPlan.amount - previousPlan.amount);
      }, [])

      const handlePayment = async (e: any): Promise&amp;lt;void&amp;gt; =&amp;gt; {
        setLoading(true)
        e.preventDefault();
        const currentUser = user;
        if(currentUser == null) return;
        const orderResponse = await createRazorpayOrder(amount);
        const orderId = orderResponse;

          try {
            const res = await initializeRazorpay();
            if (!res) {
                alert("Your are offline.... Razorpay SDK Failed to load");
                return;
              }

              const options = {
                key: process.env.RAZORPAY_KEY,
                amount: amount, // Amount in paise or smallest currency unit
                currency: 'INR',
                name: 'Netflix',
                description: 'Subscription Payment',
                order_id: orderId,
                image: "@/app/favicon.ico",
                handler: async function (response: any) {
                  // Verify the payment with Razorpay API
                    // Payment successful, update user's subscription status in Firestore
                  const expiryDate = calculateExpiryDate();

                  await updateSubscriptionStatus(currentUser.uid, selectedPlan, orderId, expiryDate)
                  setPaymentCompleted(true);
                  location.reload();
                },
                prefill: {
                  email: currentUser.email,
                },
                notes: {
                  planName: selectedPlan.name,
                  planId: selectedPlan.id,
                  userId: currentUser.uid,
                },
                theme: {
                  color: '#F37254',
                },
              }

            const razorpay = new window.Razorpay(options);
            razorpay.open();
          }
        catch (error) {
            // Handle errors during payment process
            console.log('Payment error:', error);
            handleClose(); // Close the payment form
          }
          setLoading(false);
      };

      const createRazorpayOrder = async (amount: number): Promise&amp;lt;any&amp;gt; =&amp;gt; {
        const response = await fetch('/api/create-razorpay-order', {
            method: 'POST',
            body: JSON.stringify({ amount }),
            headers: {
              'Content-Type': 'application/json',
            },
          });
          const data = await response.json();
          return data.id;
      };

      const calculateExpiryDate = (): string =&amp;gt; {
        const currentDate = new Date();
        const expiryDate = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, currentDate.getDate());
        return expiryDate.toISOString();
      };

      const updateSubscriptionStatus = async (
        userId: string,
        plan: Plan,
        subscriptionId: string,
        expiryDate: string
      ): Promise&amp;lt;void&amp;gt; =&amp;gt; {
        try {
        //   const userRef = doc(db, 'subscriptions', userId);
          const userRef =  doc(db, "subscriptions", userId);
          const docSnap = await getDoc(userRef);
          //find userId in firestore and if present then update doc otherwise addDoc


          if(docSnap.exists()){
            await updateDoc(doc(db, 'subscriptions', userId), {
                subscriptionPlan: plan.name,
                subscriptionPlanId: plan.id,
                subscriptionAmount: plan.amount,
                subscriptionExpiryDate: expiryDate,
                subscriptionId,
              });
          }
          else{
            await setDoc(userRef, {
                subscriptionPlan: plan.name,
                subscriptionPlanId: plan.id,
                subscriptionAmount: plan.amount,
                subscriptionExpiryDate: expiryDate,
                subscriptionId,
              })
          }
          console.log('Subscription status updated successfully');
          // Add any further logic or redirection after successful subscription update
        } catch (error) {
          // Handle errors during subscription status update
          console.log('Subscription status update error:', error);
        }
      };

      return (
        &amp;lt;div className="bg-gray-900 text-white p-8 rounded-lg shadow-lg pt-28"&amp;gt;
          {paymentCompleted ? (
            &amp;lt;div&amp;gt;
              &amp;lt;h2 className="text-3xl mb-4"&amp;gt;Payment Completed!&amp;lt;/h2&amp;gt;
              &amp;lt;p className="text-xl"&amp;gt;Thank you for your subscription.&amp;lt;/p&amp;gt;
              &amp;lt;p className="text-xl"&amp;gt;Just wait your would be redirected to home.&amp;lt;/p&amp;gt;
            &amp;lt;/div&amp;gt;
          ) : (
            &amp;lt;div&amp;gt;
              &amp;lt;h2 className="text-3xl mb-4"&amp;gt;Payment Form&amp;lt;/h2&amp;gt;
              &amp;lt;p className="text-xl mb-4"&amp;gt;Selected Plan: {selectedPlan.name}&amp;lt;/p&amp;gt;
              &amp;lt;p className="text-xl mb-4"&amp;gt;Video Quality: {selectedPlan.videoQuality}&amp;lt;/p&amp;gt;
              &amp;lt;p className="text-xl mb-4"&amp;gt;Resolution: {selectedPlan.resolution}&amp;lt;/p&amp;gt;
              &amp;lt;p className="text-xl mb-4"&amp;gt;Description: {selectedPlan.description}&amp;lt;/p&amp;gt;
              &amp;lt;p className="text-xl mb-4"&amp;gt;Price: INR {selectedPlan.amount}.00&amp;lt;/p&amp;gt;
              &amp;lt;p className="text-xl mb-4"&amp;gt;Amount Payable: INR {amount}.00&amp;lt;/p&amp;gt;
              {!loading ? &amp;lt;&amp;gt;
                &amp;lt;button
                className="bg-red-600 hover:bg-red-700 text-white px-6 py-3 rounded-lg mr-4"
                onClick={handlePayment}
              &amp;gt;
                Proceed to Pay
              &amp;lt;/button&amp;gt;
              &amp;lt;button
                className="bg-gray-800 hover:bg-gray-900 text-white px-6 py-3 rounded-lg"
                onClick={handleClose}
              &amp;gt;
                Cancel
              &amp;lt;/button&amp;gt;
              &amp;lt;/&amp;gt; : &amp;lt;Loader /&amp;gt;}
            &amp;lt;/div&amp;gt;
          )}
          &amp;lt;/div&amp;gt;
      );
    };

    export default PaymentForm;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create Plan.tsx file in components folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "use client";

    import Link from 'next/link'
    import { useEffect, useState } from 'react'
    import useAuth from '../hooks/useAuth'
    import Loader from './Loader'
    import { AiOutlineCheck } from 'react-icons/ai'
    import Table from './Table';
    import { Plan } from '@/typings';
    import PaymentForm from './PaymentForm';
    import { doc, getDoc } from 'firebase/firestore';
    import { db } from '@/firebase';
    import plans from '@/utils/data'

    function Plans() {
      const { logout, user, planDetails } = useAuth()
      const [selectedPlan, setSelectedPlan] = useState&amp;lt;Plan&amp;gt;(plans[2])
      const [isBillingLoading, setBillingLoading] = useState(false)
      const [showPaymentForm, setShowPaymentForm] = useState(false);
      const [previousPlan, setPreviousPlan] = useState&amp;lt;Plan | null&amp;gt;(null)
      const [loading, setLoading] = useState&amp;lt;boolean&amp;gt;(false)

      useEffect(() =&amp;gt; {
        setLoading(true)
        fetchSubscribes()
        setLoading(false)
      }, [planDetails])

      const fetchSubscribes = async (): Promise&amp;lt;void&amp;gt; =&amp;gt; {
        if (!user) return;
        const userRef =  doc(db, "subscriptions", user.uid);
        const docSnap = await getDoc(userRef);
        if(docSnap.exists()){
          if(!docSnap.data().subscriptionPlanId) return;
            for(let i=0; i&amp;lt;plans.length; i++){
              if(plans[i].id == docSnap.data().subscriptionPlanId){
                setPreviousPlan(plans[i])
                setSelectedPlan(plans[i])
                break;
              }
            }
        }
      }

      const subscribeToPlan = async () =&amp;gt; {
        if (!user) return

        setBillingLoading(true)
        setShowPaymentForm(true);
        setBillingLoading(false)
      }

      const handlePaymentFormClose = () =&amp;gt; {
        setShowPaymentForm(false);
      };

      if(loading) return &amp;lt;Loader /&amp;gt;

      return (
        &amp;lt;div&amp;gt;
          &amp;lt;header className="border-b border-white/10 bg-[#141414]"&amp;gt;
            &amp;lt;Link href="/"&amp;gt;
              &amp;lt;img
                src="https://rb.gy/ulxxee"
                alt="Netflix"
                width={150}
                height={90}
                className="cursor-pointer object-contain"
              /&amp;gt;
            &amp;lt;/Link&amp;gt;
            &amp;lt;button
              className="text-lg font-medium hover:underline"
              onClick={logout}
            &amp;gt;
              Sign Out
            &amp;lt;/button&amp;gt;
          &amp;lt;/header&amp;gt;
          {!showPaymentForm ?
          &amp;lt;main className="mx-auto max-w-5xl px-5 pt-28 pb-12 transition-all md:px-10"&amp;gt;
            &amp;lt;h1 className="mb-3 text-3xl font-medium"&amp;gt;
              Choose the plan that's right for you
            &amp;lt;/h1&amp;gt;
            &amp;lt;ul&amp;gt;
              &amp;lt;li className="flex items-center gap-x-2 text-lg"&amp;gt;
                &amp;lt;AiOutlineCheck className="h-7 w-7 text-[#E50914]" /&amp;gt; Watch all you want.
                Ad-free.
              &amp;lt;/li&amp;gt;
              &amp;lt;li className="flex items-center gap-x-2 text-lg"&amp;gt;
                &amp;lt;AiOutlineCheck className="h-7 w-7 text-[#E50914]" /&amp;gt; Recommendations
                just for you.
              &amp;lt;/li&amp;gt;
              &amp;lt;li className="flex items-center gap-x-2 text-lg"&amp;gt;
                &amp;lt;AiOutlineCheck className="h-7 w-7 text-[#E50914]" /&amp;gt; Upgrade or cancel
                your plan anytime.
              &amp;lt;/li&amp;gt;
            &amp;lt;/ul&amp;gt;

            &amp;lt;div className="mt-4 flex flex-col space-y-5"&amp;gt;
              &amp;lt;div className="flex w-full items-center justify-center self-end md:w-3/5"&amp;gt;
                {plans.map((item) =&amp;gt; (
                    &amp;lt;button
                    key={item.id}
                    className={`planBox cursor-pointer ${
                        selectedPlan?.id === item.id ? 'opacity-100' : 'opacity-60'
                      }`}
                      onClick={() =&amp;gt; setSelectedPlan(item)}
                  &amp;gt;
                    {item.name}
                    &amp;lt;/button&amp;gt;
                ))}
              &amp;lt;/div&amp;gt;

              &amp;lt;Table plans={plans} selectedPlan={selectedPlan}  /&amp;gt;

              {(previousPlan ==null || previousPlan.amount &amp;lt; selectedPlan.amount) &amp;amp;&amp;amp; &amp;lt;button
                disabled={!selectedPlan || isBillingLoading}
                className={`mx-auto w-11/12 rounded bg-[#E50914] py-4 text-xl shadow hover:bg-[#f6121d] md:w-[420px] ${
                  isBillingLoading &amp;amp;&amp;amp; 'opacity-60'
                }`}
                onClick={subscribeToPlan}
              &amp;gt;
                {isBillingLoading ? (
                  &amp;lt;Loader /&amp;gt;
                ) : (
                  'Subscribe'
                )}
              &amp;lt;/button&amp;gt;}
            &amp;lt;/div&amp;gt;
          &amp;lt;/main&amp;gt;
          :
            &amp;lt;PaymentForm selectedPlan={selectedPlan} previousPlan={previousPlan} user={user} handleClose={handlePaymentFormClose} /&amp;gt;
          }
        &amp;lt;/div&amp;gt;
      )
    }

    export default Plans
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create Row.tsx in components folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "use client";

    import { AiOutlineLeft, AiOutlineRight } from 'react-icons/ai';
    import { DocumentData } from 'firebase/firestore'
    import { useRef, useState } from 'react'
    import { Movie } from '../typings'
    import Thumbnail from './Thumbnail'

    interface Props {
      title: string
      movies: Movie[] | DocumentData[]
    }

    function Row({ title, movies }: Props) {
      const rowRef = useRef&amp;lt;HTMLDivElement&amp;gt;(null)
      const [isMoved, setIsMoved] = useState(false)

      const handleClick = (direction: string) =&amp;gt; {
        setIsMoved(true)

        if (rowRef.current) {
          const { scrollLeft, clientWidth } = rowRef.current;

          const scrollTo = direction === 'left' ? scrollLeft - clientWidth : scrollLeft + clientWidth;

          rowRef.current.scrollTo({ left: scrollTo, behavior: 'smooth' });
        }
      }

      return (
        &amp;lt;div className="h-40 space-y-0.5 md:space-y-2"&amp;gt;
          &amp;lt;h2 className="w-56 cursor-pointer text-sm font-semibold text-[#e5e5e5] transition duration-200 hover:text-white md:text-2xl"&amp;gt;
            {title}
          &amp;lt;/h2&amp;gt;
          &amp;lt;div className="group relative md:-ml-2"&amp;gt;
            &amp;lt;AiOutlineLeft
              className={`absolute top-0 bottom-0 left-2 z-40 m-auto h-9 w-9 cursor-pointer opacity-0 transition hover:scale-125 group-hover:opacity-100 ${
                !isMoved &amp;amp;&amp;amp; 'hidden'
              }`}
              onClick={() =&amp;gt; handleClick('left')}
            /&amp;gt;

            &amp;lt;div
              ref={rowRef}
              className="flex items-center space-x-0.5 overflow-x-scroll no-scrollbar md:space-x-2.5 md:p-2"
            &amp;gt;
              {movies.map((movie) =&amp;gt; (
                &amp;lt;Thumbnail key={movie.id} movie={movie} /&amp;gt;
              ))}
            &amp;lt;/div&amp;gt;

            &amp;lt;AiOutlineRight
              className={`absolute top-0 bottom-0 right-2 z-40 m-auto h-9 w-9 cursor-pointer opacity-0 transition hover:scale-125 group-hover:opacity-100`}
              onClick={() =&amp;gt; handleClick('right')}
            /&amp;gt;
          &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
      )
    }

    export default Row
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create Table.tsx in components folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import { Plan } from '@/typings'
    import { AiOutlineCheck } from 'react-icons/ai'

    interface Props {
        plans: Plan[]
        selectedPlan: Plan | null
    }

    function Table({ plans, selectedPlan }: Props) {
      return (
        &amp;lt;table&amp;gt;
          &amp;lt;tbody className="divide-y divide-[gray]"&amp;gt;
            &amp;lt;tr className="tableRow"&amp;gt;
              &amp;lt;td className="tableDataTitle"&amp;gt;Monthly price&amp;lt;/td&amp;gt;

              {plans.map((item) =&amp;gt; (
                &amp;lt;td
                  key={item.id}
                  className={`tableDataFeature ${
                    selectedPlan?.id === item.id
                      ? 'text-[#e50914]'
                      : 'text-[gray]'
                  }`}
                &amp;gt;
                  INR {item.amount}
                &amp;lt;/td&amp;gt;
              ))}
            &amp;lt;/tr&amp;gt;

            &amp;lt;tr className="tableRow"&amp;gt;
              &amp;lt;td className="tableDataTitle"&amp;gt;Video quality&amp;lt;/td&amp;gt;

              {plans.map((item) =&amp;gt; (
                &amp;lt;td
                  key={item.id}
                  className={`tableDataFeature ${
                    selectedPlan?.id === item.id
                      ? 'text-[#e50914]'
                      : 'text-[gray]'
                  }`}
                &amp;gt;
                  {item.videoQuality}
                &amp;lt;/td&amp;gt;
              ))}
            &amp;lt;/tr&amp;gt;

            &amp;lt;tr className="tableRow"&amp;gt;
              &amp;lt;td className="tableDataTitle"&amp;gt;Resolution&amp;lt;/td&amp;gt;
              {plans.map((item) =&amp;gt; (
                &amp;lt;td
                  key={item.id}
                  className={`tableDataFeature ${
                    selectedPlan?.id === item.id
                      ? 'text-[#e50914]'
                      : 'text-[gray]'
                  }`}
                &amp;gt;
                  {item.resolution}
                &amp;lt;/td&amp;gt;
              ))}
            &amp;lt;/tr&amp;gt;

            &amp;lt;tr className="tableRow"&amp;gt;
              &amp;lt;td className="tableDataTitle"&amp;gt;
                Availability
              &amp;lt;/td&amp;gt;
              {plans.map((item) =&amp;gt; (
                &amp;lt;td
                  key={item.id}
                  className={`tableDataFeature ${
                    selectedPlan?.id === item.id
                      ? 'text-[#e50914]'
                      : 'text-[gray]'
                  }`}
                &amp;gt;
                  {item.description}
                &amp;lt;/td&amp;gt;
              ))}
            &amp;lt;/tr&amp;gt;
          &amp;lt;/tbody&amp;gt;
        &amp;lt;/table&amp;gt;
      )
    }

    export default Table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create Thumbnail.tsx file in components folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "use client";

    import React from 'react';
    import { Movie } from '../typings';
    import Image from 'next/image';
    import { DocumentData } from 'firebase/firestore';
    import { useRecoilState } from 'recoil';
    import { modalState, movieState } from '@/atoms/modalAtom';

    interface Props {
        movie: Movie | DocumentData
      }

    const Thumbnail = ({ movie }: Props) =&amp;gt; {

      const [showModal, setShowModal] = useRecoilState(modalState)
      const [currentMovie, setCurrentMovie] = useRecoilState(movieState)

      return (
        &amp;lt;div
          className="relative h-28 min-w-[180px] cursor-pointer transition duration-200 ease-out md:h-36 md:min-w-[260px] md:hover:scale-105"
          onClick={() =&amp;gt; {
            setCurrentMovie(movie)
            setShowModal(true)
          }}
        &amp;gt;
          &amp;lt;Image
            src={`https://image.tmdb.org/t/p/w500${
              movie.backdrop_path || movie.poster_path
            }`}
            className="rounded-sm object-cover md:rounded"
            fill={true}
            alt={`thumbnail-${movie.id}`}
          /&amp;gt;
        &amp;lt;/div&amp;gt;
      )
    }

    export default Thumbnail
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, lets code the page.tsx file. In page.tsx we will just fetch the movies data and sent it to the Page component.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    import { fetchAllData } from '@/actions/actions'
    import { Movie } from '../typings'
    import Page from '@/components/Page';

    interface Props {
      netflixOriginals: Movie[]
      trendingNow: Movie[]
      topRated: Movie[]
      actionMovies: Movie[]
      comedyMovies: Movie[]
      horrorMovies: Movie[]
      romanceMovies: Movie[]
      documentaries: Movie[]
    }

    export default async function Home() {
      const {netflixOriginals,
        actionMovies,
        comedyMovies,
        documentaries,
        horrorMovies,
        romanceMovies,
        topRated,
        trendingNow} : Props = await fetchAllData();

        return (
          &amp;lt;Page {...{netflixOriginals,
            actionMovies,
            comedyMovies,
            documentaries,
            horrorMovies,
            romanceMovies,
            topRated,
            trendingNow,}} /&amp;gt;
        );

    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, lets create the login page. Create a login folder in app directory. Within the folder create &lt;em&gt;layout.tsx&lt;/em&gt;, &lt;em&gt;loading.tsx&lt;/em&gt; and *page.tsx *files. Below are the code for all the files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // page.tsx
    import { fetchAllData } from '@/actions/actions'
    import { Movie } from '../typings'
    import Page from '@/components/Page';

    interface Props {
      netflixOriginals: Movie[]
      trendingNow: Movie[]
      topRated: Movie[]
      actionMovies: Movie[]
      comedyMovies: Movie[]
      horrorMovies: Movie[]
      romanceMovies: Movie[]
      documentaries: Movie[]
    }

    export default async function Home() {
      const {netflixOriginals,
        actionMovies,
        comedyMovies,
        documentaries,
        horrorMovies,
        romanceMovies,
        topRated,
        trendingNow} : Props = await fetchAllData();

        return (
          &amp;lt;Page {...{netflixOriginals,
            actionMovies,
            comedyMovies,
            documentaries,
            horrorMovies,
            romanceMovies,
            topRated,
            trendingNow,}} /&amp;gt;
        );

    }

    // layout.tsx
    import type { Metadata } from 'next'

    export const metadata: Metadata = {
      title: 'NETFLIX - Login',
      description: 'Watch your favorite movies and TV shows on Netflix.',
    }

    export default function RootLayout({
      children,
    }: {
      children: React.ReactNode
    }) {
      return (
          &amp;lt;section className="flex flex-col items-center"&amp;gt;
              {children}
          &amp;lt;/section&amp;gt;
      )
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // loading.tsx
    import Loader from '@/components/Loader'
    import React from 'react'

    const loading = () =&amp;gt; {
      return (
        &amp;lt;div className='pt-36'&amp;gt;
        &amp;lt;Loader /&amp;gt;
        &amp;lt;/div&amp;gt;
      )
    }

    export default loading
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally create a account folder in app directory. Within the folder create &lt;em&gt;layout.tsx&lt;/em&gt;, &lt;em&gt;loading.tsx&lt;/em&gt; and *page.tsx *files. Below are the code for all the files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // layout.tsx
    import type { Metadata } from 'next'

    export const metadata: Metadata = {
      title: 'Account Settings - Netflix',
      description: 'Watch your favorite movies and TV shows on Netflix.',
    }

    export default function RootLayout({
      children,
    }: {
      children: React.ReactNode
    }) {
      return (
          &amp;lt;section className="flex flex-col items-center"&amp;gt;
              {children}
          &amp;lt;/section&amp;gt;
      )
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // loading.tsx
    import Loader from '@/components/Loader'
    import React from 'react'

    const loading = () =&amp;gt; {
      return (
        &amp;lt;div className='pt-36'&amp;gt;
        &amp;lt;Loader /&amp;gt;
        &amp;lt;/div&amp;gt;
      )
    }

    export default loading
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // page.tsx
    "use client";

    import React, { useEffect, useState } from 'react';
    import Link from 'next/link';
    import useAuth from '@/hooks/useAuth';
    import Membership from '@/components/Membership';
    import { useRouter } from 'next/navigation';
    import Loader from '@/components/Loader';
    import Plans from '@/components/Plan';
    import { doc, getDoc } from 'firebase/firestore';
    import { db } from '@/firebase';
    import { User } from 'firebase/auth';

    interface Props{
      id: string;
      name: string;
      amount: number;
      expiry: Date;
    }

    const Page = () =&amp;gt; {
        const { user, logout } = useAuth()
        const [showPlan, setShowPlan] = useState&amp;lt;boolean&amp;gt;(false)
        const [plan, setPlan] = useState&amp;lt;Props | null&amp;gt;(null)

        const router = useRouter()
        const [loading, setLoading] = useState&amp;lt;boolean&amp;gt;(false);

        useEffect(() =&amp;gt; {
          isSubscribed(user);
        }, [])

          const isSubscribed = async (user: User | null) : Promise&amp;lt;void&amp;gt; =&amp;gt; {
            setLoading(true);
            if(user == null){
              setLoading(false);
              return;
            }
            const userRef =  doc(db, "subscriptions", user.uid);
            const docSnap = await getDoc(userRef);
            if(!docSnap.exists()) return;
            else{
              const data = docSnap.data();
              const newdate = new Date().toISOString()
              const expiryDate = data.subscriptionExpiryDate
              if(newdate &amp;gt; expiryDate){
                setPlan(null)
              }
              else{
                setPlan({id: data.subscriptionPlanId, name: data.subscriptionPlan, amount: data.subscriptionAmount, expiry: expiryDate})
              }
            }
            setLoading(false);
          }

        if(showPlan) return &amp;lt;div className='pt-32 space-y-2'&amp;gt;
          &amp;lt;button onClick={() =&amp;gt; setShowPlan(false)} className='cursor-pointer hover:underline -mb-28 font-bold text-xl'&amp;gt;Cancel&amp;lt;/button&amp;gt;
            &amp;lt;Plans /&amp;gt;
          &amp;lt;/div&amp;gt;

        if(loading) return &amp;lt;div className="flex pt-32 items-center"&amp;gt;&amp;lt;Loader /&amp;gt;&amp;lt;/div&amp;gt;

      return (
        &amp;lt;div&amp;gt;
          &amp;lt;header className={`bg-[#141414]`}&amp;gt;
            &amp;lt;Link href="/"&amp;gt;
              &amp;lt;img
                src="https://rb.gy/ulxxee"
                width={120}
                height={120}
                className="cursor-pointer object-contain"
                alt="image"
              /&amp;gt;
            &amp;lt;/Link&amp;gt;
            &amp;lt;Link href="/account"&amp;gt;
              &amp;lt;img
                src="https://rb.gy/g1pwyx"
                alt="new-image"
                className="cursor-pointer rounded"
              /&amp;gt;
            &amp;lt;/Link&amp;gt;
          &amp;lt;/header&amp;gt;

          &amp;lt;main className="mx-auto max-w-6xl px-5 pt-24 pb-12 transition-all md:px-10"&amp;gt;
            &amp;lt;div className="flex flex-col gap-x-4 md:flex-row md:items-center"&amp;gt;
              &amp;lt;h1 className="text-3xl md:text-4xl"&amp;gt;Account&amp;lt;/h1&amp;gt;
              &amp;lt;div className="-ml-0.5 flex items-center gap-x-1.5"&amp;gt;
                &amp;lt;img src="https://rb.gy/4vfk4r" alt="" className="h-7 w-7" /&amp;gt;
                &amp;lt;p className="text-xs font-semibold text-[#555]"&amp;gt;
                  {plan!=null ? `Membership will expire on ${(new Date(plan.expiry)).toDateString()}` : 'Membership Expired!'}
                &amp;lt;/p&amp;gt;
              &amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;

            {plan!=null &amp;amp;&amp;amp; &amp;lt;Membership /&amp;gt;}

            &amp;lt;div className="mt-6 grid grid-cols-1 gap-x-4 border px-4 py-4 md:grid-cols-4 md:border-x-0 md:border-t md:border-b-0 md:px-0 md:pb-0 items-center"&amp;gt;
              {plan!=null &amp;amp;&amp;amp; &amp;lt;h4 className="text-lg text-[gray]"&amp;gt;Plan Name:&amp;lt;/h4&amp;gt;}
              {/* Find the current plan */}
              {plan!=null &amp;amp;&amp;amp; &amp;lt;div className="col-span-2 font-medium"&amp;gt;
                {plan.name}
              &amp;lt;/div&amp;gt;}
              &amp;lt;button onClick={() =&amp;gt; setShowPlan(true)} className="cursor-pointer flex flex-1 text-blue-500 hover:underline md:text-right"&amp;gt;
                Change plan
              &amp;lt;/button&amp;gt;
            &amp;lt;/div&amp;gt;

            &amp;lt;div className="mt-6 grid grid-cols-1 gap-x-4 border px-4 py-4 md:grid-cols-4 md:border-x-0 md:border-t md:border-b-0 md:px-0"&amp;gt;
              &amp;lt;h4 className="text-lg text-[gray]"&amp;gt;Settings&amp;lt;/h4&amp;gt;
              &amp;lt;p
                className="col-span-3 cursor-pointer text-blue-500 hover:underline"
                onClick={logout}
              &amp;gt;
                Sign out
              &amp;lt;/p&amp;gt;
            &amp;lt;/div&amp;gt;
          &amp;lt;/main&amp;gt;
        &amp;lt;/div&amp;gt;
      )
    }

    export default Page
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One thing I missed in my last article was that the &lt;em&gt;tailwind.config.js&lt;/em&gt; file needed to be changed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    /** @type {import('tailwindcss').Config} */
    module.exports = {
      content: [
        './pages/**/*.{js,ts,jsx,tsx,mdx}',
        './components/**/*.{js,ts,jsx,tsx,mdx}',
        './app/**/*.{js,ts,jsx,tsx,mdx}',
      ],
      theme: {
        extend: {
          backgroundImage: {
            'gradient-to-b':
              'linear-gradient(to bottom,rgba(20,20,20,0) 0,rgba(20,20,20,.15) 15%,rgba(20,20,20,.35) 29%,rgba(20,20,20,.58) 44%,#141414 68%,#141414 100%);',
          },
        },
      },
      plugins: [],
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;You may now host your website using free services like vercel or commercial ones like Hostinger, Digitalocean, and more. The subscription is completely working, and you can get subscriptions using razorpay test cards.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Guys, if you enjoyed this, please give it a clap and share it with your friends who also want to learn and implement Next.js 13. And if you want more articles like this, follow me on dev.to . If you missed anything or want to &lt;a href="https://github.com/abhirupkumar/Netflix-Clone" rel="noopener noreferrer"&gt;check out the full code here&lt;/a&gt;. Here is the &lt;a href="https://dev.to/abhirup2003/building-netflix-clone-with-nextjs-134-part-1-2peg"&gt;part 1&lt;/a&gt; of the blog.Thanks for reading!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>firebase</category>
      <category>typescript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Building Netflix Clone with NextJs 13.4: Part 1</title>
      <dc:creator>Abhirup Kumar Bhowmick</dc:creator>
      <pubDate>Tue, 19 Dec 2023 04:19:57 +0000</pubDate>
      <link>https://forem.com/abhirup2003/building-netflix-clone-with-nextjs-134-part-1-2peg</link>
      <guid>https://forem.com/abhirup2003/building-netflix-clone-with-nextjs-134-part-1-2peg</guid>
      <description>&lt;h3&gt;
  
  
  NextJs 13, React, Tailwind CSS, Firebase, Razorpay.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fv2%2Fresize%3Afit%3A1000%2Fformat%3Apng%2F1%2A9RQjGX9rUSFbU4NSTH6cyQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fv2%2Fresize%3Afit%3A1000%2Fformat%3Apng%2F1%2A9RQjGX9rUSFbU4NSTH6cyQ.png" alt="Netflix Clone"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OTT platforms are the latest craze right now! With 238.39 million paid subscribers in 2023, Netflix is a fairly well-known OTT platform. This is the part 1 of the blog, where I’ll demonstrate how I created a Netflix clone using NextJs 13.4.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Github Link:&lt;/strong&gt; &lt;a href="https://github.com/abhirupkumar/Netflix-Clone/" rel="noopener noreferrer"&gt;https://github.com/abhirupkumar/Netflix-Clone&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project Link:&lt;/strong&gt; &lt;a href="https://netflix-akb.vercel.app/" rel="noopener noreferrer"&gt;https://netflix-akb.vercel.app&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Knowledge of Html, Css, Js ,React and Nextjs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;Open your terminal and paste the below command to create the project.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-next-app@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Follow these steps for installation:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What is your project named? netflix-clone
Would you like to use TypeScript? Yes
Would you like to use ESLint? No
Would you like to use Tailwind CSS? Yes
Would you like to use `src/` directory? No
Would you like to use App Router? (recommended) Yes
Would you like to customize the default import alias? No
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After successfully creating the project, open the project in VScode and open it’s terminal. To install all the libraries needed for developing this project, start by typing the following command.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx install @emotion/react @emotion/styled @mui/material firebase razorpay react-hook-form react-hot-toast react-
icons react-player recoil
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now go to &lt;strong&gt;&lt;a href="https://www.themoviedb.org/" rel="noopener noreferrer"&gt;https://www.themoviedb.org/&lt;/a&gt; **and Login/Sign Up. We will be using the TMDB API to get all the movies. Then go to &lt;a href="https://www.themoviedb.org/settings/api" rel="noopener noreferrer"&gt;**https://www.themoviedb.org/settings/api&lt;/a&gt;&lt;/strong&gt; and get your API key. Create a .env.local file and paste your API key their.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NEXT_PUBLIC_API_KEY=**********************
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now open a merchant account in Razorpay, get the merchant key and secret from your dashboard, and paste them in the .env.local.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RAZORPAY_KEY=****************
RAZORPAY_SECRET=****************
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Before diving in Typescript code, write the following in global.css file.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@tailwind base;
@tailwind components;
@tailwind utilities;

/* :root {
  --foreground-rgb: 0, 0, 0;
  --background-start-rgb: 214, 219, 220;
  --background-end-rgb: 255, 255, 255;
} */

@media (prefers-color-scheme: dark) {
  /* :root {
    --foreground-rgb: 255, 255, 255;
    --background-start-rgb: 0, 0, 0;
    --background-end-rgb: 0, 0, 0;
  } */
}

body {
  overflow-x: hidden;
  /* color: rgb(var(--foreground-rgb));
  background: linear-gradient(
      to bottom,
      transparent,
      rgb(var(--background-end-rgb))
    )
    rgb(var(--background-start-rgb)); */
}

::-webkit-scrollbar {
  width: 8px;
}

/* Track */
::-webkit-scrollbar-track {
  background: transparent;
}

/* Handle */
::-webkit-scrollbar-thumb {
  background: #222222;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: #363636;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

@layer base {
  body {
    @apply bg-[#141414] text-white;
  }

  header {
    @apply fixed top-0 z-50 flex w-full items-center justify-between px-4 py-4 transition-all lg:px-10 lg:py-6;
  }
}

/* custom classNames */
@layer components {
  .headerLink {
    @apply cursor-pointer text-sm font-semibold text-white transition duration-[.4s] hover:text-[#d6d6d6];
  }

  .bannerButton {
    @apply flex items-center gap-x-2 rounded px-5 py-1.5 text-sm font-semibold transition hover:opacity-75 md:py-2.5 md:px-8 md:text-xl;
  }

  .input {
    @apply w-full rounded bg-[#333] px-5 py-3.5 placeholder-[gray] outline-none focus:bg-[#454545];
  }

  .modalButton {
    @apply flex h-11 w-11 items-center justify-center rounded-full border-2 border-[gray] bg-[#2a2a2a]/60 transition hover:border-white hover:bg-white/10;
  }

  .planBox {
    @apply relative mx-1.5 flex h-20 w-[calc(100%/4)] cursor-default items-center justify-center rounded-sm bg-[#e50914] font-semibold shadow after:absolute after:top-full after:left-1/2 after:block after:-translate-x-1/2 after:border-8 after:border-b-0 after:border-transparent after:border-t-[#e50914] after:content-[""] md:h-32 lg:mx-8;
  }

  /* Table */
  .tableRow {
    @apply flex flex-wrap items-center font-medium;
  }

  .tableDataTitle {
    @apply w-full p-2.5 text-center text-sm font-normal text-white md:w-[40%] md:p-3.5 md:text-left md:text-base;
  }

  .tableDataFeature {
    @apply w-[calc(100%/4)] p-2.5 text-center md:w-[calc(60%/4)] md:p-3.5;
  }

  .membershipLink {
    @apply cursor-pointer text-blue-500 hover:underline;
  }

  /* MUI Menu */
  .menu {
    @apply md:hidden;
  }

  .menu .MuiPaper-root {
    @apply !absolute !left-0 !rounded-none !border !border-[gray] !bg-black !text-white;
  }

  .menu .MuiList-root {
    @apply !p-0;
  }

  .menu .MuiMenuItem-root {
    @apply !block !w-72 !py-3.5 !text-center !text-sm !font-light !text-[#b3b3b3] !transition !duration-200 first:cursor-default first:!font-normal first:!text-white hover:!bg-[#11100F];
  }
}

.lds-ripple {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
  justify-content: center;
  align-items: center;
}
.lds-ripple div {
  position: absolute;
  border: 4px solid #ffffff;
  opacity: 1;
  border-radius: 50%;
  animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}
.lds-ripple div:nth-child(2) {
  animation-delay: -0.5s;
}
@keyframes lds-ripple {
  0% {
    top: 36px;
    left: 36px;
    width: 0;
    height: 0;
    opacity: 0;
  }
  4.9% {
    top: 36px;
    left: 36px;
    width: 0;
    height: 0;
    opacity: 0;
  }
  5% {
    top: 36px;
    left: 36px;
    width: 0;
    height: 0;
    opacity: 1;
  }
  100% {
    top: 0px;
    left: 0px;
    width: 72px;
    height: 72px;
    opacity: 0;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now create an action folder outside of the app directory. The folder will contain an actions.ts file. In action.ts, we will fetch all the movie data from the TMDB APIT.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"use server";

import requests from "@/utils/requests";

export const fetchAllData = async () =&amp;gt; {
  const [
    netflixOriginals,
    trendingNow,
    topRated,
    actionMovies,
    comedyMovies,
    horrorMovies,
    romanceMovies,
    documentaries,
  ] = await Promise.all([
    fetch(requests.fetchNetflixOriginals).then((res) =&amp;gt; res.json()),
    fetch(requests.fetchTrending).then((res) =&amp;gt; res.json()),
    fetch(requests.fetchTopRated).then((res) =&amp;gt; res.json()),
    fetch(requests.fetchActionMovies).then((res) =&amp;gt; res.json()),
    fetch(requests.fetchComedyMovies).then((res) =&amp;gt; res.json()),
    fetch(requests.fetchHorrorMovies).then((res) =&amp;gt; res.json()),
    fetch(requests.fetchRomanceMovies).then((res) =&amp;gt; res.json()),
    fetch(requests.fetchDocumentaries).then((res) =&amp;gt; res.json()),
  ]);

  return {
    netflixOriginals: netflixOriginals.results,
    trendingNow: trendingNow.results,
    topRated: topRated.results,
    actionMovies: actionMovies.results,
    comedyMovies: comedyMovies.results,
    horrorMovies: horrorMovies.results,
    romanceMovies: romanceMovies.results,
    documentaries: documentaries.results,
  };
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Before going any further, Login to Firebase and create a project. Give any project a name, and after creating the project, click on the web app, give the app a nickname, and click on Register the app. The following type of code will appear. Copy the code from their and click on done.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries

// Your web app's Firebase configuration
const firebaseConfig = {
  apiKey: "**************************************",
  authDomain: "*******************.firebaseapp.com",
  projectId: "*******************",
  storageBucket: "*******************.appspot.com",
  messagingSenderId: "*************",
  appId: "*:*************:web:*****************"
};

// Initialize Firebase
const app = initializeApp(firebaseConfig);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Create a firebase.ts file outside of the app folder and paste the copied code. Again, go back to Firebase, click on Authentication, and turn on ‘Email/Password’ Authentication. Click on Firestore Database and create a database in production mode. Now we are all set to proceed with our hooks.&lt;/p&gt;

&lt;p&gt;Create a constants folder outside of the app directory and create an app.tsx file and a movie.ts file in that folder.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// movie.ts

export const baseUrl = 'https://image.tmdb.org/t/p/original/';

//App.tsx

"use client";

import React from 'react'
import { RecoilRoot } from 'recoil'

const App = ({
    children,
  }: {
    children: React.ReactNode
  }) =&amp;gt; {
  return (
    &amp;lt;html lang="en"&amp;gt;
      &amp;lt;body&amp;gt;
        &amp;lt;RecoilRoot&amp;gt;
          {children}
        &amp;lt;/RecoilRoot&amp;gt;
      &amp;lt;/body&amp;gt;
    &amp;lt;/html&amp;gt;
  )
}

export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In the app folder, change the code for layout.tsx to the following:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import './globals.css'
import type { Metadata } from 'next'
import App from '@/constants/App';

export const metadata: Metadata = {
  title: 'NETFLIX',
  description: 'Watch your favorite movies and TV shows on Netflix.',
}

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    &amp;lt;App children={children} /&amp;gt;
  )
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Outside of app firectory create typings.d.ts file.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// typings.d.ts

export interface Genre {
    id: number
    name: string
  }

  export interface Plan {
    id: string
    name: string
    amount: number
    description: string
    videoQuality: string
    resolution: string
  }

  export interface Movie {
    title: string
    backdrop_path: string
    media_type?: string
    release_date?: string
    first_air_date: string
    genre_ids: number[]
    id: number
    name: string
    origin_country: string[]
    original_language: string
    original_name: string
    overview: string
    popularity: number
    poster_path: string
    vote_average: number
    vote_count: number
  }

  export interface Element {
    type:
      | 'Bloopers'
      | 'Featurette'
      | 'Behind the Scenes'
      | 'Clip'
      | 'Trailer'
      | 'Teaser'
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now create an atoms folder outside of the app directory. The atoms folder will contain only one file, modalAtom.ts, which contains the following:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { DocumentData } from 'firebase/firestore'
import { atom } from 'recoil'
import { Movie } from '../typings'

export const modalState = atom({
  key: 'modalState',
  default: false,
})

export const movieState = atom&amp;lt;Movie | DocumentData | null&amp;gt;({
  key: 'movieState',
  default: null,
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Create a utils folder outside of the app folder. In the utils folder, create data.ts and requests.ts files. The first file data.ts will contain our custom plan data. Feel free to change any items in the plan. And requests.ts file will contain all the API endpoints that we will be using in our application.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// data.ts

const plan = [
    {
        id: "netflix-plan-1-mobile",
        name: "Mobile",
        amount: 149,
        description: "Watch on your mobile phone and tablet",
        videoQuality: "Average",
        resolution: "480p"
    },
    {
        id: "netflix-plan-2-basic",
        name: "Basic",
        amount: 199,
        description: "Watch on your TV, computer, mobile phone and tablet",
        videoQuality: "Good",
        resolution: "720p"
    },
    {
        id: "netflix-plan-3-standard",
        name: "Standard",
        amount: 499,
        description: "Watch on your TV, computer, mobile phone and tablet",
        videoQuality: "Great",
        resolution: "720p"
    },
    {
        id: "netflix-plan-4-premium",
        name: "Premium",
        amount: 649,
        description: "Watch on your TV, computer, mobile phone and tablet",
        videoQuality: "Best",
        resolution: "720p"
    },
]

export default plan

// requests.ts

const API_KEY = process.env.NEXT_PUBLIC_API_KEY
const BASE_URL = 'https://api.themoviedb.org/3'

const requests = {
  fetchTrending: `${BASE_URL}/trending/all/week?api_key=${API_KEY}&amp;amp;language=en-IN`,
  fetchNetflixOriginals: `${BASE_URL}/discover/movie?api_key=${API_KEY}&amp;amp;with_networks=213`,
  fetchTopRated: `${BASE_URL}/movie/top_rated?api_key=${API_KEY}&amp;amp;language=en-IN`,
  fetchActionMovies: `${BASE_URL}/discover/movie?api_key=${API_KEY}&amp;amp;language=en-IN&amp;amp;with_genres=28`,
  fetchComedyMovies: `${BASE_URL}/discover/movie?api_key=${API_KEY}&amp;amp;language=en-IN&amp;amp;with_genres=35`,
  fetchHorrorMovies: `${BASE_URL}/discover/movie?api_key=${API_KEY}&amp;amp;language=en-IN&amp;amp;with_genres=27`,
  fetchRomanceMovies: `${BASE_URL}/discover/movie?api_key=${API_KEY}&amp;amp;language=en-IN&amp;amp;with_genres=10749`,
  fetchDocumentaries: `${BASE_URL}/discover/movie?api_key=${API_KEY}&amp;amp;language=en-IN&amp;amp;with_genres=99`,
}

export default requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Hence, we have set up all the utility files for our projects. In the next part, we will continue with the frontend and backend of our website.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Guys, if you enjoyed this, please give it a clap and share it with your friends who also want to learn and implement Next.js 13. If you missed anything or want to &lt;a href="https://github.com/abhirupkumar/Netflix-Clone" rel="noopener noreferrer"&gt;check out the full code here&lt;/a&gt;. And if you want more articles like this, follow me on dev.to. &lt;a href="https://dev.to/abhirup2003/building-netflix-clone-with-nextjs-134-part-2-1khg"&gt;Link for Part 2&lt;/a&gt;. &lt;br&gt;
Guys, I have some good news for those who are preparing for interviews. Checkout PrepiQ (&lt;a href="https://prepiq.vercel.app/" rel="noopener noreferrer"&gt;https://prepiq.vercel.app/&lt;/a&gt;), your comprehensive interview prep guide.&lt;br&gt;
Thanks for reading!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>netflix</category>
      <category>react</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Important Subjects For Placement Preparation</title>
      <dc:creator>Abhirup Kumar Bhowmick</dc:creator>
      <pubDate>Tue, 19 Dec 2023 04:16:42 +0000</pubDate>
      <link>https://forem.com/abhirup2003/important-subjects-for-placement-preparation-4km1</link>
      <guid>https://forem.com/abhirup2003/important-subjects-for-placement-preparation-4km1</guid>
      <description>&lt;h3&gt;
  
  
  Important Subjects For Placement
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P46utKTc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/v2/resize:fit:1200/format:png/1%2ADlE2vRVcVv--BSmEOIrgtA.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P46utKTc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/v2/resize:fit:1200/format:png/1%2ADlE2vRVcVv--BSmEOIrgtA.jpeg" alt="Desk Setup" width="800" height="698"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you also aspire to be a good Software Engineer, you should learn all these subjects. In this blog, I will discuss all of the subjects necessary to land off-campus interviews. I hope you like it.&lt;/p&gt;

&lt;p&gt;DSA or Development alone will not earn you a position in Product Based Company.Yes, Yes, DSA is necessary, but it will not get you a job as you must also understand OOPs concepts, DBMS, Computer Networks, Operating Systems, and, most importantly, System Design.&lt;/p&gt;

&lt;h2&gt;
  
  
  Important Subjects
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Data Structures And Algorithms (DSA)
&lt;/h3&gt;

&lt;p&gt;DSA is a must to crack any SDE role. It helps you solve real-world problems. For example, sets are of great use to store distinct elements in sorted order. For sorting any data, there are several algorithms available. Depending on the type of data, a sorting algorithm is chosen. There are several factors that make an algorithm efficient, such as Time complexity and Space complexity. So, it is very important to learn and understand when and how to implement an algorithm based on the given problem statements.&lt;/p&gt;

&lt;h3&gt;
  
  
  Object Oriented Programming (OOP)
&lt;/h3&gt;

&lt;p&gt;OOPs play an important role in deciding how a code should be structured and in any interview. C++ and Java are popular languages that support object-oriented programming. Concepts like Class, Object, Inheritance, Encapsulation, Polymorphism, Data Abstraction, etc. are very important.&lt;/p&gt;

&lt;h3&gt;
  
  
  Operating System
&lt;/h3&gt;

&lt;p&gt;An operating system can be accurately defined as a program that manages the hardware and software applications on a computer. When you switch on the target device, the operating system is activated. It comprises all of the processes that help us gain access to the technology and control it. And hence, it is very important to learn.&lt;/p&gt;

&lt;h3&gt;
  
  
  Database Management System
&lt;/h3&gt;

&lt;p&gt;Databases are used in almost every application to store data. There are several databases available now, and different databases have different benefits. A few such databases are MongoDB, SQL databases, Firebase Firestore, Firebase Realtime Database, etc. In interviews, SQL queries and good knowledge of databases are very important.&lt;/p&gt;

&lt;h3&gt;
  
  
  Computer Networks
&lt;/h3&gt;

&lt;p&gt;Well, not all companies ask networking-based questions. Companies like Cisco, Juniper Networks, etc. mostly ask questions about Computer Networks. To get jobs like network engineer, network consultant, and cloud engineer, computer networks is essential to learn and understand.&lt;/p&gt;

&lt;h3&gt;
  
  
  System Design
&lt;/h3&gt;

&lt;p&gt;It is a very important subject asked by most product based companies. System design is the process of defining the components, architecture, and data for a system to meet specific requirements, such as scalability, performance, and availability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;If you want to succeed in interviews for product-based companies, you must know these subjects. Nowadays, many people like working for product-based companies since they provide exciting perks and salary packages. However, this does not imply that working for startups, service-based companies, or other organisations is not cool. Every job has benefits and drawbacks. These subjects are needed if you want to land a job at a product-based company.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Guys, if you enjoyed this, please give it a clap and share it with your friends who also aspire to become software engineers just like you. And if you want more articles like this, follow me on Medium.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>offcampus</category>
      <category>placement</category>
      <category>oops</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Projects I’ve made that you can try.</title>
      <dc:creator>Abhirup Kumar Bhowmick</dc:creator>
      <pubDate>Tue, 19 Dec 2023 04:13:11 +0000</pubDate>
      <link>https://forem.com/abhirup2003/projects-ive-made-that-you-can-try-1lkc</link>
      <guid>https://forem.com/abhirup2003/projects-ive-made-that-you-can-try-1lkc</guid>
      <description>&lt;h3&gt;
  
  
  Web &amp;amp; Android App Development Projects
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--unYHigGD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/v2/resize:fit:1400/format:webp/1%2AJkdLKzBA3L_U4J5W_Mq_kQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--unYHigGD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/v2/resize:fit:1400/format:webp/1%2AJkdLKzBA3L_U4J5W_Mq_kQ.jpeg" alt="Code" width="800" height="693"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are a computer science engineering student or a web and Android development enthusiast, this post is for you. In this blog, I will share most of the projects that I have completed to date. I hope you enjoy it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Web Projects
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Soldier Game
&lt;/h3&gt;

&lt;p&gt;This is a simple game in which there is a soldier in the field and you must move left, right, up or down to save him from the bombs and gather as many first aid kits as possible. As time passes, the bombs become more frequent, and the difficulty level rises. This game was my very first project after learning Kaboom Js. You can built similar project like this just to kickstart your journey in web development.&lt;br&gt;
&lt;a href="https://soldier-game.abhirup-kumarku.repl.co/" rel="noopener noreferrer"&gt;&lt;strong&gt;Soldier Game&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Pixelwear
&lt;/h3&gt;

&lt;p&gt;This is an ecommerce store that primarily sells four categories of products: T-shirts, Hoodies, Jeans, and Trousers. This site was built with Next Js, Tailwind CSS, and a MongoDb database. It had several current ecommerce functions such as add to cart and checkout. Users may actually pay for what they purchase. Razorpay is used as payment integration. This website’s dashboard was designed with Material UI.&lt;br&gt;
&lt;a href="https://pixelwear.vercel.app/" rel="noopener noreferrer"&gt;&lt;strong&gt;Pixelwear - Wear The Trend&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Portfolio Website
&lt;/h3&gt;

&lt;p&gt;A portfolio website is essential for every web developer since it displays his skills, prior projects, and experience in this field. My portfolio website was built with React Js and Sanity as a Content Management System. Sanity has several advantages, including the ability to store dynamic data.&lt;br&gt;
&lt;a href="https://abhirupkumar.netlify.app/" rel="noopener noreferrer"&gt;&lt;strong&gt;Abhirup&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Linkedin Clone
&lt;/h3&gt;

&lt;p&gt;This is just a basic implementation of Linkedin. It was created using Next.js, Tailwind CSS, Material icons, MongoDB as a database, and Firebase for Google Authentication. Users must first log in so that they can publish articles and images. Users may also provide thumbs up to other people’s posts.&lt;br&gt;
&lt;a href="https://linkedin-clone-mauve.vercel.app/" rel="noopener noreferrer"&gt;&lt;strong&gt;LinkedIn - Log In or Sign Up&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Crypto Tracker
&lt;/h3&gt;

&lt;p&gt;This website is built using React, Material UI, ChartJS, and Coingeko Api. You can get all the information you need regarding your favourite crypto currencies. This website gives a live update on the top 100 cryptocurrencies.&lt;br&gt;
&lt;a href="https://crypto-tracker-akb.netlify.app/" rel="noopener noreferrer"&gt;&lt;strong&gt;Crypto Tracker&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Projects Built using React Native
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Deliveroo Clone
&lt;/h3&gt;

&lt;p&gt;This was my very first app, developed using Expo, React Native, Tailwind CSS, React Redux and Sanity as a Content Management System. This app includes a list of restaurants and their food offerings. Users may add items of their choice and order food in no time. To use this app, you must have the Expo app installed (only for Android devices) and scan the QR code. Here is the &lt;a href="https://expo.dev/@abhirup/deliveroo-clone-apk" rel="noopener noreferrer"&gt;link&lt;/a&gt; to the app.&lt;/p&gt;

&lt;h3&gt;
  
  
  Signal Clone
&lt;/h3&gt;

&lt;p&gt;This is a Group Chatting Application in which users can share messages with one another and even form groups for added amusement. This app was made using Expo, React-Native, React, TailwindCSS, and Firebase Firestore as a database. To use this app, you must have the Expo app installed (only for Android devices) and scan the QR code. Here is the &lt;a href="https://expo.dev/@abhirup/SignalClone" rel="noopener noreferrer"&gt;link&lt;/a&gt; to the app.&lt;/p&gt;

&lt;h3&gt;
  
  
  Instagram Clone
&lt;/h3&gt;

&lt;p&gt;This is one of the best projects I’ve worked on so far. This app was created using Expo, React Native, and Firebase v9. The user interface is similar to Instagram’s dark mode. Users must first Login or Signup. They may then view their feed and write posts. They may also Like and Comment on other people’s posts. A profile feature is also provided, where individuals may update their name and profile photo. To use this app, you must have the Expo app installed (only for Android devices) and scan the QR code. Here is the &lt;a href="https://expo.dev/@abhirup/Instagram-Clone-Published-At-Expo" rel="noopener noreferrer"&gt;link&lt;/a&gt; to the app.&lt;/p&gt;

&lt;h3&gt;
  
  
  Instant
&lt;/h3&gt;

&lt;p&gt;This is the best project I have built so far. This is a WhatsApp-like chatting app that allows users to chat with each other in real time. Users can create groups and add or remove other users. In addition to creating groups, starring messages, copying text, and replying to messages, this app also allows you to send images. This app was made using Expo, React Native, React Redux, Firebase, and the Realtime Database. This is my favourite project, and you guys must see this one. To use this app, you must have the Expo app installed (only for Android devices) and scan the QR code. Here is the &lt;a href="https://expo.dev/@abhirup/Instant" rel="noopener noreferrer"&gt;link&lt;/a&gt; to the app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;These are most of the projects that I have built so far. While learning Web and Android Development, I continued to apply these skills and build new projects to strengthen my resume. If you are just beginning your development journey, let me assure you that it will be fascinating.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Guys, if you enjoyed this, please give it a clap and share it with your friends who are about to begin learning web or android development. And if you want more articles like this, follow me on Medium.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>crossplatformappdev</category>
      <category>projectideas</category>
      <category>ui</category>
    </item>
    <item>
      <title>My Experience with Solving DSA Problems on Leetcode.</title>
      <dc:creator>Abhirup Kumar Bhowmick</dc:creator>
      <pubDate>Tue, 19 Dec 2023 04:04:01 +0000</pubDate>
      <link>https://forem.com/abhirup2003/my-experience-with-solving-dsa-problems-on-leetcode-283n</link>
      <guid>https://forem.com/abhirup2003/my-experience-with-solving-dsa-problems-on-leetcode-283n</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Mastering the Art of Problem Solving on Leetcode&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Hello everybody, my name is Abhirup Kumar Bhowmick. This is my first blog. I recently finished my second year of college and am currently in my pre-final year, so I thought I’d share some of my past experiences. I’ll be sharing how I started solving questions on Leetcode.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;How it all started?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Let’s start with my first semester in college. I was already familiar with Java programming, having studied it from Class 9 to Class 12. Variables, loops, if statements, single and multi-dimensional arrays, stacks, and queues were all familiar to me. But I was curious as what questions were asked in job interviews. So I went to YouTube and searched for “Roadmap for a Second Year Student for Placemnet.” I learned that DSA (Data Structures And Algorithms) is a critical subject that is questioned in the technical interviews and that C++ and Java are the most frequent languages used by product-based companies. After knowing that C++ is faster than Java increased my curiosity in learning it. But now I know that good problem-solving skills are a necessity regardless of whether you choose C++ or Java.&lt;/p&gt;

&lt;p&gt;I therefore began learning C++ on YouTube. And because my foundation was strong, I found it simple to master the fundamentals of C++. But after studying C++, I didn’t begin to practise DSA questions until almost the end of my second year. Up until almost the end of my second year, I continued to learn web and Android development. I’ve made several fantastic projects with it, which I’ll share later. I began really pursuing DSA around the middle of March 2023. I started to solve the DSA sheet seriously that had 450+ problems from Leetcode. I set a goal for myself to solve 5 problems every day. I tried to be consistent at all times. I would solve five questions some days, but other days I would only solve two or three. But each day I would have solved at least one Leetcode question.&lt;/p&gt;

&lt;p&gt;First, I went over all of the fundamental concepts, including as arrays, loops, basic recursion, sorting and searching. Sorting problems seemed too easy to me at first, but as I proceeded to increasingly harder topics, I understood this was only the beginning. So, Leetcode contains three categories of problems: easy, medium, and hard. Most simple problems can be solved swiftly, while medium and hard problems are difficult to solve.&lt;/p&gt;

&lt;p&gt;I used to understand a concept first, then solve problems based on it. For instance, I would first understand the fundamentals of stacks and queues before attempting to tackle problems using them. I wasn’t always able tosolve every problem at once. Most of the time, I would just try to understand the situation and correctly apply the data structure. But it wasn’t always successful. I would spent maximum 15 to 20 minutes on a problem then I would see the solution provided on Leetcode. I could code independently if I were able to understand the approach. If not, I will watch a video solution to the problem to help me understand it better before continuing to code on my own. Once every one to two weeks, I used to review the concepts that were challenging or that I couldn’t seem to understand at once. I felt demotivated when I couldn’t figure out a problem on my own, but I refused to give up.&lt;/p&gt;

&lt;p&gt;I have covered a wide range of DSA topics in this manner, including arrays, strings, sorting, searching, recursion, backtracking, stacks and queues, linked lists, trees, graphs and dynamic programming. I haven’t touched Tries yet. I’m currently revising the concepts I covered earlier. After finishing my revision in the upcoming three to four weeks, I intend to start learning graph data structure.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I have already solved 450+ questions on Leetcode. If you look at my &lt;a href="https://leetcode.com/Abhirup2003/" rel="noopener noreferrer"&gt;Leetcode profile&lt;/a&gt;, you can see that I maintained consistency in the months of April and May. I had my semester examinations in June from 1 through 15. But I began studying for the semesters after resolving at least 1 problem every single day. I don’t always feel like solving problems everyday, and there are times when being stuck on the same problem for more than an hour without finding a solution feel really aggravating. Any Software Engineer who wishes to work in an MNC must learn DSA. I hope to ace DSA and also start my Competitive coding journey on Leetcode. After all, as a tier 3 college student, you must fulfil your desire on your own; there are many resources available, but the work must be done solely by you.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;So, this is my experience of solving questions from Leetcode. This is my very first blog. I hope you found this information interesting. Please share it and leave a comment below to let me know what you enjoyed and how I can improve my future blogs.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>dsa</category>
      <category>engineering</category>
      <category>problem</category>
    </item>
  </channel>
</rss>
