<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abhirup Kumar Bhowmick on Medium]]></title>
        <description><![CDATA[Stories by Abhirup Kumar Bhowmick on Medium]]></description>
        <link>https://medium.com/@abhirupkumar2003?source=rss-d84f55f6ca33------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*pQwnRJwVC5LxPzB4mBekxg.jpeg</url>
            <title>Stories by Abhirup Kumar Bhowmick on Medium</title>
            <link>https://medium.com/@abhirupkumar2003?source=rss-d84f55f6ca33------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 08:55:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abhirupkumar2003/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I Encountered the Problem and Built the Solution: PrepiQ]]></title>
            <link>https://medium.com/@abhirupkumar2003/how-i-encountered-the-problem-and-built-the-solution-prepiq-3837565ede22?source=rss-d84f55f6ca33------2</link>
            <guid isPermaLink="false">https://medium.com/p/3837565ede22</guid>
            <category><![CDATA[interview-preparation]]></category>
            <category><![CDATA[interview-tips]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[interview-questions]]></category>
            <category><![CDATA[jobs]]></category>
            <dc:creator><![CDATA[Abhirup Kumar Bhowmick]]></dc:creator>
            <pubDate>Mon, 29 Jul 2024 12:09:11 GMT</pubDate>
            <atom:updated>2024-07-29T12:09:11.864Z</atom:updated>
            <content:encoded><![CDATA[<h4>The Problem: A Personal Struggle with Confidence</h4><figure><img alt="ace your next interview with prepiq" src="https://cdn-images-1.medium.com/max/1024/1*L8xytmCA7rJrAFWuY9dItQ.png" /><figcaption>Crack Your Interview with PrepiQ</figcaption></figure><p>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.</p><h4>The Eureka Moment: An Idea to Solve the Problem</h4><p>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.</p><h4>Building the Solution: The Birth of <a href="https://prepiq.vercel.app/">PrepiQ</a></h4><p>I started my journey of developing, testing, and polishing with this aim in mind. <a href="https://prepiq.vercel.app/">PrepiQ</a> was created after 2 weeks of unrelenting work and restless nights. <a href="https://prepiq.vercel.app/">PrepiQ</a> is a SaaS mock interview driven by AI that aims to revolutionize interview preparation.</p><h4>Why use <a href="https://prepiq.vercel.app/">PrepiQ</a></h4><p><strong>1. Personalized Interview Questions: </strong><a href="https://prepiq.vercel.app/">PrepiQ</a> 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.</p><figure><img alt="Personalized Interview" src="https://cdn-images-1.medium.com/max/1024/0*c3dTt6aMyrVSkPU9.png" /><figcaption>Personalized Interview</figcaption></figure><p><strong>2. AI Mock Interview:</strong> You may practice for actual interviews using <a href="https://prepiq.vercel.app/">PrepiQ</a>. 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.</p><figure><img alt="AI Mock Interview" src="https://cdn-images-1.medium.com/max/1024/0*8Dn-wx-qZIq9RTcy.png" /><figcaption>AI Mock Interview</figcaption></figure><p><strong>3. Comprehensive Feedback:</strong> One of the standout features of <a href="https://prepiq.vercel.app/">PrepiQ</a> 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.</p><figure><img alt="Comprehensive Feedback" src="https://cdn-images-1.medium.com/max/1024/0*PP8gOR6vnGo2Iyss.png" /><figcaption>Comprehensive Feedback</figcaption></figure><p><strong>4. Credit Based Plans:</strong> 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 <strong><em>Lite </em></strong>plan offers 10 credits, the <strong><em>Plus </em></strong>plan offers 25 credits, and the <strong><em>Pro </em></strong>plan covers 50 credits.</p><figure><img alt="Credit Based Plans" src="https://cdn-images-1.medium.com/max/1024/1*CN5tqZjHdbWOk_OIkh8DEg.png" /><figcaption>Credit Based Plans</figcaption></figure><p>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.</p><p>So, what are you waiting for? Check out <a href="https://prepiq.vercel.app/">PrepiQ</a> now.</p><p><em>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 Medium. Thanks for reading!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3837565ede22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Typescript vs Javascript]]></title>
            <link>https://medium.com/@abhirupkumar2003/typescript-vs-javascript-c3061965dd3d?source=rss-d84f55f6ca33------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3061965dd3d</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[full-stack-web-developer]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Abhirup Kumar Bhowmick]]></dc:creator>
            <pubDate>Mon, 18 Dec 2023 14:21:04 GMT</pubDate>
            <atom:updated>2023-12-18T14:21:04.696Z</atom:updated>
            <content:encoded><![CDATA[<h4>Why choose typescript over javascript?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f76RSGKQzHLUoQ7oakJRtA.png" /><figcaption>Typescript vs Javascript</figcaption></figure><p>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).</p><h3><strong>Javascript</strong></h3><p>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.</p><p>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.</p><p>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.</p><h3>Typescript</h3><p>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.</p><p>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.</p><h3>Advantages of using TypeScript over JavaScript</h3><h4>Static Typing</h4><p>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.</p><pre>// JavaScript (No Static Typing)<br>let str = &quot;Hello, World!&quot;;<br>console.log(str);<br><br>// Attempting to assign a different type later is allowed<br>str = 42;<br>console.log(str); // This would execute without error in JS</pre><pre>// TypeScript (Static Typing)<br>let str: string = &quot;Hello, World!&quot;;<br>console.log(str);<br><br>// Attempting to assign a different type results in a compile-time error<br>// Uncommenting the line below would result in a TypeScript compilation error<br>// str = 42;<br>// console.log(str);</pre><h4>Interchangeable</h4><p>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.</p><h4>Typecasting</h4><p>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 &lt;&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.</p><pre>// TypeScript example demonstrating Type Casting<br><br>// Example 1: Using &quot;as&quot; keyword<br>let stringValue: any = &quot;42&quot;;<br>let numberValue1: number = stringValue as number;<br>console.log(`Using &quot;as&quot; keyword: ${numberValue1}`);<br><br>// Example 2: Using &lt; &gt; operator<br>let anotherStringValue: any = &quot;77&quot;;<br>let numberValue2: number = &lt;number&gt;anotherStringValue;<br>console.log(`Using &lt; &gt; operator: ${numberValue2}`);</pre><h4>Interface Support</h4><p>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.</p><p>The example shows how to use TypeScript’s capabilities to implement standard Object Oriented Progarmming patterns —</p><pre>// Define an interface for a BankAccount<br>interface BankAccount {<br>  accountNumber: string;<br>  balance: number;<br>  deposit(amount: number): void;<br>  withdraw(amount: number): void;<br>}<br><br>// Implement a class for SavingsAccount that implements BankAccount<br>class SavingsAccount implements BankAccount {<br>  constructor(public accountNumber: string, public balance: number) {}<br><br>  deposit(amount: number): void {<br>    this.balance += amount;<br>    console.log(`Deposited ${amount}. New balance: ${this.balance}`);<br>  }<br><br>  withdraw(amount: number): void {<br>    if (amount &lt;= this.balance) {<br>      this.balance -= amount;<br>      console.log(`Withdrawn ${amount}. New balance: ${this.balance}`);<br>    } else {<br>      console.log(&quot;Insufficient funds!&quot;);<br>    }<br>  }<br>}<br><br>// Implement a class for CurrentAccount that implements BankAccount<br>class CurrentAccount implements BankAccount {<br>  constructor(public accountNumber: string, public balance: number) {}<br><br>  deposit(amount: number): void {<br>    this.balance += amount;<br>    console.log(`Deposited ${amount}. New balance: ${this.balance}`);<br>  }<br><br>  withdraw(amount: number): void {<br>    // Current accounts allow overdraft up to a certain limit<br>    const overdraftLimit = 1000;<br>    if (amount &lt;= this.balance + overdraftLimit) {<br>      this.balance -= amount;<br>      console.log(`Withdrawn ${amount}. New balance: ${this.balance}`);<br>    } else {<br>      console.log(&quot;Exceeds overdraft limit!&quot;);<br>    }<br>  }<br>}<br><br>// Example usage<br>const savingsAccount = new SavingsAccount(&quot;SA123&quot;, 1000);<br>savingsAccount.deposit(500);<br>savingsAccount.withdraw(200);<br><br>const currentAccount = new CurrentAccount(&quot;CA456&quot;, 2000);<br>currentAccount.deposit(1000);<br>currentAccount.withdraw(2500);</pre><h3>Conclusion</h3><p>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.</p><p><em>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.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3061965dd3d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Netflix Clone with NextJs 13.4: Part 2]]></title>
            <link>https://medium.com/@abhirupkumar2003/building-netflix-clone-with-nextjs-13-4-part-2-bb3263063d1e?source=rss-d84f55f6ca33------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb3263063d1e</guid>
            <category><![CDATA[netflixclone]]></category>
            <category><![CDATA[subscription]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[nextjs-13]]></category>
            <category><![CDATA[firebase]]></category>
            <dc:creator><![CDATA[Abhirup Kumar Bhowmick]]></dc:creator>
            <pubDate>Sun, 30 Jul 2023 15:21:41 GMT</pubDate>
            <atom:updated>2023-07-30T15:21:41.728Z</atom:updated>
            <content:encoded><![CDATA[<h4>NextJs 13, React, Tailwind CSS, Firebase, Razorpay.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BSloxzIr-wN2LW2YDrjiMg.png" /><figcaption>Netflix Clone</figcaption></figure><p><strong>Github Link:</strong> <a href="https://github.com/abhirupkumar/Netflix-Clone/">https://github.com/abhirupkumar/Netflix-Clone</a></p><p><strong>Project Link:</strong> <a href="https://netflix-akb.vercel.app/">https://netflix-akb.vercel.app</a></p><p>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.</p><pre>import {<br>    createUserWithEmailAndPassword,<br>    onAuthStateChanged,<br>    signInWithEmailAndPassword,<br>    signOut,<br>    User,<br>  } from &#39;firebase/auth&#39;<br>  <br>  import { useRouter } from &#39;next/navigation&#39;<br>  import { createContext, useContext, useEffect, useMemo, useState } from &#39;react&#39;<br>  import { auth, db } from &#39;../firebase&#39;;<br>import { doc, getDoc } from &#39;firebase/firestore&#39;;<br><br>interface Props{<br>  id: string;<br>  name: string;<br>  amount: number;<br>  expiry: Date;<br>}<br>  <br>  interface IAuth {<br>    user: User | null<br>    signUp: (email: string, password: string) =&gt; Promise&lt;void&gt;<br>    signIn: (email: string, password: string) =&gt; Promise&lt;void&gt;<br>    logout: () =&gt; Promise&lt;void&gt;<br>    planDetails: Props | null<br>    error: string | null<br>    loading: boolean<br>  }<br>  <br>  const AuthContext = createContext&lt;IAuth&gt;({<br>    user: null,<br>    signUp: async () =&gt; {},<br>    signIn: async () =&gt; {},<br>    logout: async () =&gt; {},<br>    planDetails: null,<br>    error: null,<br>    loading: false,<br>  })<br>  <br>  interface AuthProviderProps {<br>    children: React.ReactNode<br>  }<br>  <br>  export const AuthProvider = ({ children }: AuthProviderProps) =&gt; {<br>    const [loading, setLoading] = useState(false)<br>    const [user, setUser] = useState&lt;User | null&gt;(null)<br>    const [error, setError] = useState(null)<br>    const [planDetails, setPlanDetails] = useState&lt;Props | null&gt;(null)<br>    const [initialLoading, setInitialLoading] = useState(true)<br>    const router = useRouter()<br>  <br>    // Persisting the user<br>    useEffect(<br>      () =&gt;<br>        onAuthStateChanged(auth, (user) =&gt; {<br>          if (user) {<br>            // Logged in...<br>            setUser(user)<br>            fetchSubs(user);<br>            setLoading(false)<br>          } else {<br>            // Not logged in...<br>            setUser(null)<br>            setLoading(false)<br>            router.push(&#39;/login&#39;)<br>          }<br>  <br>          setInitialLoading(false)<br>        }),<br>      [auth])<br>    <br>      useEffect(() =&gt; {<br>        if(error!=null){<br>          setLoading(false)<br>          setError(null);<br>        }<br>      }, [error])<br><br>    const fetchSubs = async (userD: User) : Promise&lt;void&gt; =&gt; {<br>      const isSub = await isSubscribed(userD);<br>    }<br>  <br>    const signUp = async (email: string, password: string) =&gt; {<br>      setLoading(true)<br>  <br>      await createUserWithEmailAndPassword(auth, email, password)<br>        .then((userCredential) =&gt; {<br>          setUser(userCredential.user)<br>          router.push(&#39;/&#39;)<br>          setLoading(false)<br>        })<br>        .catch((err) =&gt; {<br>          alert(err.message)<br>          setError(err.message)<br>        })<br>        .finally(() =&gt; {<br>          setLoading(false)})<br>    }<br>  <br>    const signIn = async (email: string, password: string) =&gt; {<br>      setLoading(true)<br>  <br>      await signInWithEmailAndPassword(auth, email, password)<br>        .then((userCredential) =&gt; {<br>          setUser(userCredential.user)<br>          router.push(&#39;/&#39;)<br>          setLoading(false)<br>        })<br>        .catch((err) =&gt; {<br>          alert(err.message)<br>          setError(err.message)<br>        })<br>        .finally(() =&gt; {<br>          setLoading(false)})<br>    }<br><br>    const isSubscribed = async (user: User | null) : Promise&lt;boolean | null&gt; =&gt; {<br>      if(user == null) return null;<br>      const userRef =  doc(db, &quot;subscriptions&quot;, user.uid);<br>      const docSnap = await getDoc(userRef);<br>      if(!docSnap.exists()) return false;<br>      else{<br>        const data = docSnap.data();<br>        const newdate = new Date().toISOString()<br>        const expiryDate = data.subscriptionExpiryDate<br>        if(newdate &gt; expiryDate){<br>          return false;<br>        }<br>        else{<br>          setPlanDetails({id: data.subscriptionPlanId, name: data.subscriptionPlan, amount: data.subscriptionAmount, expiry: expiryDate})<br>          return true;<br>        }<br>      }<br>    }<br>  <br>    const logout = async () =&gt; {<br>      setLoading(true)<br>  <br>      signOut(auth)<br>        .then(() =&gt; {<br>          setUser(null)<br>        })<br>        .catch((err) =&gt; {<br>          alert(err.message)<br>          setError(err.message)<br>        })<br>        .finally(() =&gt; {<br>          setLoading(false)})<br>    }<br>  <br>    const memoedValue = useMemo(<br>      () =&gt; ({<br>        user,<br>        signUp,<br>        signIn,<br>        logout,<br>        planDetails,<br>        loading,<br>        error,<br>      }),<br>      [user, loading]<br>    )<br>  <br>    return (<br>      &lt;AuthContext.Provider value={memoedValue}&gt;<br>        {!initialLoading &amp;&amp; children}<br>      &lt;/AuthContext.Provider&gt;<br>    )<br>  }<br>  <br>  export default function useAuth() {<br>    return useContext(AuthContext)<br>  }</pre><p>In useList.tsx, we add all the favourite movies to the user’s list.</p><pre>import { collection, DocumentData, onSnapshot } from &#39;firebase/firestore&#39;<br>import { useEffect, useState } from &#39;react&#39;<br>import { db } from &#39;../firebase&#39;<br>import { Movie } from &#39;../typings&#39;<br><br>function useList(uid: string | undefined) {<br>  const [list, setList] = useState&lt;Movie[] | DocumentData[]&gt;([])<br><br>  useEffect(() =&gt; {<br>    if (!uid) return<br><br>    return onSnapshot(<br>      collection(db, &#39;customers&#39;, uid, &#39;myList&#39;),<br>      (snapshot) =&gt; {<br>        setList(<br>          snapshot.docs.map((doc) =&gt; ({<br>            id: doc.id,<br>            ...doc.data(),<br>          }))<br>        )<br>      }<br>    )<br>  }, [db, uid])<br><br>  return list<br>}<br><br>export default useList</pre><p>Now change the App.tsx page as we need to AuthContext for authentication.</p><pre>&quot;use client&quot;;<br><br>import { AuthProvider } from &#39;@/hooks/useAuth&#39;;<br>import React from &#39;react&#39;<br>import { RecoilRoot } from &#39;recoil&#39;<br><br>const App = ({<br>    children,<br>  }: {<br>    children: React.ReactNode<br>  }) =&gt; {<br>  return (<br>    &lt;html lang=&quot;en&quot;&gt;<br>      &lt;body&gt;<br>        &lt;RecoilRoot&gt;<br>        &lt;AuthProvider&gt;<br>          {children}<br>          &lt;/AuthProvider&gt;<br>        &lt;/RecoilRoot&gt;<br>      &lt;/body&gt;<br>    &lt;/html&gt;<br>  )<br>}<br><br>export default App</pre><p>Lets create all the Apis required in this project. So, create a api folder in app folder. Within the api folder create <em>create-razorpay-order</em> folder and within it create route.ts file.</p><pre>import { NextRequest, NextResponse } from &#39;next/server&#39;;<br>import razorpay from &#39;razorpay&#39;;<br><br>export async function POST(req: NextRequest) {<br>    try {<br>        const { amount } = await req.json();<br>        const razorpayInstance = new razorpay({<br>          key_id: &lt;string&gt;process.env.RAZORPAY_KEY,<br>          key_secret: &lt;string&gt;process.env.RAZORPAY_SECRET,<br>        });<br><br>        const payment_capture = 1;<br>        const options = {<br>          amount: (amount * 100).toString(), // Amount in paise or smallest currency unit<br>          currency: &#39;INR&#39;,<br>          receipt: &#39;order_receipt&#39;,<br>          payment_capture,<br>        };<br><br>        const order = await razorpayInstance.orders.create(options);<br>        return NextResponse.json({ id: order.id });<br>    } catch (error) {<br>        return NextResponse.json({ error: &#39;Failed to create Razorpay order&#39; });<br>    }<br>};</pre><p>Agin within the api folder create <em>create-razorpay-subscription</em> folder and within it create route.ts file.</p><pre>import { NextRequest, NextResponse } from &#39;next/server&#39;;<br>import razorpay from &#39;razorpay&#39;;<br><br>export async function POST(req: NextRequest) {<br>    try {<br>      const { orderId, planType, planId, email, userId, amount } = await req.json();<br>        const razorpayInstance = new razorpay({<br>          key_id: &lt;string&gt;process.env.RAZORPAY_KEY,<br>          key_secret: &lt;string&gt;process.env.RAZORPAY_SECRET,<br>        });<br>        <br>        razorpayInstance.subscriptions.create({<br>          plan_id: planId,<br>          total_count: 1,<br>          quantity: 1,<br>          customer_notify: 1,<br>          addons: [<br>            {<br>              item: {<br>                name: userId,<br>                amount: amount*100,<br>                currency: &quot;INR&quot;<br>              }<br>            }<br>          ],<br>          notes: {<br>            planType,<br>            orderId,<br>          },<br>          notify_info: {<br>            notify_email: email,<br>          }<br>        })<br><br>        return NextResponse.json({ success: true });<br>    } catch (error) {<br>        return NextResponse.json({ success: false, error: &#39;Payment verification failed&#39; });<br>    }<br>};</pre><p>Create a folder components in root directory. Create Banner.tsx file in components folder.</p><pre>&quot;use client&quot;;<br><br>import { modalState, movieState } from &#39;@/atoms/modalAtom&#39;;<br>import { baseUrl } from &#39;@/constants/movie&#39;;<br>import { Movie } from &#39;@/typings&#39;<br>import Image from &#39;next/image&#39;<br>import React, { useEffect, useState } from &#39;react&#39;<br>import { FaPlay } from &#39;react-icons/fa&#39;<br>import { HiOutlineInformationCircle } from &#39;react-icons/hi&#39;<br>import { useRecoilState } from &#39;recoil&#39;;<br><br>interface Props {<br>  netflixOriginals: Movie[]<br>}<br><br>const Banner = ({ netflixOriginals } : Props) =&gt; {<br>  const [movie, setMovie] = useState&lt;Movie | null&gt;(null)<br>  const [showModal, setShowModal] = useRecoilState(modalState)<br>  const [currentMovie, setCurrentMovie] = useRecoilState(movieState)<br><br>  const truncate = (str: string) =&gt; {<br>    return str.length &gt; 250 ? str.substring(0, 250) + &quot;...&quot; : str;<br>  }<br><br>  useEffect(() =&gt; {<br>    setMovie(<br>      netflixOriginals[Math.floor(Math.random() * netflixOriginals.length)]<br>    );<br>  }, [netflixOriginals])<br><br>  return (<br>    &lt;div className=&quot;flex flex-col space-y-2 pt-16 md:space-y-4 lg:h-[65vh] lg:justify-end&quot;&gt;<br>      &lt;div className=&quot;absolute top-0 left-0 -z-10 h-[95vh] w-screen&quot;&gt;<br>        {(movie?.backdrop_path || movie?.poster_path) &amp;&amp; &lt;Image<br>          src={`${baseUrl}${movie?.backdrop_path || movie?.poster_path}`}<br>          fill={true}<br>          object-fit=&quot;cover&quot;<br>          alt=&quot;banner-image&quot;<br>          priority={true}<br>        /&gt;}<br>      &lt;/div&gt;<br><br>      &lt;h1 className=&quot;text-2xl font-bold md:text-4xl lg:text-6xl&quot;&gt;<br>        {movie?.title || movie?.name || movie?.original_name}<br>      &lt;/h1&gt;<br>      &lt;p className=&quot;max-w-xs text-xs text-shadow-md md:max-w-lg md:text-lg lg:max-w-xl lg:text-lg&quot;&gt;<br>        {movie?.overview &amp;&amp; truncate(movie?.overview)}<br>      &lt;/p&gt;<br><br>      &lt;div className=&quot;flex space-x-3&quot;&gt;<br>        &lt;button className=&quot;bannerButton bg-white text-black&quot; onClick={() =&gt; {<br>            setCurrentMovie(movie)<br>            setShowModal(true)<br>          }}&gt;<br>          &lt;FaPlay className=&quot;h-4 w-4 text-black md:h-7 md:w-7&quot; onClick={() =&gt; {<br>            setCurrentMovie(movie)<br>            setShowModal(true)<br>          }} /&gt; Play<br>        &lt;/button&gt;<br>        &lt;button<br>          className=&quot;bannerButton bg-[gray]/70&quot;<br>          onClick={() =&gt; {<br>            setCurrentMovie(movie)<br>            setShowModal(true)<br>          }}<br>        &gt;<br>          More Info &lt;HiOutlineInformationCircle className=&quot;h-5 w-5 md:h-8 md:w-8&quot; /&gt;<br>        &lt;/button&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  )<br>}<br><br>export default Banner</pre><p>Create BasicMenu.tsx file in components folder.</p><pre>&quot;use client&quot;;<br><br>import Button from &#39;@mui/material/Button&#39;<br>import Menu from &#39;@mui/material/Menu&#39;<br>import MenuItem from &#39;@mui/material/MenuItem&#39;<br>import { useState } from &#39;react&#39;<br><br>export default function BasicMenu() {<br>  const [anchorEl, setAnchorEl] = useState&lt;null | HTMLElement&gt;(null)<br>  const open = Boolean(anchorEl)<br><br>  const handleClick = (event: React.MouseEvent&lt;HTMLButtonElement&gt;) =&gt; {<br>    setAnchorEl(event.currentTarget)<br>  }<br><br>  const handleClose = () =&gt; {<br>    setAnchorEl(null)<br>  }<br><br>  return (<br>    &lt;div className=&quot;md:!hidden&quot;&gt;<br>      &lt;Button<br>        id=&quot;basic-button&quot;<br>        aria-controls={open ? &#39;basic-menu&#39; : undefined}<br>        aria-haspopup=&quot;true&quot;<br>        aria-expanded={open ? &#39;true&#39; : undefined}<br>        onClick={handleClick}<br>        className=&quot;!capitalize !text-white&quot;<br>      &gt;<br>        Browse<br>      &lt;/Button&gt;<br>      &lt;Menu<br>        id=&quot;basic-menu&quot;<br>        anchorEl={anchorEl}<br>        open={open}<br>        onClose={handleClose}<br>        className=&quot;menu&quot;<br>        MenuListProps={{<br>          &#39;aria-labelledby&#39;: &#39;basic-button&#39;,<br>        }}<br>      &gt;<br>        &lt;MenuItem onClick={handleClose}&gt;Home&lt;/MenuItem&gt;<br>        &lt;MenuItem onClick={handleClose}&gt;TV Shows&lt;/MenuItem&gt;<br>        &lt;MenuItem onClick={handleClose}&gt;Movies&lt;/MenuItem&gt;<br>        &lt;MenuItem onClick={handleClose}&gt;New &amp; Popular&lt;/MenuItem&gt;<br>        &lt;MenuItem onClick={handleClose}&gt;My List&lt;/MenuItem&gt;<br>      &lt;/Menu&gt;<br>    &lt;/div&gt;<br>  )<br>}</pre><p>Now lets create Header.tsx file in components folder.</p><pre>&quot;use client&quot;;<br><br>import Link from &#39;next/link&#39;<br>import { useEffect, useState } from &#39;react&#39;<br>import useAuth from &#39;@/hooks/useAuth&#39;<br>import { BiBell, BiSearch } from &#39;react-icons/bi&#39;<br>import BasicMenu from &#39;./BasicMenu&#39;;<br><br>function Header() {<br>  const [isScrolled, setIsScrolled] = useState(false)<br>  const { logout } = useAuth()<br><br>  useEffect(() =&gt; {<br>    const handleScroll = () =&gt; {<br>      if (window.scrollY &gt; 0) {<br>        setIsScrolled(true)<br>      } else {<br>        setIsScrolled(false)<br>      }<br>    }<br><br>    window.addEventListener(&#39;scroll&#39;, handleScroll)<br><br>    return () =&gt; {<br>      window.removeEventListener(&#39;scroll&#39;, handleScroll)<br>    }<br>  }, [])<br><br>  return (<br>    &lt;header className={`${isScrolled &amp;&amp; &#39;bg-[#141414]&#39;}`}&gt;<br>      &lt;div className=&quot;flex items-center space-x-2 md:space-x-10&quot;&gt;<br>        &lt;img<br>          src=&quot;https://rb.gy/ulxxee&quot;<br>          width={100}<br>          height={100}<br>          className=&quot;cursor-pointer object-contain&quot;<br>        /&gt;<br><br>        &lt;BasicMenu /&gt;<br><br>        &lt;ul className=&quot;hidden space-x-4 md:flex&quot;&gt;<br>          &lt;li className=&quot;headerLink&quot;&gt;Home&lt;/li&gt;<br>          &lt;li className=&quot;headerLink&quot;&gt;TV Shows&lt;/li&gt;<br>          &lt;li className=&quot;headerLink&quot;&gt;Movies&lt;/li&gt;<br>          &lt;li className=&quot;headerLink&quot;&gt;New &amp; Popular&lt;/li&gt;<br>          &lt;li className=&quot;headerLink&quot;&gt;My List&lt;/li&gt;<br>        &lt;/ul&gt;<br>      &lt;/div&gt;<br><br>      &lt;div className=&quot;flex items-center space-x-4 text-sm font-light&quot;&gt;<br>        &lt;BiSearch className=&quot;hidden h-6 w-6 sm:inline&quot; /&gt;<br>        &lt;p className=&quot;hidden lg:inline&quot;&gt;Kids&lt;/p&gt;<br>        &lt;BiBell className=&quot;h-6 w-6&quot; /&gt;<br>        &lt;Link href=&quot;/account&quot;&gt;<br>          &lt;img<br>            src=&quot;https://rb.gy/g1pwyx&quot;<br>            alt=&quot;image&quot;<br>            className=&quot;cursor-pointer rounded&quot;<br>          /&gt;<br>        &lt;/Link&gt;<br>      &lt;/div&gt;<br>    &lt;/header&gt;<br>  )<br>}<br><br>export default Header</pre><p>Create Loader.tsx file in components folder.</p><pre>function Loader() {<br>    return (<br>      &lt;div className=&quot;lds-ripple&quot;&gt;<br>        &lt;div&gt;&lt;/div&gt;<br>        &lt;div&gt;&lt;/div&gt;<br>      &lt;/div&gt;<br>    )<br>}<br><br>export default Loader;</pre><p>Create Membership.tsx file in components folder.</p><pre>&quot;use client&quot;;<br><br>import React, { useState } from &#39;react&#39;<br>import useAuth from &#39;../hooks/useAuth&#39;<br>import Loader from &#39;./Loader&#39;<br>import { useRouter } from &#39;next/navigation&#39;;<br>import { deleteDoc, doc } from &#39;firebase/firestore&#39;;<br>import { db } from &#39;@/firebase&#39;;<br><br>function Membership () {<br>    const { user } = useAuth();<br>    const [loading, setLoading] = useState&lt;boolean&gt;(false)<br>    const router = useRouter()<br><br>    const handleClick = async () : Promise&lt;void&gt; =&gt; {<br>        setLoading(true);<br>        if(user == null){<br>            setLoading(false);<br>            return;<br>        }<br>        const docRef = doc(db, &quot;subscriptions&quot;, user.uid);<br>        await deleteDoc(docRef);<br>        router.push(&#39;/&#39;);<br>    }<br>    <br>    return (<br>        &lt;div className=&quot;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&quot;&gt;<br>            &lt;div className=&quot;space-y-2 py-4&quot;&gt;<br>                &lt;h4 className=&quot;text-lg text-[gray]&quot;&gt;Membership &amp; Billing&lt;/h4&gt;<br>                &lt;button<br>                  disabled={loading}<br>                className=&quot;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&quot;<br>                  onClick={handleClick}<br>                &gt;<br>                {loading ? (<br>                    &lt;Loader /&gt;<br>                ) : (<br>                    &#39;Cancel Membership&#39;<br>                )}<br>                &lt;/button&gt;<br>            &lt;/div&gt;<br><br>            &lt;div className=&quot;col-span-3&quot;&gt;<br>                &lt;div className=&quot;flex flex-col justify-between border-b border-white/10 py-4 md:flex-row&quot;&gt;<br>                &lt;div&gt;<br>                    &lt;p className=&quot;font-medium&quot;&gt;{user?.email}&lt;/p&gt;<br>                &lt;/div&gt;<br>                &lt;div className=&quot;md:text-right&quot;&gt;<br>                    &lt;p className=&quot;membershipLink&quot;&gt;Change email&lt;/p&gt;<br>                    &lt;p className=&quot;membershipLink&quot;&gt;Change password&lt;/p&gt;<br>                &lt;/div&gt;<br>                &lt;/div&gt;<br><br>                &lt;div className=&quot;flex flex-col justify-between pt-4 pb-4 md:flex-row md:pb-0&quot;&gt;<br>                    &lt;div className=&quot;flex flex-1 flex-col md:text-right&quot;&gt;<br>                        &lt;p className=&quot;membershipLink&quot;&gt;Manage payment info&lt;/p&gt;<br>                        &lt;p className=&quot;membershipLink&quot;&gt;Add backup payment method&lt;/p&gt;<br>                        &lt;p className=&quot;membershipLink&quot;&gt;Billing Details&lt;/p&gt;<br>                        &lt;p className=&quot;membershipLink&quot;&gt;Change billing day&lt;/p&gt;<br>                    &lt;/div&gt;<br>                &lt;/div&gt;<br>            &lt;/div&gt;<br>      &lt;/div&gt;<br>    );<br>}<br><br>export default Membership;</pre><p>Create Model.tsx file in components folder.</p><pre>&quot;use client&quot;;<br><br>  import MuiModal from &#39;@mui/material/Modal&#39;<br>  import {<br>    collection,<br>    deleteDoc,<br>    doc,<br>    DocumentData,<br>    onSnapshot,<br>    setDoc,<br>  } from &#39;firebase/firestore&#39;<br>  import { useEffect, useState } from &#39;react&#39;<br>  import toast, { Toaster } from &#39;react-hot-toast&#39;<br>  import { FaPlay } from &#39;react-icons/fa&#39;<br>  import ReactPlayer from &#39;react-player/lazy&#39;<br>  import { useRecoilState } from &#39;recoil&#39;<br>  import { modalState, movieState } from &#39;../atoms/modalAtom&#39;<br>  import { db } from &#39;../firebase&#39;<br>  import useAuth from &#39;../hooks/useAuth&#39;<br>  import { Element, Genre, Movie } from &#39;../typings&#39;<br>import { AiOutlineCheck, AiOutlinePlus } from &#39;react-icons/ai&#39;;<br>import { BsHandThumbsUp } from &#39;react-icons/bs&#39;;<br>import { HiOutlineVolumeOff, HiOutlineVolumeUp } from &#39;react-icons/hi&#39;;<br>import { RxCross1 } from &#39;react-icons/rx&#39;;<br>  <br>  function Modal() {<br>    const [showModal, setShowModal] = useRecoilState(modalState)<br>    const [movie, setMovie] = useRecoilState(movieState)<br>    const [trailer, setTrailer] = useState(&#39;&#39;)<br>    const [genres, setGenres] = useState&lt;Genre[]&gt;([])<br>    const [muted, setMuted] = useState(true)<br>    const { user } = useAuth()<br>    const [addedToList, setAddedToList] = useState(false)<br>    const [movies, setMovies] = useState&lt;DocumentData[] | Movie[]&gt;([])<br>  <br>    const toastStyle = {<br>      background: &#39;white&#39;,<br>      color: &#39;black&#39;,<br>      fontWeight: &#39;bold&#39;,<br>      fontSize: &#39;16px&#39;,<br>      padding: &#39;15px&#39;,<br>      borderRadius: &#39;9999px&#39;,<br>      maxWidth: &#39;1000px&#39;,<br>    }<br>  <br>    useEffect(() =&gt; {<br>      if (!movie) return<br>  <br>      async function fetchMovie() {<br>        const data = await fetch(<br>          `https://api.themoviedb.org/3/${<br>            movie?.media_type === &#39;tv&#39; ? &#39;tv&#39; : &#39;movie&#39;<br>          }/${movie?.id}?api_key=${<br>            process.env.NEXT_PUBLIC_API_KEY<br>          }&amp;language=en-IN&amp;append_to_response=videos`<br>        )<br>          .then((response) =&gt; response.json())<br>          .catch((err) =&gt; console.log(err.message))<br>  <br>        if (data?.videos) {<br>          const index = data.videos.results.findIndex(<br>            (element: Element) =&gt; element.type === &#39;Trailer&#39;<br>          )<br>          setTrailer(data.videos?.results[index]?.key)<br>        }<br>        if (data?.genres) {<br>          setGenres(data.genres)<br>        }<br>      }<br>  <br>      fetchMovie()<br>    }, [movie])<br>  <br>    // Find all the movies in the user&#39;s list<br>    useEffect(() =&gt; {<br>      if (user) {<br>        return onSnapshot(<br>          collection(db, &#39;customers&#39;, user.uid, &#39;myList&#39;),<br>          (snapshot) =&gt; setMovies(snapshot.docs)<br>        )<br>      }<br>    }, [db, movie?.id])<br>  <br>    // Check if the movie is already in the user&#39;s list<br>    useEffect(<br>      () =&gt;<br>        setAddedToList(<br>          movies.findIndex((result) =&gt; result.data().id === movie?.id) !== -1<br>        ),<br>      [movies]<br>    )<br>  <br>    const handleList = async () =&gt; {<br>      if (addedToList) {<br>        await deleteDoc(<br>          doc(db, &#39;customers&#39;, user!.uid, &#39;myList&#39;, movie?.id.toString()!)<br>        )<br>  <br>        toast(<br>          `${movie?.title || movie?.original_name} has been removed from My List`,<br>          {<br>            duration: 8000,<br>            style: toastStyle,<br>          }<br>        )<br>      } else {<br>        await setDoc(<br>          doc(db, &#39;customers&#39;, user!.uid, &#39;myList&#39;, movie?.id.toString()!),<br>          { ...movie }<br>        )<br>  <br>        toast(<br>          `${movie?.title || movie?.original_name} has been added to My List`,<br>          {<br>            duration: 8000,<br>            style: toastStyle,<br>          }<br>        )<br>      }<br>    }<br>  <br>    const handleClose = () =&gt; {<br>      setShowModal(false)<br>    }<br>  <br>    console.log(trailer)<br>  <br>    return (<br>      &lt;MuiModal<br>        open={showModal}<br>        onClose={handleClose}<br>        className=&quot;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&quot;<br>      &gt;<br>        &lt;&gt;<br>          &lt;Toaster position=&quot;bottom-center&quot; /&gt;<br>          &lt;button<br>            onClick={handleClose}<br>            className=&quot;modalButton absolute right-5 top-5 !z-40 h-9 w-9 border-none bg-[#181818] hover:bg-[#181818]&quot;<br>          &gt;<br>            &lt;RxCross1 className=&quot;h-6 w-6&quot; /&gt;<br>          &lt;/button&gt;<br>  <br>          &lt;div className=&quot;relative pt-[56.25%]&quot;&gt;<br>            &lt;ReactPlayer<br>              url={`https://www.youtube.com/watch?v=${trailer}`}<br>              width=&quot;100%&quot;<br>              height=&quot;100%&quot;<br>              style={{ position: &#39;absolute&#39;, top: &#39;0&#39;, left: &#39;0&#39; }}<br>              playing<br>              muted={muted}<br>            /&gt;<br>            &lt;div className=&quot;absolute bottom-10 flex w-full items-center justify-between px-10&quot;&gt;<br>              &lt;div className=&quot;flex space-x-2&quot;&gt;<br>                &lt;button className=&quot;flex items-center gap-x-2 rounded bg-white px-8 text-xl font-bold text-black transition hover:bg-[#e6e6e6]&quot;&gt;<br>                  &lt;FaPlay className=&quot;h-7 w-7 text-black&quot; /&gt;<br>                  Play<br>                &lt;/button&gt;<br>  <br>                &lt;button className=&quot;modalButton&quot; onClick={handleList}&gt;<br>                  {addedToList ? (<br>                    &lt;AiOutlineCheck className=&quot;h-7 w-7&quot; /&gt;<br>                  ) : (<br>                    &lt;AiOutlinePlus className=&quot;h-7 w-7&quot; /&gt;<br>                  )}<br>                &lt;/button&gt;<br>  <br>                &lt;button className=&quot;modalButton&quot;&gt;<br>                  &lt;BsHandThumbsUp className=&quot;h-7 w-7&quot; /&gt;<br>                &lt;/button&gt;<br>              &lt;/div&gt;<br>              &lt;button className=&quot;modalButton&quot; onClick={() =&gt; setMuted(!muted)}&gt;<br>                {muted ? (<br>                  &lt;HiOutlineVolumeOff className=&quot;h-6 w-6&quot; /&gt;<br>                ) : (<br>                  &lt;HiOutlineVolumeUp className=&quot;h-6 w-6&quot; /&gt;<br>                )}<br>              &lt;/button&gt;<br>            &lt;/div&gt;<br>          &lt;/div&gt;<br>  <br>          &lt;div className=&quot;flex space-x-16 rounded-b-md bg-[#181818] px-10 py-8&quot;&gt;<br>            &lt;div className=&quot;space-y-6 text-lg&quot;&gt;<br>              &lt;div className=&quot;flex items-center space-x-2 text-sm&quot;&gt;<br>                &lt;p className=&quot;font-semibold text-green-400&quot;&gt;<br>                  {movie!.vote_average * 10}% Match<br>                &lt;/p&gt;<br>                &lt;p className=&quot;font-light&quot;&gt;<br>                  {movie?.release_date || movie?.first_air_date}<br>                &lt;/p&gt;<br>                &lt;div className=&quot;flex h-4 items-center justify-center rounded border border-white/40 px-1.5 text-xs&quot;&gt;<br>                  HD<br>                &lt;/div&gt;<br>              &lt;/div&gt;<br>  <br>              &lt;div className=&quot;flex flex-col gap-x-10 gap-y-4 font-light md:flex-row&quot;&gt;<br>                &lt;p className=&quot;w-5/6&quot;&gt;{movie?.overview}&lt;/p&gt;<br>                &lt;div className=&quot;flex flex-col space-y-3 text-sm&quot;&gt;<br>                  &lt;div&gt;<br>                    &lt;span className=&quot;text-[gray]&quot;&gt;Genres: &lt;/span&gt;<br>                    {genres.map((genre) =&gt; genre.name).join(&#39;, &#39;)}<br>                  &lt;/div&gt;<br>  <br>                  &lt;div&gt;<br>                    &lt;span className=&quot;text-[gray]&quot;&gt;Original language: &lt;/span&gt;<br>                    {movie?.original_language}<br>                  &lt;/div&gt;<br>  <br>                  &lt;div&gt;<br>                    &lt;span className=&quot;text-[gray]&quot;&gt;Total votes: &lt;/span&gt;<br>                    {movie?.vote_count}<br>                  &lt;/div&gt;<br>                &lt;/div&gt;<br>              &lt;/div&gt;<br>            &lt;/div&gt;<br>          &lt;/div&gt;<br>        &lt;/&gt;<br>      &lt;/MuiModal&gt;<br>    )<br>  }<br>  <br>  export default Modal</pre><p>Create Page.tsx file in components folder. This will be our home page whcih will contain all the movies data.</p><pre>&quot;use client&quot;;<br><br>import React, { useEffect, useState } from &#39;react&#39;<br>import Header from &#39;./Header&#39;<br>import Banner from &#39;./Banner&#39;<br>import Row from &#39;./Row&#39;<br>import { Movie } from &#39;@/typings&#39;<br>import useAuth from &#39;@/hooks/useAuth&#39;<br>import { useRecoilValue } from &#39;recoil&#39;;<br>import { modalState, movieState } from &#39;@/atoms/modalAtom&#39;;<br>import Modal from &#39;./Modal&#39;;<br>import Plans from &#39;./Plan&#39;;<br>import Loader from &#39;./Loader&#39;;<br>import useList from &#39;@/hooks/useList&#39;;<br>import { doc, getDoc } from &#39;firebase/firestore&#39;;<br>import { db } from &#39;@/firebase&#39;;<br>import { User } from &#39;firebase/auth&#39;;<br><br>interface Props {<br>    netflixOriginals: Movie[]<br>    trendingNow: Movie[]<br>    topRated: Movie[]<br>    actionMovies: Movie[]<br>    comedyMovies: Movie[]<br>    horrorMovies: Movie[]<br>    romanceMovies: Movie[]<br>    documentaries: Movie[]<br>  }<br><br>const Page = ({netflixOriginals,<br>    actionMovies,<br>    comedyMovies,<br>    documentaries,<br>    horrorMovies,<br>    romanceMovies,<br>    topRated,<br>    trendingNow,<br>} : Props) =&gt; {<br><br>    const { loading, user } = useAuth();<br>    const [subscription, setSubscription] = useState&lt;boolean | null&gt;(null)<br>    const showModal = useRecoilValue(modalState);<br>    const movie = useRecoilValue(movieState);<br>    const list = useList(user?.uid)<br>    useEffect(() =&gt; {<br>      if(user != null)<br>        fetchSubscription()<br>    }, [user])<br><br>    const fetchSubscription = async () : Promise&lt;void&gt; =&gt; {<br>      const isSub = await isSubscribed(user);<br>      setSubscription(isSub)<br>      <br>      console.log(subscription)<br>    }<br><br>    const isSubscribed = async (user: User | null) : Promise&lt;boolean | null&gt; =&gt; {<br>      if(user == null) return null;<br>      const userRef =  doc(db, &quot;subscriptions&quot;, user.uid);<br>      const docSnap = await getDoc(userRef);<br>      if(!docSnap.exists()) return false;<br>      else{<br>        const data = docSnap.data();<br>        const newdate = new Date().toISOString()<br>        const expiryDate = data.subscriptionExpiryDate<br>        if(newdate &gt; expiryDate){<br>          return false<br>        }<br>        else{<br>          return true;<br>        }<br>      }<br>    }<br>    <br>    if(user == null) return &lt;Loader /&gt;;<br>    if (loading || subscription === null) return &lt;Loader /&gt;;<br><br>    if (!subscription) return &lt;Plans /&gt;;<br>    console.log(&quot;subscription: &quot;, subscription)<br><br>  return (<br>    &lt;div className={`relative h-screen bg-gradient-to-b lg:h-[140vh] ${<br>        showModal &amp;&amp; &#39;!h-screen overflow-hidden&#39;<br>      }`}&gt;<br>         &lt;Header /&gt;<br>         &lt;main className=&quot;relative pl-4 pb-24 lg:space-y-24 lg:pl-16&quot;&gt;<br>          &lt;Banner netflixOriginals={netflixOriginals} /&gt;<br>          &lt;section className=&quot;md:space-y-24&quot;&gt;<br>          &lt;Row title=&quot;Trending Now&quot; movies={trendingNow} /&gt;<br>          &lt;Row title=&quot;Top Rated&quot; movies={topRated} /&gt;<br>          &lt;Row title=&quot;Action Thrillers&quot; movies={actionMovies} /&gt;<br>          {list.length &gt; 0 &amp;&amp; &lt;Row title=&quot;My List&quot; movies={list} /&gt;}<br>          &lt;Row title=&quot;Comedies&quot; movies={comedyMovies} /&gt;<br>          &lt;Row title=&quot;Scary Movies&quot; movies={horrorMovies} /&gt;<br>          &lt;Row title=&quot;Romance Movies&quot; movies={romanceMovies} /&gt;<br>          &lt;Row title=&quot;Documentaries&quot; movies={documentaries} /&gt;<br>          &lt;/section&gt;<br>         &lt;/main&gt;<br>         {showModal &amp;&amp; &lt;Modal /&gt;}<br>      &lt;/div&gt;<br>  )<br>}<br><br>export default Page</pre><p>Now create PaymentForm.tsx in components folder. This folder is very important for for payment and subcription.</p><pre>&#39;use client&#39;;<br><br>import React, { useEffect, useState } from &#39;react&#39;;<br>import { Plan } from &#39;@/typings&#39;;<br>import { User } from &#39;firebase/auth&#39;;<br>import { addDoc, collection, doc, getDoc, getDocs, query, setDoc, updateDoc } from &#39;firebase/firestore&#39;;<br>import { db } from &#39;@/firebase&#39;;<br>import Razorpay from &#39;razorpay&#39;;<br>import Loader from &#39;./Loader&#39;;<br>import { useRouter } from &#39;next/navigation&#39;;<br>import useAuth from &#39;@/hooks/useAuth&#39;;<br><br>declare global {<br>    interface Window {<br>      Razorpay: any;<br>    }<br>  }<br><br>interface Props {<br>  selectedPlan: Plan;<br>  previousPlan: Plan | null;<br>  user: User | null,<br>  handleClose: () =&gt; void;<br>}<br><br>const initializeRazorpay = async (): Promise&lt;any&gt; =&gt; {<br>    return new Promise((resolve) =&gt; {<br>      const script = document.createElement(&quot;script&quot;);<br>      script.src = &quot;https://checkout.razorpay.com/v1/checkout.js&quot;;<br><br>      script.onload = () =&gt; {<br>        resolve(true);<br>      };<br>      script.onerror = () =&gt; {<br>        resolve(false);<br>      };<br><br>      document.body.appendChild(script);<br>    });<br>  }<br><br>const PaymentForm: React.FC&lt;Props&gt; = ({ selectedPlan, previousPlan, user, handleClose }) =&gt; {<br>  const [paymentCompleted, setPaymentCompleted] = useState(false);<br>  const [amount, setAmount] = useState(selectedPlan.amount);<br>  const [loading, setLoading] = useState(false);<br>  const router = useRouter()<br><br>  useEffect(() =&gt; {<br>    if(previousPlan != null) setAmount(selectedPlan.amount - previousPlan.amount);<br>  }, [])<br><br>  const handlePayment = async (e: any): Promise&lt;void&gt; =&gt; {<br>    setLoading(true)<br>    e.preventDefault();<br>    const currentUser = user;<br>    if(currentUser == null) return;<br>    const orderResponse = await createRazorpayOrder(amount);<br>    const orderId = orderResponse;<br><br>      try {<br>        const res = await initializeRazorpay();<br>        if (!res) {<br>            alert(&quot;Your are offline.... Razorpay SDK Failed to load&quot;);<br>            return;<br>          }<br>  <br>          const options = {<br>            key: process.env.RAZORPAY_KEY,<br>            amount: amount, // Amount in paise or smallest currency unit<br>            currency: &#39;INR&#39;,<br>            name: &#39;Netflix&#39;,<br>            description: &#39;Subscription Payment&#39;,<br>            order_id: orderId,<br>            image: &quot;@/app/favicon.ico&quot;,<br>            handler: async function (response: any) {<br>              // Verify the payment with Razorpay API<br>                // Payment successful, update user&#39;s subscription status in Firestore<br>              const expiryDate = calculateExpiryDate();<br><br>              await updateSubscriptionStatus(currentUser.uid, selectedPlan, orderId, expiryDate)<br>              setPaymentCompleted(true);<br>              location.reload();<br>            },<br>            prefill: {<br>              email: currentUser.email,<br>            },<br>            notes: {<br>              planName: selectedPlan.name,<br>              planId: selectedPlan.id,<br>              userId: currentUser.uid,<br>            },<br>            theme: {<br>              color: &#39;#F37254&#39;,<br>            },<br>          }<br><br>        const razorpay = new window.Razorpay(options);<br>        razorpay.open();<br>      }<br>    catch (error) {<br>        // Handle errors during payment process<br>        console.log(&#39;Payment error:&#39;, error);<br>        handleClose(); // Close the payment form<br>      }<br>      setLoading(false);<br>  };<br><br>  const createRazorpayOrder = async (amount: number): Promise&lt;any&gt; =&gt; {<br>    const response = await fetch(&#39;/api/create-razorpay-order&#39;, {<br>        method: &#39;POST&#39;,<br>        body: JSON.stringify({ amount }),<br>        headers: {<br>          &#39;Content-Type&#39;: &#39;application/json&#39;,<br>        },<br>      });<br>      const data = await response.json();<br>      return data.id;<br>  };<br><br>  const calculateExpiryDate = (): string =&gt; {<br>    const currentDate = new Date();<br>    const expiryDate = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, currentDate.getDate());<br>    return expiryDate.toISOString();<br>  };<br><br>  const updateSubscriptionStatus = async (<br>    userId: string,<br>    plan: Plan,<br>    subscriptionId: string,<br>    expiryDate: string<br>  ): Promise&lt;void&gt; =&gt; {<br>    try {<br>    //   const userRef = doc(db, &#39;subscriptions&#39;, userId);<br>      const userRef =  doc(db, &quot;subscriptions&quot;, userId);<br>      const docSnap = await getDoc(userRef);<br>      //find userId in firestore and if present then update doc otherwise addDoc<br><br><br>      if(docSnap.exists()){<br>        await updateDoc(doc(db, &#39;subscriptions&#39;, userId), {<br>            subscriptionPlan: plan.name,<br>            subscriptionPlanId: plan.id,<br>            subscriptionAmount: plan.amount,<br>            subscriptionExpiryDate: expiryDate,<br>            subscriptionId,<br>          });<br>      }<br>      else{<br>        await setDoc(userRef, {<br>            subscriptionPlan: plan.name,<br>            subscriptionPlanId: plan.id,<br>            subscriptionAmount: plan.amount,<br>            subscriptionExpiryDate: expiryDate,<br>            subscriptionId,<br>          })<br>      }<br>      console.log(&#39;Subscription status updated successfully&#39;);<br>      // Add any further logic or redirection after successful subscription update<br>    } catch (error) {<br>      // Handle errors during subscription status update<br>      console.log(&#39;Subscription status update error:&#39;, error);<br>    }<br>  };<br><br>  return (<br>    &lt;div className=&quot;bg-gray-900 text-white p-8 rounded-lg shadow-lg pt-28&quot;&gt;<br>      {paymentCompleted ? (<br>        &lt;div&gt;<br>          &lt;h2 className=&quot;text-3xl mb-4&quot;&gt;Payment Completed!&lt;/h2&gt;<br>          &lt;p className=&quot;text-xl&quot;&gt;Thank you for your subscription.&lt;/p&gt;<br>          &lt;p className=&quot;text-xl&quot;&gt;Just wait your would be redirected to home.&lt;/p&gt;<br>        &lt;/div&gt;<br>      ) : (<br>        &lt;div&gt;<br>          &lt;h2 className=&quot;text-3xl mb-4&quot;&gt;Payment Form&lt;/h2&gt;<br>          &lt;p className=&quot;text-xl mb-4&quot;&gt;Selected Plan: {selectedPlan.name}&lt;/p&gt;<br>          &lt;p className=&quot;text-xl mb-4&quot;&gt;Video Quality: {selectedPlan.videoQuality}&lt;/p&gt;<br>          &lt;p className=&quot;text-xl mb-4&quot;&gt;Resolution: {selectedPlan.resolution}&lt;/p&gt;<br>          &lt;p className=&quot;text-xl mb-4&quot;&gt;Description: {selectedPlan.description}&lt;/p&gt;<br>          &lt;p className=&quot;text-xl mb-4&quot;&gt;Price: INR {selectedPlan.amount}.00&lt;/p&gt;<br>          &lt;p className=&quot;text-xl mb-4&quot;&gt;Amount Payable: INR {amount}.00&lt;/p&gt;<br>          {!loading ? &lt;&gt;<br>            &lt;button<br>            className=&quot;bg-red-600 hover:bg-red-700 text-white px-6 py-3 rounded-lg mr-4&quot;<br>            onClick={handlePayment}<br>          &gt;<br>            Proceed to Pay<br>          &lt;/button&gt;<br>          &lt;button<br>            className=&quot;bg-gray-800 hover:bg-gray-900 text-white px-6 py-3 rounded-lg&quot;<br>            onClick={handleClose}<br>          &gt;<br>            Cancel<br>          &lt;/button&gt;<br>          &lt;/&gt; : &lt;Loader /&gt;}<br>        &lt;/div&gt;<br>      )}<br>      &lt;/div&gt;<br>  );<br>};<br><br>export default PaymentForm;</pre><p>Create Plan.tsx file in components folder.</p><pre>&quot;use client&quot;;<br><br>import Link from &#39;next/link&#39;<br>import { useEffect, useState } from &#39;react&#39;<br>import useAuth from &#39;../hooks/useAuth&#39;<br>import Loader from &#39;./Loader&#39;<br>import { AiOutlineCheck } from &#39;react-icons/ai&#39;<br>import Table from &#39;./Table&#39;;<br>import { Plan } from &#39;@/typings&#39;;<br>import PaymentForm from &#39;./PaymentForm&#39;;<br>import { doc, getDoc } from &#39;firebase/firestore&#39;;<br>import { db } from &#39;@/firebase&#39;;<br>import plans from &#39;@/utils/data&#39;<br><br>function Plans() {<br>  const { logout, user, planDetails } = useAuth()<br>  const [selectedPlan, setSelectedPlan] = useState&lt;Plan&gt;(plans[2])<br>  const [isBillingLoading, setBillingLoading] = useState(false)<br>  const [showPaymentForm, setShowPaymentForm] = useState(false);<br>  const [previousPlan, setPreviousPlan] = useState&lt;Plan | null&gt;(null)<br>  const [loading, setLoading] = useState&lt;boolean&gt;(false)<br><br>  useEffect(() =&gt; {<br>    setLoading(true)<br>    fetchSubscribes()<br>    setLoading(false)<br>  }, [planDetails])<br><br>  const fetchSubscribes = async (): Promise&lt;void&gt; =&gt; {<br>    if (!user) return;<br>    const userRef =  doc(db, &quot;subscriptions&quot;, user.uid);<br>    const docSnap = await getDoc(userRef);<br>    if(docSnap.exists()){<br>      if(!docSnap.data().subscriptionPlanId) return;<br>        for(let i=0; i&lt;plans.length; i++){<br>          if(plans[i].id == docSnap.data().subscriptionPlanId){<br>            setPreviousPlan(plans[i])<br>            setSelectedPlan(plans[i])<br>            break;<br>          }<br>        }<br>    }<br>  }<br><br>  const subscribeToPlan = async () =&gt; {<br>    if (!user) return<br><br>    setBillingLoading(true)<br>    setShowPaymentForm(true);<br>    setBillingLoading(false)<br>  }<br><br>  const handlePaymentFormClose = () =&gt; {<br>    setShowPaymentForm(false);<br>  };<br><br>  if(loading) return &lt;Loader /&gt;<br><br>  return (<br>    &lt;div&gt;<br>      &lt;header className=&quot;border-b border-white/10 bg-[#141414]&quot;&gt;<br>        &lt;Link href=&quot;/&quot;&gt;<br>          &lt;img<br>            src=&quot;https://rb.gy/ulxxee&quot;<br>            alt=&quot;Netflix&quot;<br>            width={150}<br>            height={90}<br>            className=&quot;cursor-pointer object-contain&quot;<br>          /&gt;<br>        &lt;/Link&gt;<br>        &lt;button<br>          className=&quot;text-lg font-medium hover:underline&quot;<br>          onClick={logout}<br>        &gt;<br>          Sign Out<br>        &lt;/button&gt;<br>      &lt;/header&gt;<br>      {!showPaymentForm ?<br>      &lt;main className=&quot;mx-auto max-w-5xl px-5 pt-28 pb-12 transition-all md:px-10&quot;&gt;<br>        &lt;h1 className=&quot;mb-3 text-3xl font-medium&quot;&gt;<br>          Choose the plan that&#39;s right for you<br>        &lt;/h1&gt;<br>        &lt;ul&gt;<br>          &lt;li className=&quot;flex items-center gap-x-2 text-lg&quot;&gt;<br>            &lt;AiOutlineCheck className=&quot;h-7 w-7 text-[#E50914]&quot; /&gt; Watch all you want.<br>            Ad-free.<br>          &lt;/li&gt;<br>          &lt;li className=&quot;flex items-center gap-x-2 text-lg&quot;&gt;<br>            &lt;AiOutlineCheck className=&quot;h-7 w-7 text-[#E50914]&quot; /&gt; Recommendations<br>            just for you.<br>          &lt;/li&gt;<br>          &lt;li className=&quot;flex items-center gap-x-2 text-lg&quot;&gt;<br>            &lt;AiOutlineCheck className=&quot;h-7 w-7 text-[#E50914]&quot; /&gt; Upgrade or cancel<br>            your plan anytime.<br>          &lt;/li&gt;<br>        &lt;/ul&gt;<br><br>        &lt;div className=&quot;mt-4 flex flex-col space-y-5&quot;&gt;<br>          &lt;div className=&quot;flex w-full items-center justify-center self-end md:w-3/5&quot;&gt;<br>            {plans.map((item) =&gt; (<br>                &lt;button<br>                key={item.id}<br>                className={`planBox cursor-pointer ${<br>                    selectedPlan?.id === item.id ? &#39;opacity-100&#39; : &#39;opacity-60&#39;<br>                  }`}<br>                  onClick={() =&gt; setSelectedPlan(item)}<br>              &gt;<br>                {item.name}<br>                &lt;/button&gt;<br>            ))}<br>          &lt;/div&gt;<br><br>          &lt;Table plans={plans} selectedPlan={selectedPlan}  /&gt;<br><br>          {(previousPlan ==null || previousPlan.amount &lt; selectedPlan.amount) &amp;&amp; &lt;button<br>            disabled={!selectedPlan || isBillingLoading}<br>            className={`mx-auto w-11/12 rounded bg-[#E50914] py-4 text-xl shadow hover:bg-[#f6121d] md:w-[420px] ${<br>              isBillingLoading &amp;&amp; &#39;opacity-60&#39;<br>            }`}<br>            onClick={subscribeToPlan}<br>          &gt;<br>            {isBillingLoading ? (<br>              &lt;Loader /&gt;<br>            ) : (<br>              &#39;Subscribe&#39;<br>            )}<br>          &lt;/button&gt;}<br>        &lt;/div&gt;<br>      &lt;/main&gt;<br>      :<br>        &lt;PaymentForm selectedPlan={selectedPlan} previousPlan={previousPlan} user={user} handleClose={handlePaymentFormClose} /&gt;<br>      }<br>    &lt;/div&gt;<br>  )<br>}<br><br>export default Plans</pre><p>Create Row.tsx in components folder.</p><pre>&quot;use client&quot;;<br><br>import { AiOutlineLeft, AiOutlineRight } from &#39;react-icons/ai&#39;;<br>import { DocumentData } from &#39;firebase/firestore&#39;<br>import { useRef, useState } from &#39;react&#39;<br>import { Movie } from &#39;../typings&#39;<br>import Thumbnail from &#39;./Thumbnail&#39;<br><br>interface Props {<br>  title: string<br>  movies: Movie[] | DocumentData[]<br>}<br><br>function Row({ title, movies }: Props) {<br>  const rowRef = useRef&lt;HTMLDivElement&gt;(null)<br>  const [isMoved, setIsMoved] = useState(false)<br><br>  const handleClick = (direction: string) =&gt; {<br>    setIsMoved(true)<br><br>    if (rowRef.current) {<br>      const { scrollLeft, clientWidth } = rowRef.current;<br><br>      const scrollTo = direction === &#39;left&#39; ? scrollLeft - clientWidth : scrollLeft + clientWidth;<br><br>      rowRef.current.scrollTo({ left: scrollTo, behavior: &#39;smooth&#39; });<br>    }<br>  }<br><br>  return (<br>    &lt;div className=&quot;h-40 space-y-0.5 md:space-y-2&quot;&gt;<br>      &lt;h2 className=&quot;w-56 cursor-pointer text-sm font-semibold text-[#e5e5e5] transition duration-200 hover:text-white md:text-2xl&quot;&gt;<br>        {title}<br>      &lt;/h2&gt;<br>      &lt;div className=&quot;group relative md:-ml-2&quot;&gt;<br>        &lt;AiOutlineLeft<br>          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 ${<br>            !isMoved &amp;&amp; &#39;hidden&#39;<br>          }`}<br>          onClick={() =&gt; handleClick(&#39;left&#39;)}<br>        /&gt;<br><br>        &lt;div<br>          ref={rowRef}<br>          className=&quot;flex items-center space-x-0.5 overflow-x-scroll no-scrollbar md:space-x-2.5 md:p-2&quot;<br>        &gt;<br>          {movies.map((movie) =&gt; (<br>            &lt;Thumbnail key={movie.id} movie={movie} /&gt;<br>          ))}<br>        &lt;/div&gt;<br><br>        &lt;AiOutlineRight<br>          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`}<br>          onClick={() =&gt; handleClick(&#39;right&#39;)}<br>        /&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  )<br>}<br><br>export default Row</pre><p>Create Table.tsx in components folder.</p><pre>import { Plan } from &#39;@/typings&#39;<br>import { AiOutlineCheck } from &#39;react-icons/ai&#39;<br><br>interface Props {<br>    plans: Plan[]<br>    selectedPlan: Plan | null<br>}<br><br>function Table({ plans, selectedPlan }: Props) {<br>  return (<br>    &lt;table&gt;<br>      &lt;tbody className=&quot;divide-y divide-[gray]&quot;&gt;<br>        &lt;tr className=&quot;tableRow&quot;&gt;<br>          &lt;td className=&quot;tableDataTitle&quot;&gt;Monthly price&lt;/td&gt;<br>          <br>          {plans.map((item) =&gt; (<br>            &lt;td<br>              key={item.id}<br>              className={`tableDataFeature ${<br>                selectedPlan?.id === item.id<br>                  ? &#39;text-[#e50914]&#39;<br>                  : &#39;text-[gray]&#39;<br>              }`}<br>            &gt;<br>              INR {item.amount}<br>            &lt;/td&gt;<br>          ))}<br>        &lt;/tr&gt;<br><br>        &lt;tr className=&quot;tableRow&quot;&gt;<br>          &lt;td className=&quot;tableDataTitle&quot;&gt;Video quality&lt;/td&gt;<br>          <br>          {plans.map((item) =&gt; (<br>            &lt;td<br>              key={item.id}<br>              className={`tableDataFeature ${<br>                selectedPlan?.id === item.id<br>                  ? &#39;text-[#e50914]&#39;<br>                  : &#39;text-[gray]&#39;<br>              }`}<br>            &gt;<br>              {item.videoQuality}<br>            &lt;/td&gt;<br>          ))}<br>        &lt;/tr&gt;<br><br>        &lt;tr className=&quot;tableRow&quot;&gt;<br>          &lt;td className=&quot;tableDataTitle&quot;&gt;Resolution&lt;/td&gt;<br>          {plans.map((item) =&gt; (<br>            &lt;td<br>              key={item.id}<br>              className={`tableDataFeature ${<br>                selectedPlan?.id === item.id<br>                  ? &#39;text-[#e50914]&#39;<br>                  : &#39;text-[gray]&#39;<br>              }`}<br>            &gt;<br>              {item.resolution}<br>            &lt;/td&gt;<br>          ))}<br>        &lt;/tr&gt;<br><br>        &lt;tr className=&quot;tableRow&quot;&gt;<br>          &lt;td className=&quot;tableDataTitle&quot;&gt;<br>            Availability<br>          &lt;/td&gt;<br>          {plans.map((item) =&gt; (<br>            &lt;td<br>              key={item.id}<br>              className={`tableDataFeature ${<br>                selectedPlan?.id === item.id<br>                  ? &#39;text-[#e50914]&#39;<br>                  : &#39;text-[gray]&#39;<br>              }`}<br>            &gt;<br>              {item.description}<br>            &lt;/td&gt;<br>          ))}<br>        &lt;/tr&gt;<br>      &lt;/tbody&gt;<br>    &lt;/table&gt;<br>  )<br>}<br><br>export default Table</pre><p>Create Thumbnail.tsx file in components folder.</p><pre>&quot;use client&quot;;<br><br>import React from &#39;react&#39;;<br>import { Movie } from &#39;../typings&#39;;<br>import Image from &#39;next/image&#39;;<br>import { DocumentData } from &#39;firebase/firestore&#39;;<br>import { useRecoilState } from &#39;recoil&#39;;<br>import { modalState, movieState } from &#39;@/atoms/modalAtom&#39;;<br><br>interface Props {<br>    movie: Movie | DocumentData<br>  }<br><br>const Thumbnail = ({ movie }: Props) =&gt; {<br><br>  const [showModal, setShowModal] = useRecoilState(modalState)<br>  const [currentMovie, setCurrentMovie] = useRecoilState(movieState)<br><br>  return (<br>    &lt;div<br>      className=&quot;relative h-28 min-w-[180px] cursor-pointer transition duration-200 ease-out md:h-36 md:min-w-[260px] md:hover:scale-105&quot;<br>      onClick={() =&gt; {<br>        setCurrentMovie(movie)<br>        setShowModal(true)<br>      }}<br>    &gt;<br>      &lt;Image<br>        src={`https://image.tmdb.org/t/p/w500${<br>          movie.backdrop_path || movie.poster_path<br>        }`}<br>        className=&quot;rounded-sm object-cover md:rounded&quot;<br>        fill={true}<br>        alt={`thumbnail-${movie.id}`}<br>      /&gt;<br>    &lt;/div&gt;<br>  )<br>}<br><br>export default Thumbnail</pre><p>Now, lets code the page.tsx file. In page.tsx we will just fetch the movies data and sent it to the Page component.</p><pre>import { fetchAllData } from &#39;@/actions/actions&#39;<br>import { Movie } from &#39;../typings&#39;<br>import Page from &#39;@/components/Page&#39;;<br><br>interface Props {<br>  netflixOriginals: Movie[]<br>  trendingNow: Movie[]<br>  topRated: Movie[]<br>  actionMovies: Movie[]<br>  comedyMovies: Movie[]<br>  horrorMovies: Movie[]<br>  romanceMovies: Movie[]<br>  documentaries: Movie[]<br>}<br><br>export default async function Home() {<br>  const {netflixOriginals,<br>    actionMovies,<br>    comedyMovies,<br>    documentaries,<br>    horrorMovies,<br>    romanceMovies,<br>    topRated,<br>    trendingNow} : Props = await fetchAllData();<br><br>    return (<br>      &lt;Page {...{netflixOriginals,<br>        actionMovies,<br>        comedyMovies,<br>        documentaries,<br>        horrorMovies,<br>        romanceMovies,<br>        topRated,<br>        trendingNow,}} /&gt;<br>    );<br>  <br>}</pre><p>Now, lets create the login page. Create a login folder in app directory. Within the folder create <em>layout.tsx</em>, <em>loading.tsx</em> and <em>page.tsx </em>files. Below are the code for all the files.</p><pre>// page.tsx<br>import { fetchAllData } from &#39;@/actions/actions&#39;<br>import { Movie } from &#39;../typings&#39;<br>import Page from &#39;@/components/Page&#39;;<br><br>interface Props {<br>  netflixOriginals: Movie[]<br>  trendingNow: Movie[]<br>  topRated: Movie[]<br>  actionMovies: Movie[]<br>  comedyMovies: Movie[]<br>  horrorMovies: Movie[]<br>  romanceMovies: Movie[]<br>  documentaries: Movie[]<br>}<br><br>export default async function Home() {<br>  const {netflixOriginals,<br>    actionMovies,<br>    comedyMovies,<br>    documentaries,<br>    horrorMovies,<br>    romanceMovies,<br>    topRated,<br>    trendingNow} : Props = await fetchAllData();<br><br>    return (<br>      &lt;Page {...{netflixOriginals,<br>        actionMovies,<br>        comedyMovies,<br>        documentaries,<br>        horrorMovies,<br>        romanceMovies,<br>        topRated,<br>        trendingNow,}} /&gt;<br>    );<br>  <br>}</pre><pre>// layout.tsx<br>import type { Metadata } from &#39;next&#39;<br><br>export const metadata: Metadata = {<br>  title: &#39;NETFLIX - Login&#39;,<br>  description: &#39;Watch your favorite movies and TV shows on Netflix.&#39;,<br>}<br><br>export default function RootLayout({<br>  children,<br>}: {<br>  children: React.ReactNode<br>}) {<br>  return (<br>      &lt;section className=&quot;flex flex-col items-center&quot;&gt;<br>          {children}<br>      &lt;/section&gt;<br>  )<br>}</pre><pre>// loading.tsx<br>import Loader from &#39;@/components/Loader&#39;<br>import React from &#39;react&#39;<br><br>const loading = () =&gt; {<br>  return (<br>    &lt;div className=&#39;pt-36&#39;&gt;<br>    &lt;Loader /&gt;<br>    &lt;/div&gt;<br>  )<br>}<br><br>export default loading</pre><p>Finaaly create a account folder in app directory. Within the folder create <em>layout.tsx</em>, <em>loading.tsx</em> and <em>page.tsx </em>files. Below are the code for all the files.</p><pre>// layout.tsx<br>import type { Metadata } from &#39;next&#39;<br><br>export const metadata: Metadata = {<br>  title: &#39;Account Settings - Netflix&#39;,<br>  description: &#39;Watch your favorite movies and TV shows on Netflix.&#39;,<br>}<br><br>export default function RootLayout({<br>  children,<br>}: {<br>  children: React.ReactNode<br>}) {<br>  return (<br>      &lt;section className=&quot;flex flex-col items-center&quot;&gt;<br>          {children}<br>      &lt;/section&gt;<br>  )<br>}</pre><pre>// loading.tsx<br>import Loader from &#39;@/components/Loader&#39;<br>import React from &#39;react&#39;<br><br>const loading = () =&gt; {<br>  return (<br>    &lt;div className=&#39;pt-36&#39;&gt;<br>    &lt;Loader /&gt;<br>    &lt;/div&gt;<br>  )<br>}<br><br>export default loading</pre><pre>// page.tsx<br>&quot;use client&quot;;<br><br>import React, { useEffect, useState } from &#39;react&#39;;<br>import Link from &#39;next/link&#39;;<br>import useAuth from &#39;@/hooks/useAuth&#39;;<br>import Membership from &#39;@/components/Membership&#39;;<br>import { useRouter } from &#39;next/navigation&#39;;<br>import Loader from &#39;@/components/Loader&#39;;<br>import Plans from &#39;@/components/Plan&#39;;<br>import { doc, getDoc } from &#39;firebase/firestore&#39;;<br>import { db } from &#39;@/firebase&#39;;<br>import { User } from &#39;firebase/auth&#39;;<br><br>interface Props{<br>  id: string;<br>  name: string;<br>  amount: number;<br>  expiry: Date;<br>}<br><br>const Page = () =&gt; {<br>    const { user, logout } = useAuth()<br>    const [showPlan, setShowPlan] = useState&lt;boolean&gt;(false)<br>    const [plan, setPlan] = useState&lt;Props | null&gt;(null)<br>    <br>    const router = useRouter()<br>    const [loading, setLoading] = useState&lt;boolean&gt;(false);<br><br>    useEffect(() =&gt; {<br>      isSubscribed(user);<br>    }, [])<br>      <br>      const isSubscribed = async (user: User | null) : Promise&lt;void&gt; =&gt; {<br>        setLoading(true);<br>        if(user == null){<br>          setLoading(false);<br>          return;<br>        }<br>        const userRef =  doc(db, &quot;subscriptions&quot;, user.uid);<br>        const docSnap = await getDoc(userRef);<br>        if(!docSnap.exists()) return;<br>        else{<br>          const data = docSnap.data();<br>          const newdate = new Date().toISOString()<br>          const expiryDate = data.subscriptionExpiryDate<br>          if(newdate &gt; expiryDate){<br>            setPlan(null)<br>          }<br>          else{<br>            setPlan({id: data.subscriptionPlanId, name: data.subscriptionPlan, amount: data.subscriptionAmount, expiry: expiryDate})<br>          }<br>        }<br>        setLoading(false);<br>      }<br><br>    if(showPlan) return &lt;div className=&#39;pt-32 space-y-2&#39;&gt;<br>      &lt;button onClick={() =&gt; setShowPlan(false)} className=&#39;cursor-pointer hover:underline -mb-28 font-bold text-xl&#39;&gt;Cancel&lt;/button&gt;<br>        &lt;Plans /&gt;<br>      &lt;/div&gt;<br><br>    if(loading) return &lt;div className=&quot;flex pt-32 items-center&quot;&gt;&lt;Loader /&gt;&lt;/div&gt;<br><br>  return (<br>    &lt;div&gt;<br>      &lt;header className={`bg-[#141414]`}&gt;<br>        &lt;Link href=&quot;/&quot;&gt;<br>          &lt;img<br>            src=&quot;https://rb.gy/ulxxee&quot;<br>            width={120}<br>            height={120}<br>            className=&quot;cursor-pointer object-contain&quot;<br>            alt=&quot;image&quot;<br>          /&gt;<br>        &lt;/Link&gt;<br>        &lt;Link href=&quot;/account&quot;&gt;<br>          &lt;img<br>            src=&quot;https://rb.gy/g1pwyx&quot;<br>            alt=&quot;new-image&quot;<br>            className=&quot;cursor-pointer rounded&quot;<br>          /&gt;<br>        &lt;/Link&gt;<br>      &lt;/header&gt;<br><br>      &lt;main className=&quot;mx-auto max-w-6xl px-5 pt-24 pb-12 transition-all md:px-10&quot;&gt;<br>        &lt;div className=&quot;flex flex-col gap-x-4 md:flex-row md:items-center&quot;&gt;<br>          &lt;h1 className=&quot;text-3xl md:text-4xl&quot;&gt;Account&lt;/h1&gt;<br>          &lt;div className=&quot;-ml-0.5 flex items-center gap-x-1.5&quot;&gt;<br>            &lt;img src=&quot;https://rb.gy/4vfk4r&quot; alt=&quot;&quot; className=&quot;h-7 w-7&quot; /&gt;<br>            &lt;p className=&quot;text-xs font-semibold text-[#555]&quot;&gt;<br>              {plan!=null ? `Membership will expire on ${(new Date(plan.expiry)).toDateString()}` : &#39;Membership Expired!&#39;}<br>            &lt;/p&gt;<br>          &lt;/div&gt;<br>        &lt;/div&gt;<br><br>        {plan!=null &amp;&amp; &lt;Membership /&gt;}<br><br>        &lt;div className=&quot;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&quot;&gt;<br>          {plan!=null &amp;&amp; &lt;h4 className=&quot;text-lg text-[gray]&quot;&gt;Plan Name:&lt;/h4&gt;}<br>          {/* Find the current plan */}<br>          {plan!=null &amp;&amp; &lt;div className=&quot;col-span-2 font-medium&quot;&gt;<br>            {plan.name}<br>          &lt;/div&gt;}<br>          &lt;button onClick={() =&gt; setShowPlan(true)} className=&quot;cursor-pointer flex flex-1 text-blue-500 hover:underline md:text-right&quot;&gt;<br>            Change plan<br>          &lt;/button&gt;<br>        &lt;/div&gt;<br><br>        &lt;div className=&quot;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&quot;&gt;<br>          &lt;h4 className=&quot;text-lg text-[gray]&quot;&gt;Settings&lt;/h4&gt;<br>          &lt;p<br>            className=&quot;col-span-3 cursor-pointer text-blue-500 hover:underline&quot;<br>            onClick={logout}<br>          &gt;<br>            Sign out<br>          &lt;/p&gt;<br>        &lt;/div&gt;<br>      &lt;/main&gt;<br>    &lt;/div&gt;<br>  )<br>}<br><br>export default Page</pre><p>One thing I missed in my last article was that the <em>tailwind.config.js</em> file needed to be changed.</p><pre>/** @type {import(&#39;tailwindcss&#39;).Config} */<br>module.exports = {<br>  content: [<br>    &#39;./pages/**/*.{js,ts,jsx,tsx,mdx}&#39;,<br>    &#39;./components/**/*.{js,ts,jsx,tsx,mdx}&#39;,<br>    &#39;./app/**/*.{js,ts,jsx,tsx,mdx}&#39;,<br>  ],<br>  theme: {<br>    extend: {<br>      backgroundImage: {<br>        &#39;gradient-to-b&#39;:<br>          &#39;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%);&#39;,<br>      },<br>    },<br>  },<br>  plugins: [],<br>}</pre><h3>Conclusion</h3><p>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.</p><p><em>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 Medium. If you missed anything or want to </em><a href="https://github.com/abhirupkumar/Netflix-Clone"><em>check out the full code here</em></a><em>. Here is the </em><a href="https://medium.com/@abhirupkumar2003/building-netflix-clone-with-nextjs-13-4-part-1-1c1d3661644a"><em>part 1</em></a><em> of the blog.Thanks for reading!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb3263063d1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Netflix Clone with NextJs 13.4: Part 1]]></title>
            <link>https://medium.com/@abhirupkumar2003/building-netflix-clone-with-nextjs-13-4-part-1-1c1d3661644a?source=rss-d84f55f6ca33------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c1d3661644a</guid>
            <category><![CDATA[ott]]></category>
            <category><![CDATA[netflix]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[nextjs-13]]></category>
            <dc:creator><![CDATA[Abhirup Kumar Bhowmick]]></dc:creator>
            <pubDate>Sun, 23 Jul 2023 14:55:14 GMT</pubDate>
            <atom:updated>2023-07-29T14:22:42.281Z</atom:updated>
            <content:encoded><![CDATA[<h4>NextJs 13, React, Tailwind CSS, Firebase, Razorpay.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9RQjGX9rUSFbU4NSTH6cyQ.png" /><figcaption>Netflix Clone</figcaption></figure><p>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.</p><p><strong>Github Link:</strong> <a href="https://github.com/abhirupkumar/Netflix-Clone/">https://github.com/abhirupkumar/Netflix-Clone</a></p><p><strong>Project Link:</strong> <a href="https://netflix-akb.vercel.app/">https://netflix-akb.vercel.app</a></p><h3>Prerequisites</h3><p>Knowledge of Html, Css, Js ,React and Nextjs.</p><h3>Getting started</h3><p>Open your terminal and paste the below command to create the project.</p><pre>npx create-next-app@latest</pre><p>Follow these steps for installation:</p><pre>What is your project named? netflix-clone<br>Would you like to use TypeScript? Yes<br>Would you like to use ESLint? No<br>Would you like to use Tailwind CSS? Yes<br>Would you like to use `src/` directory? No<br>Would you like to use App Router? (recommended) Yes<br>Would you like to customize the default import alias? No</pre><p>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.</p><pre>npx install @emotion/react @emotion/styled @mui/material firebase razorpay react-hook-form react-hot-toast react-<br>icons react-player recoil</pre><p>Now go to <strong>https://www.themoviedb.org/ </strong>and Login/Sign Up. We will be using the TMDB API to get all the movies. Then go to <a href="https://www.themoviedb.org/settings/api"><strong>https://www.themoviedb.org/settings/api</strong></a> and get your API key. Create a .env.local file and paste your API key their.</p><pre>NEXT_PUBLIC_API_KEY=**********************</pre><p>Now open a merchant account in Razorpay, get the merchant key and secret from your dashboard, and paste them in the .env.local.</p><pre>RAZORPAY_KEY=****************<br>RAZORPAY_SECRET=****************</pre><p>Before diving in Typescript code, write the following in global.css file.</p><pre>@tailwind base;<br>@tailwind components;<br>@tailwind utilities;<br><br>/* :root {<br>  --foreground-rgb: 0, 0, 0;<br>  --background-start-rgb: 214, 219, 220;<br>  --background-end-rgb: 255, 255, 255;<br>} */<br><br>@media (prefers-color-scheme: dark) {<br>  /* :root {<br>    --foreground-rgb: 255, 255, 255;<br>    --background-start-rgb: 0, 0, 0;<br>    --background-end-rgb: 0, 0, 0;<br>  } */<br>}<br><br>body {<br>  overflow-x: hidden;<br>  /* color: rgb(var(--foreground-rgb));<br>  background: linear-gradient(<br>      to bottom,<br>      transparent,<br>      rgb(var(--background-end-rgb))<br>    )<br>    rgb(var(--background-start-rgb)); */<br>}<br><br>::-webkit-scrollbar {<br>  width: 8px;<br>}<br><br>/* Track */<br>::-webkit-scrollbar-track {<br>  background: transparent;<br>}<br><br>/* Handle */<br>::-webkit-scrollbar-thumb {<br>  background: #222222;<br>}<br><br>/* Handle on hover */<br>::-webkit-scrollbar-thumb:hover {<br>  background: #363636;<br>}<br><br>.no-scrollbar::-webkit-scrollbar {<br>  display: none;<br>}<br><br>/* Hide scrollbar for IE, Edge and Firefox */<br>.no-scrollbar {<br>  -ms-overflow-style: none;  /* IE and Edge */<br>  scrollbar-width: none;  /* Firefox */<br>}<br><br>@layer base {<br>  body {<br>    @apply bg-[#141414] text-white;<br>  }<br><br>  header {<br>    @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;<br>  }<br>}<br><br>/* custom classNames */<br>@layer components {<br>  .headerLink {<br>    @apply cursor-pointer text-sm font-semibold text-white transition duration-[.4s] hover:text-[#d6d6d6];<br>  }<br><br>  .bannerButton {<br>    @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;<br>  }<br><br>  .input {<br>    @apply w-full rounded bg-[#333] px-5 py-3.5 placeholder-[gray] outline-none focus:bg-[#454545];<br>  }<br><br>  .modalButton {<br>    @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;<br>  }<br><br>  .planBox {<br>    @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-[&quot;&quot;] md:h-32 lg:mx-8;<br>  }<br><br>  /* Table */<br>  .tableRow {<br>    @apply flex flex-wrap items-center font-medium;<br>  }<br><br>  .tableDataTitle {<br>    @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;<br>  }<br><br>  .tableDataFeature {<br>    @apply w-[calc(100%/4)] p-2.5 text-center md:w-[calc(60%/4)] md:p-3.5;<br>  }<br><br>  .membershipLink {<br>    @apply cursor-pointer text-blue-500 hover:underline;<br>  }<br><br>  /* MUI Menu */<br>  .menu {<br>    @apply md:hidden;<br>  }<br><br>  .menu .MuiPaper-root {<br>    @apply !absolute !left-0 !rounded-none !border !border-[gray] !bg-black !text-white;<br>  }<br><br>  .menu .MuiList-root {<br>    @apply !p-0;<br>  }<br><br>  .menu .MuiMenuItem-root {<br>    @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];<br>  }<br>}<br><br>.lds-ripple {<br>  display: inline-block;<br>  position: relative;<br>  width: 80px;<br>  height: 80px;<br>  justify-content: center;<br>  align-items: center;<br>}<br>.lds-ripple div {<br>  position: absolute;<br>  border: 4px solid #ffffff;<br>  opacity: 1;<br>  border-radius: 50%;<br>  animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;<br>}<br>.lds-ripple div:nth-child(2) {<br>  animation-delay: -0.5s;<br>}<br>@keyframes lds-ripple {<br>  0% {<br>    top: 36px;<br>    left: 36px;<br>    width: 0;<br>    height: 0;<br>    opacity: 0;<br>  }<br>  4.9% {<br>    top: 36px;<br>    left: 36px;<br>    width: 0;<br>    height: 0;<br>    opacity: 0;<br>  }<br>  5% {<br>    top: 36px;<br>    left: 36px;<br>    width: 0;<br>    height: 0;<br>    opacity: 1;<br>  }<br>  100% {<br>    top: 0px;<br>    left: 0px;<br>    width: 72px;<br>    height: 72px;<br>    opacity: 0;<br>  }<br>}</pre><p>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.</p><pre>&quot;use server&quot;;<br><br>import requests from &quot;@/utils/requests&quot;;<br><br>export const fetchAllData = async () =&gt; {<br>  const [<br>    netflixOriginals,<br>    trendingNow,<br>    topRated,<br>    actionMovies,<br>    comedyMovies,<br>    horrorMovies,<br>    romanceMovies,<br>    documentaries,<br>  ] = await Promise.all([<br>    fetch(requests.fetchNetflixOriginals).then((res) =&gt; res.json()),<br>    fetch(requests.fetchTrending).then((res) =&gt; res.json()),<br>    fetch(requests.fetchTopRated).then((res) =&gt; res.json()),<br>    fetch(requests.fetchActionMovies).then((res) =&gt; res.json()),<br>    fetch(requests.fetchComedyMovies).then((res) =&gt; res.json()),<br>    fetch(requests.fetchHorrorMovies).then((res) =&gt; res.json()),<br>    fetch(requests.fetchRomanceMovies).then((res) =&gt; res.json()),<br>    fetch(requests.fetchDocumentaries).then((res) =&gt; res.json()),<br>  ]);<br><br>  return {<br>    netflixOriginals: netflixOriginals.results,<br>    trendingNow: trendingNow.results,<br>    topRated: topRated.results,<br>    actionMovies: actionMovies.results,<br>    comedyMovies: comedyMovies.results,<br>    horrorMovies: horrorMovies.results,<br>    romanceMovies: romanceMovies.results,<br>    documentaries: documentaries.results,<br>  };<br>};</pre><p>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.</p><pre>// Import the functions you need from the SDKs you need<br>import { initializeApp } from &quot;firebase/app&quot;;<br>// TODO: Add SDKs for Firebase products that you want to use<br>// https://firebase.google.com/docs/web/setup#available-libraries<br><br>// Your web app&#39;s Firebase configuration<br>const firebaseConfig = {<br>  apiKey: &quot;**************************************&quot;,<br>  authDomain: &quot;*******************.firebaseapp.com&quot;,<br>  projectId: &quot;*******************&quot;,<br>  storageBucket: &quot;*******************.appspot.com&quot;,<br>  messagingSenderId: &quot;*************&quot;,<br>  appId: &quot;*:*************:web:*****************&quot;<br>};<br><br>// Initialize Firebase<br>const app = initializeApp(firebaseConfig);</pre><p>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.</p><p>Create a constants folder outside of the app directory and create an app.tsx file and a movie.ts file in that folder.</p><pre>// movie.ts<br><br>export const baseUrl = &#39;https://image.tmdb.org/t/p/original/&#39;;</pre><pre>//App.tsx<br><br>&quot;use client&quot;;<br><br>import React from &#39;react&#39;<br>import { RecoilRoot } from &#39;recoil&#39;<br><br>const App = ({<br>    children,<br>  }: {<br>    children: React.ReactNode<br>  }) =&gt; {<br>  return (<br>    &lt;html lang=&quot;en&quot;&gt;<br>      &lt;body&gt;<br>        &lt;RecoilRoot&gt;<br>          {children}<br>        &lt;/RecoilRoot&gt;<br>      &lt;/body&gt;<br>    &lt;/html&gt;<br>  )<br>}<br><br>export default App;</pre><p>In the app folder, change the code for layout.tsx to the following:</p><pre>import &#39;./globals.css&#39;<br>import type { Metadata } from &#39;next&#39;<br>import App from &#39;@/constants/App&#39;;<br><br>export const metadata: Metadata = {<br>  title: &#39;NETFLIX&#39;,<br>  description: &#39;Watch your favorite movies and TV shows on Netflix.&#39;,<br>}<br><br>export default function RootLayout({<br>  children,<br>}: {<br>  children: React.ReactNode<br>}) {<br>  return (<br>    &lt;App children={children} /&gt;<br>  )<br>}</pre><p>Outside of app firectory create typings.d.ts file.</p><pre>// typings.d.ts<br><br>export interface Genre {<br>    id: number<br>    name: string<br>  }<br><br>  export interface Plan {<br>    id: string<br>    name: string<br>    amount: number<br>    description: string<br>    videoQuality: string<br>    resolution: string<br>  }<br>  <br>  export interface Movie {<br>    title: string<br>    backdrop_path: string<br>    media_type?: string<br>    release_date?: string<br>    first_air_date: string<br>    genre_ids: number[]<br>    id: number<br>    name: string<br>    origin_country: string[]<br>    original_language: string<br>    original_name: string<br>    overview: string<br>    popularity: number<br>    poster_path: string<br>    vote_average: number<br>    vote_count: number<br>  }<br>  <br>  export interface Element {<br>    type:<br>      | &#39;Bloopers&#39;<br>      | &#39;Featurette&#39;<br>      | &#39;Behind the Scenes&#39;<br>      | &#39;Clip&#39;<br>      | &#39;Trailer&#39;<br>      | &#39;Teaser&#39;<br>  }</pre><p>Now create an atoms folder outside of the app directory. The atoms folder will contain only one file, modalAtom.ts, which contains the following:</p><pre>import { DocumentData } from &#39;firebase/firestore&#39;<br>import { atom } from &#39;recoil&#39;<br>import { Movie } from &#39;../typings&#39;<br><br>export const modalState = atom({<br>  key: &#39;modalState&#39;,<br>  default: false,<br>})<br><br>export const movieState = atom&lt;Movie | DocumentData | null&gt;({<br>  key: &#39;movieState&#39;,<br>  default: null,<br>})</pre><p>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.</p><pre>// data.ts<br><br>const plan = [<br>    {<br>        id: &quot;netflix-plan-1-mobile&quot;,<br>        name: &quot;Mobile&quot;,<br>        amount: 149,<br>        description: &quot;Watch on your mobile phone and tablet&quot;,<br>        videoQuality: &quot;Average&quot;,<br>        resolution: &quot;480p&quot;<br>    },<br>    {<br>        id: &quot;netflix-plan-2-basic&quot;,<br>        name: &quot;Basic&quot;,<br>        amount: 199,<br>        description: &quot;Watch on your TV, computer, mobile phone and tablet&quot;,<br>        videoQuality: &quot;Good&quot;,<br>        resolution: &quot;720p&quot;<br>    },<br>    {<br>        id: &quot;netflix-plan-3-standard&quot;,<br>        name: &quot;Standard&quot;,<br>        amount: 499,<br>        description: &quot;Watch on your TV, computer, mobile phone and tablet&quot;,<br>        videoQuality: &quot;Great&quot;,<br>        resolution: &quot;720p&quot;<br>    },<br>    {<br>        id: &quot;netflix-plan-4-premium&quot;,<br>        name: &quot;Premium&quot;,<br>        amount: 649,<br>        description: &quot;Watch on your TV, computer, mobile phone and tablet&quot;,<br>        videoQuality: &quot;Best&quot;,<br>        resolution: &quot;720p&quot;<br>    },<br>]<br><br>export default plan</pre><pre>// requests.ts<br><br>const API_KEY = process.env.NEXT_PUBLIC_API_KEY<br>const BASE_URL = &#39;https://api.themoviedb.org/3&#39;<br><br>const requests = {<br>  fetchTrending: `${BASE_URL}/trending/all/week?api_key=${API_KEY}&amp;language=en-IN`,<br>  fetchNetflixOriginals: `${BASE_URL}/discover/movie?api_key=${API_KEY}&amp;with_networks=213`,<br>  fetchTopRated: `${BASE_URL}/movie/top_rated?api_key=${API_KEY}&amp;language=en-IN`,<br>  fetchActionMovies: `${BASE_URL}/discover/movie?api_key=${API_KEY}&amp;language=en-IN&amp;with_genres=28`,<br>  fetchComedyMovies: `${BASE_URL}/discover/movie?api_key=${API_KEY}&amp;language=en-IN&amp;with_genres=35`,<br>  fetchHorrorMovies: `${BASE_URL}/discover/movie?api_key=${API_KEY}&amp;language=en-IN&amp;with_genres=27`,<br>  fetchRomanceMovies: `${BASE_URL}/discover/movie?api_key=${API_KEY}&amp;language=en-IN&amp;with_genres=10749`,<br>  fetchDocumentaries: `${BASE_URL}/discover/movie?api_key=${API_KEY}&amp;language=en-IN&amp;with_genres=99`,<br>}<br><br>export default requests</pre><p>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.</p><p><em>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 Medium. If you missed anything or want to </em><a href="https://github.com/abhirupkumar/Netflix-Clone"><em>check out the full code here</em></a><em>. Thanks for reading!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c1d3661644a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Mobile Search Engine Using Next.Js 13]]></title>
            <link>https://medium.com/@abhirupkumar2003/build-a-mobile-search-engine-using-next-js-13-95dbed7e3f98?source=rss-d84f55f6ca33------2</link>
            <guid isPermaLink="false">https://medium.com/p/95dbed7e3f98</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[nextjs-13]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[tailwind-css]]></category>
            <dc:creator><![CDATA[Abhirup Kumar Bhowmick]]></dc:creator>
            <pubDate>Thu, 06 Jul 2023 16:14:05 GMT</pubDate>
            <atom:updated>2023-07-06T16:14:05.896Z</atom:updated>
            <content:encoded><![CDATA[<h4>A quick guide to building your own mobile search engine using Next.js 13</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oGkU1wbv9XXrjoO1t4XPfA.png" /><figcaption>Mobile Search Engine</figcaption></figure><p>Have you gone through all of NextJS 13’s features? It has evolved significantly and is now better than ever. If you’re having trouble building a website using Next.js 13, you’ve come to the right spot. In this article, I’m going to show you how to use Next.js 13 with Tailwind CSS to create a completely responsive mobile search engine.</p><p>Project: <a href="https://mobwiki.vercel.app/">https://mobwiki.vercel.app</a></p><p>Github: <a href="https://github.com/abhirupkumar/mobwiki">https://github.com/abhirupkumar/mobwiki</a></p><p><a href="https://mobwiki.vercel.app/">MOBWiKi</a></p><h3>Getting Started with Next.Js 13</h3><p>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.</p><pre>npx create-next-app@latest mobwiki</pre><p>Create the project in the following way:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*LCbGiUEEmaX2-Slp0p04Hg.png" /><figcaption>Install the project in this way.</figcaption></figure><p>Your project will look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ngF0yUdOCeKSyKAuG9NVKA.png" /></figure><p>Now as you can see, open the terminal and run</p><pre>npm run dev</pre><p>Open your browser and search <a href="http://localhost:3000/">http://localhost:3000/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fUPT8Js8VRp6mGrSAAv2zQ.png" /><figcaption>Sample Next.js Page</figcaption></figure><p>Run the follow command in the terminal.</p><pre>npm install @emotion/react @emotion/styled @mui/material react-alice-carousel react-icons</pre><p>Now that the setup part is complete, let’s start building the website.</p><h3>Let the game begin</h3><p>First, delete all the contents of global.css and paste this code there.</p><pre>@tailwind base;<br>@tailwind components;<br>@tailwind utilities;<br><br>.prodimg-border{<br>  border-top-left-radius: 15px;<br>  border-top-right-radius: 15px;<br>}<br><br>.prod-sideimg{<br>  box-shadow: 0px 0px 2px;<br>  border-radius: 10px;<br>}<br><br>.prod-shadow {<br>  box-shadow: 0px 0px 2.5px;<br>  border-radius: 15px;<br>}<br><br>.lds-ripple {<br>  display: inline-block;<br>  position: relative;<br>  width: 80px;<br>  height: 80px;<br>}<br>.lds-ripple div {<br>  position: absolute;<br>  border: 4px solid #858585;<br>  opacity: 1;<br>  border-radius: 50%;<br>  animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;<br>}<br>.lds-ripple div:nth-child(2) {<br>  animation-delay: -0.5s;<br>}<br>@keyframes lds-ripple {<br>  0% {<br>    top: 36px;<br>    left: 36px;<br>    width: 0;<br>    height: 0;<br>    opacity: 0;<br>  }<br>  4.9% {<br>    top: 36px;<br>    left: 36px;<br>    width: 0;<br>    height: 0;<br>    opacity: 0;<br>  }<br>  5% {<br>    top: 36px;<br>    left: 36px;<br>    width: 0;<br>    height: 0;<br>    opacity: 1;<br>  }<br>  100% {<br>    top: 0px;<br>    left: 0px;<br>    width: 72px;<br>    height: 72px;<br>    opacity: 0;<br>  }<br>}</pre><p>Now create twofolders: utils, and components, just like mentioned in the below image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Ewh92uls2o0_emeL_Jp1w.png" /><figcaption>Format of all the folders</figcaption></figure><p>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.</p><p>Download Link: <a href="https://github.com/abhirupkumar/mobwiki-starter-utils">https://github.com/abhirupkumar/mobwiki-starter-utils</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lerDEoacDrHeVukLvnf46A.png" /><figcaption>Format of the folder</figcaption></figure><p>Now set serverActions to true in next.config.js</p><pre>/** @type {import(&#39;next&#39;).NextConfig} */<br>const nextConfig = {<br>    experimental: {<br>        serverActions: true,<br>    }<br>}<br><br>module.exports = nextConfig</pre><p>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.</p><pre>&quot;use server&quot;;<br><br>import { redirect } from &quot;next/navigation&quot;;<br><br>export async function handleSearch(formData) {<br>    const value = formData.get(&quot;search&quot;);<br>    redirect(`/search?query=${value}`);<br>}<br><br>export async function handleData(dataJson, val, pageNos, order, tag) {<br>    const search_value = val.toLowerCase().split(&quot; &quot;);<br>    var newData = [];<br>    for (let i = 0; i &lt; dataJson.length; i++) {<br>        let chk = true;<br>        for (let j = 0; j &lt; search_value.length; j++) {<br>            if (!dataJson[i].name.toLowerCase().includes(search_value[j])) {<br>                chk = false;<br>                break;<br>            }<br>        }<br>        if (chk) {<br>            newData.push(dataJson[i]);<br>        }<br>    }<br><br>    if (order != null) {<br>        newData = await SortDataByTag(order, tag, newData);<br>    }<br><br>    let page = 1;<br>    if (pageNos != null) page = parseInt(pageNos);<br><br>    const productsPerPage = 15;<br>    const startIndex = (page - 1) * productsPerPage;<br>    const endIndex = startIndex + productsPerPage;<br>    const totalPages = Math.ceil(newData.length / productsPerPage);<br><br>    const data = newData.slice(startIndex, endIndex);<br><br>    return { data, page, totalPages }<br>}<br><br>export async function SortDataByTag(order, tag, data) {<br>    if (order === &quot;asc&quot;) {<br>        data.sort((a, b) =&gt; {<br>            if (tag === &quot;price&quot;) {<br>                let pa = a.price.replace(&#39;.&#39;, &quot;&quot;).replace(&#39;,&#39;, &quot;&quot;).replace(&#39; &#39;, &quot;&quot;)<br>                let intpa = parseInt(pa);<br>                let pb = b.price.replace(&#39;.&#39;, &quot;&quot;).replace(&#39;,&#39;, &quot;&quot;).replace(&#39; &#39;, &quot;&quot;)<br>                let intpb = parseInt(pb);<br>                return intpa - intpb;<br>            }<br>            else {<br>                let sa = parseFloat(a.stars)<br>                let sb = parseFloat(b.stars)<br>                return sa - sb;<br>            }<br>        })<br>    }<br>    else {<br>        data.sort((a, b) =&gt; {<br>            if (tag === &quot;price&quot;) {<br>                let pa = a.price.replace(&#39;.&#39;, &quot;&quot;).replace(&#39;,&#39;, &quot;&quot;).replace(&#39; &#39;, &quot;&quot;)<br>                let intpa = parseInt(pa);<br>                let pb = b.price.replace(&#39;.&#39;, &quot;&quot;).replace(&#39;,&#39;, &quot;&quot;).replace(&#39; &#39;, &quot;&quot;)<br>                let intpb = parseInt(pb);<br>                return intpb - intpa;<br>            }<br>            else {<br>                let sa = parseFloat(a.stars)<br>                let sb = parseFloat(b.stars)<br>                return sb - sa;<br>            }<br>        })<br>    }<br><br>    return data;<br>}</pre><p>Now, create Header.js file in the components folder and paste the following code.</p><pre>&quot;use client&quot;;<br>import Link from &quot;next/link&quot;;<br>import React, { useState } from &quot;react&quot;;<br><br>export default function Header() {<br>    const [navbarOpen, setNavbarOpen] = useState(false);<br><br>    return (<br>        &lt;div className=&quot;fixed top-0 w-full z-30 clearNav bg-opacity-90 transition duration-300 ease-in-out bg-white&quot;&gt;<br>            &lt;div className=&quot;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&quot;&gt;<br>                &lt;div className=&quot;flex flex-row items-center justify-between p-4&quot;&gt;<br>                    &lt;Link<br>                        href=&quot;/&quot;<br>                        className=&quot;text-lg font-semibold rounded-lg tracking-widest focus:outline-none focus:shadow-outline&quot;<br>                    &gt;<br>                        &lt;h1 className=&quot;text-4xl Avenir tracking-tighter text-gray-900 md:text-4x1 lg:text-3xl&quot;&gt;<br>                            MOBWiKi<br>                        &lt;/h1&gt;<br>                    &lt;/Link&gt;<br>                    &lt;button<br>                        className=&quot;text-white cursor-pointer leading-none px-3 py-1 md:hidden outline-none focus:outline-none &quot;<br>                        type=&quot;button&quot;<br>                        aria-label=&quot;button&quot;<br>                        onClick={() =&gt; setNavbarOpen(!navbarOpen)}<br>                    &gt;<br>                        &lt;svg<br>                            xmlns=&quot;http://www.w3.org/2000/svg&quot;<br>                            width=&quot;24&quot;<br>                            height=&quot;24&quot;<br>                            viewBox=&quot;0 0 24 24&quot;<br>                            fill=&quot;none&quot;<br>                            stroke=&quot;#191919&quot;<br>                            strokeWidth=&quot;2&quot;<br>                            strokeLinecap=&quot;round&quot;<br>                            strokeLinejoin=&quot;round&quot;<br>                            className=&quot;feather feather-menu&quot;<br>                        &gt;<br>                            &lt;line x1=&quot;3&quot; y1=&quot;12&quot; x2=&quot;21&quot; y2=&quot;12&quot;&gt;&lt;/line&gt;<br>                            &lt;line x1=&quot;3&quot; y1=&quot;6&quot; x2=&quot;21&quot; y2=&quot;6&quot;&gt;&lt;/line&gt;<br>                            &lt;line x1=&quot;3&quot; y1=&quot;18&quot; x2=&quot;21&quot; y2=&quot;18&quot;&gt;&lt;/line&gt;<br>                        &lt;/svg&gt;<br>                    &lt;/button&gt;<br>                &lt;/div&gt;<br>                &lt;div<br>                    className={<br>                        &quot;md:flex flex-grow items-center&quot; +<br>                        (navbarOpen ? &quot; flex&quot; : &quot; hidden&quot;)<br>                    }<br>                &gt;<br>                    &lt;nav className=&quot;flex-col flex-grow &quot;&gt;<br>                        &lt;ul className=&quot;flex flex-grow justify-end flex-wrap items-center&quot;&gt;<br>                            &lt;li&gt;<br>                                &lt;Link<br>                                    href=&quot;/&quot;<br>                                    className=&quot;font-medium text-gray-600 hover:text-gray-900 px-5 py-3 flex items-center transition duration-150 ease-in-out&quot;<br>                                &gt;<br>                                    Mobiles<br>                                &lt;/Link&gt;<br>                            &lt;/li&gt;<br>                        &lt;/ul&gt;<br>                    &lt;/nav&gt;<br>                &lt;/div&gt;<br>            &lt;/div&gt;<br>        &lt;/div&gt;<br>    );<br>}</pre><p>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.</p><pre>&quot;use client&quot;;<br><br>import React, { useEffect, useState } from &#39;react&#39;;<br>import AliceCarousel from &#39;react-alice-carousel&#39;;<br>import &quot;react-alice-carousel/lib/alice-carousel.css&quot;;<br>import dataJson from &#39;../utils/data.json&#39;;<br>import Link from &#39;next/link&#39;;<br>import { RiArrowLeftSLine, RiArrowRightSLine } from &#39;react-icons/ri&#39;<br>import { AiFillStar } from &#39;react-icons/ai&#39;<br><br>const responsive = {<br>    2000: {<br>        items: 5,<br>    },<br>    1316: {<br>        items: 4,<br>    },<br>    880: {<br>        items: 3,<br>    },<br>    300: {<br>        items: 2,<br>    },<br>    0: {<br>        items: 1,<br>    }<br>};<br><br>const MobileSlider = () =&gt; {<br><br>    const [data, setData] = useState([])<br>    useEffect(() =&gt; {<br>        setData(dataJson)<br>    }, [])<br><br>    const renderNextButton = ({ isDisabled }) =&gt; {<br>        return &lt;RiArrowRightSLine className=&quot;cursor-pointer h-10 w-10 absolute right-0 top-[45%]&quot; /&gt;<br>    };<br><br>    const renderPrevButton = ({ isDisabled }) =&gt; {<br>        return &lt;RiArrowLeftSLine className=&quot;cursor-pointer h-10 w-10 absolute left-0 top-[45%]&quot; /&gt;<br>    };<br><br>    return (<br>        &lt;div className=&quot;flex flex-wrap w-full my-20 flex-col items-center text-center&quot;&gt;<br>            {data.length &gt; 0 ? &lt;AliceCarousel<br>                responsive={responsive}<br>                mouseTracking<br>                infinite<br>                controlsStrategy={&quot;default&quot;}<br>                autoPlayStrategy=&#39;all&#39;<br>                autoPlayInterval={1000}<br>                disableDotsControls<br>                keyboardNavigation<br>                style={{<br>                    width: &quot;100%&quot;,<br>                    justifyContent: &quot;center&quot;,<br>                }}<br>                renderPrevButton={renderPrevButton}<br>                renderNextButton={renderNextButton}&gt;<br>                {data.length &gt; 0 &amp;&amp; data.map((index, item) =&gt; {<br>                    const rawstars = data[item]?.stars<br>                    const stars = rawstars.substring(0, rawstars.indexOf(&quot; &quot;));<br>                    return &lt;div key={index} className=&quot;lg:w-[310px] md:w[250px] prod-shadow  lg:h-auto cursor-pointer m-2&quot;&gt;<br>                        &lt;Link href={data[item]?.url} rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot;&gt;<br>                            &lt;div className=&quot;flex justify-center md:h-[380px] h-[200px] relative overflow-hidden&quot;&gt;<br>                                &lt;img alt=&quot;ecommerce&quot; className=&quot;m-auto md:m-0 md:h-[380px] h-[200px] prodimg-border block&quot; src={data[item]?.image_src} loading=&#39;lazy&#39; /&gt;<br>                            &lt;/div&gt;<br>                            &lt;div className=&quot;text-center mx-[10px] md:text-justify flex flex-col lg:h-[195px] h-[162px] justify-evenly&quot;&gt;<br>                                &lt;h3 className=&quot;text-gray-500 mx-auto text-xs tracking-widest title-font&quot;&gt;AMAZON&lt;/h3&gt;<br>                                &lt;h2 className=&quot;text-gray-900 mx-auto text-left title-font lg:text-[15px] text-[0.63rem] font-medium&quot;&gt;{data[item]?.name}&lt;/h2&gt;<br>                                &lt;div className=&quot;mt-1 flex space-x-8&quot;&gt;<br>                                    &lt;p className=&quot;text-left text-black font-semibold md:text-base text-xs&quot;&gt;₹ {data[item]?.price}&lt;/p&gt;<br>                                    &lt;div className=&quot;flex items-center space-x-2&quot;&gt;<br>                                        &lt;p className=&quot;text-black items-center flex font-semibold md:text-base text-xs&quot;&gt;{stars} &lt;AiFillStar className=&quot;text-yellow-400&quot; /&gt;&lt;/p&gt;<br>                                        &lt;div className=&quot;text-sm font-medium text-gray-900 md:block hidden underline hover:no-underline dark:text-white&quot;&gt;{data[item]?.rating}&lt;/div&gt;<br>                                    &lt;/div&gt;<br>                                &lt;/div&gt;<br>                            &lt;/div&gt;<br>                        &lt;/Link&gt;<br>                    &lt;/div&gt;<br>                })}<br>            &lt;/AliceCarousel&gt;<br>                :<br>                &lt;div className=&quot;lds-ripple&quot;&gt;<br>                    &lt;div&gt;&lt;/div&gt;<br>                    &lt;div&gt;&lt;/div&gt;<br>                &lt;/div&gt;}<br>        &lt;/div&gt;<br>    )<br>}<br><br>export default MobileSlider</pre><p>Create the SliderPage.js file in the components folder.</p><pre>&quot;use client&quot;;<br><br>import React from &#39;react&#39;;<br>import AliceCarousel from &#39;react-alice-carousel&#39;;<br>import &quot;react-alice-carousel/lib/alice-carousel.css&quot;;<br>import { RiArrowLeftSLine, RiArrowRightSLine } from &#39;react-icons/ri&#39;;<br><br>const SliderPage = () =&gt; {<br><br>    const renderNextButton = ({ isDisabled }) =&gt; {<br>        return &lt;RiArrowRightSLine className=&quot;cursor-pointer h-12 w-12 absolute right-0 top-[45%]&quot; /&gt;<br>    };<br><br>    const renderPrevButton = ({ isDisabled }) =&gt; {<br>        return &lt;RiArrowLeftSLine className=&quot;cursor-pointer h-12 w-12 absolute left-0 top-[45%]&quot; /&gt;<br>    };<br><br>    return (<br>        &lt;div className=&#39;max-w-[1300px] w-full mx-auto&#39;&gt;<br>            &lt;AliceCarousel<br>                autoPlay={true}<br>                playButtonEnabled={true}<br>                infinite={true}<br>                autoPlayInterval={4000}<br>                renderPrevButton={renderPrevButton}<br>                renderNextButton={renderNextButton}&gt;<br>                &lt;img alt=&quot;banner1&quot; src=&quot;./assets/img1.jpg&quot; className=&#39;rounded-xl&#39; loading=&quot;lazy&quot; /&gt;<br>                &lt;img alt=&quot;banner2&quot; src=&quot;./assets/img2.jpg&quot; className=&#39;rounded-xl&#39; loading=&quot;lazy&quot; /&gt;<br>                &lt;img alt=&quot;banner3&quot; src=&quot;./assets/img3.jpg&quot; className=&#39;rounded-xl&#39; loading=&quot;lazy&quot; /&gt;<br>                &lt;img alt=&quot;banner4&quot; src=&quot;./assets/img4.jpg&quot; className=&#39;rounded-xl&#39; loading=&quot;lazy&quot; /&gt;<br>            &lt;/AliceCarousel&gt;<br><br>        &lt;/div&gt;<br>    )<br>}<br><br>export default SliderPage</pre><p>Create the PagenationPart.js file in the components folder. This is only the pagination part.</p><pre>&quot;use client&quot;;<br><br>import { Pagination } from &#39;@mui/material&#39;<br>import { useRouter } from &#39;next/navigation&#39;;<br>import React from &#39;react&#39;<br><br>const PagenationPart = ({ query, page, totalPages }) =&gt; {<br><br>    const router = useRouter()<br><br>    const handlePageChange = (event, value) =&gt; {<br>        router.push(`/search?query=${query}&amp;page=${value}`)<br>    }<br><br>    return (<br>        &lt;div className=&#39;my-10&#39;&gt;<br>            &lt;Pagination<br>                count={totalPages}<br>                page={page}<br>                onChange={handlePageChange}<br>                variant=&quot;outlined&quot; color=&quot;primary&quot;<br>            /&gt;<br>        &lt;/div&gt;<br>    )<br>}<br><br>export default PagenationPart</pre><p>Create the Table.js file in the components folder.</p><pre>&quot;use client&quot;<br><br>import Link from &#39;next/link&#39;;<br>import { useRouter } from &#39;next/navigation&#39;;<br>import React, { useEffect, useState } from &#39;react&#39;<br>import { AiFillStar } from &#39;react-icons/ai&#39;;<br>import { RiArrowDownSFill, RiArrowUpSFill } from &#39;react-icons/ri&#39;;<br><br>const Table = ({ query, page, data }) =&gt; {<br><br>    const router = useRouter();<br><br>    const handleSort = (order, tag) =&gt; {<br>        var newlink = `/search?query=${query}`<br>        if (page != null)<br>            newlink += `&amp;page=${page}`<br>        newlink += `&amp;order=${order}&amp;tag=${tag}`<br>        router.push(newlink);<br>    }<br><br>    return (<br>        &lt;div className=&quot;overflow-x-auto md:px-12 px-2&quot;&gt;<br>            &lt;table className=&quot;w-full text-sm text-left text-gray-500 dark:text-gray-400&quot;&gt;<br>                &lt;thead className=&quot;text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400&quot;&gt;<br>                    &lt;tr&gt;<br>                        &lt;th scope=&quot;col&quot; className=&quot;px-6 py-3 w-[10rem]&quot;&gt;<br>                            Image<br>                        &lt;/th&gt;<br>                        &lt;th scope=&quot;col&quot; className=&quot;px-6 py-3 w-[22rem]&quot;&gt;<br>                            Product Name<br>                        &lt;/th&gt;<br>                        &lt;th scope=&quot;col&quot; className=&quot;px-6 py-3&quot;&gt;<br>                            Site<br>                        &lt;/th&gt;<br>                        &lt;th scope=&quot;col&quot; className=&quot;px-6 py-3&quot;&gt;<br>                            &lt;div className=&quot;flex justify-center items-center&quot;&gt;<br>                                Star<br>                                &lt;div className=&#39;flex flex-col items-center&#39;&gt;<br>                                    &lt;button className=&#39;text-[16px] -mb-[10px]&#39; onClick={() =&gt; handleSort(&quot;asc&quot;, &quot;star&quot;)}&gt;<br>                                        &lt;RiArrowUpSFill value=&quot;asc-price&quot; /&gt;<br>                                    &lt;/button&gt;<br>                                    &lt;button className=&#39;text-[16px]&#39; onClick={() =&gt; handleSort(&quot;desc&quot;, &quot;star&quot;)} &gt;<br>                                        &lt;RiArrowDownSFill value=&quot;desc-price&quot; /&gt;<br>                                    &lt;/button&gt;<br>                                &lt;/div&gt;<br>                            &lt;/div&gt;<br>                        &lt;/th&gt;<br>                        &lt;th scope=&quot;col&quot; className=&quot;px-6 py-3&quot;&gt;<br>                            &lt;div className=&quot;flex justify-center items-center&quot;&gt;<br>                                Price<br>                                &lt;div className=&#39;flex flex-col items-center&#39;&gt;<br>                                    &lt;button className=&#39;text-[16px] -mb-[10px]&#39; onClick={() =&gt; handleSort(&quot;asc&quot;, &quot;price&quot;)}&gt;<br>                                        &lt;RiArrowUpSFill value=&quot;asc-price&quot; /&gt;<br>                                    &lt;/button&gt;<br>                                    &lt;button className=&#39;text-[16px]&#39; onClick={() =&gt; handleSort(&quot;desc&quot;, &quot;price&quot;)} &gt;<br>                                        &lt;RiArrowDownSFill value=&quot;desc-price&quot; /&gt;<br>                                    &lt;/button&gt;<br>                                &lt;/div&gt;<br>                            &lt;/div&gt;<br>                        &lt;/th&gt;<br>                    &lt;/tr&gt;<br>                &lt;/thead&gt;<br>                &lt;tbody&gt;<br>                    {data.length &gt; 0 &amp;&amp; data.map((index, item) =&gt; {<br>                        const rawstars = data[item]?.stars<br>                        const stars = rawstars.substring(0, rawstars.indexOf(&quot; &quot;));<br>                        return &lt;tr key={data[item]?.url} className=&quot;bg-white border-b dark:bg-gray-800 dark:border-gray-700&quot;&gt;<br>                            &lt;td className=&quot;pr-6 py-2&quot;&gt;<br>                                &lt;a href={data[item]?.url} rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot;&gt;<br>                                    &lt;img alt={`image-${index + 1}`} className=&quot;&quot; src={data[item]?.image_src} loading=&#39;lazy&#39; /&gt;<br>                                &lt;/a&gt;<br>                            &lt;/td&gt;<br>                            &lt;td className=&quot;px-6 py-2 text-black font-semibold&quot;&gt;<br>                                &lt;a href={data[item]?.url} rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot;&gt;<br>                                    {data[item]?.name}<br>                                &lt;/a&gt;<br>                            &lt;/td&gt;<br>                            &lt;td className=&quot;px-6 py-2 text-black font-semibold&quot;&gt;<br>                                AMAZON<br>                            &lt;/td&gt;<br>                            &lt;td className=&quot;px-6 py-2&quot;&gt;<br>                                &lt;div className=&#39;flex items-center space-x-1 text-black font-semibold&#39;&gt;<br>                                    &lt;p className=&#39;font-medium&#39;&gt;{stars}&lt;/p&gt;<br>                                    &lt;AiFillStar className=&quot;text-yellow-400&quot; /&gt;<br>                                &lt;/div&gt;<br>                            &lt;/td&gt;<br>                            &lt;td className=&quot;px-6 py-2 text-black font-semibold&quot;&gt;<br>                                ₹ {data[item].price}<br>                            &lt;/td&gt;<br>                        &lt;/tr&gt;<br>                    })}<br>                &lt;/tbody&gt;<br>            &lt;/table&gt;<br>        &lt;/div&gt;<br>    )<br>}<br><br>export default Table</pre><p>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.</p><pre>import MobileSlider from &#39;@/components/MobileSlider&#39;<br>import SliderPage from &#39;@/components/SliderPage&#39;<br>import { AiOutlineSearch } from &#39;react-icons/ai&#39;<br>import { handleSearch } from &#39;./action&#39;;<br><br>export default function Home() {<br><br>  return (<br>    &lt;&gt;<br>      &lt;form className=&quot;flex flex-1 mt-10 justify-end items-center lg:mx-10 mx-2&quot; action={handleSearch}&gt;<br>        &lt;input className=&#39;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&#39; type=&quot;search&quot; name=&quot;search&quot; placeholder=&quot;Search for any mobile...&quot; /&gt;<br>        &lt;button type=&quot;submit&quot; className=&quot;absolute mx-2 text-xl bg-blue-800 p-2 rounded-xl text-white flex&quot;&gt;<br>          &lt;AiOutlineSearch /&gt;<br>        &lt;/button&gt;<br>      &lt;/form&gt;<br>      &lt;MobileSlider /&gt;<br>      &lt;SliderPage /&gt;<br>    &lt;/&gt;<br>  )<br>}</pre><p>And add this to your layout.js file.</p><pre>import MobileSlider from &#39;@/components/MobileSlider&#39;<br>import SliderPage from &#39;@/components/SliderPage&#39;<br>import { AiOutlineSearch } from &#39;react-icons/ai&#39;<br>import { handleSearch } from &#39;./action&#39;;<br><br>export default function Home() {<br><br>  return (<br>    &lt;&gt;<br>      &lt;form className=&quot;flex flex-1 mt-10 justify-end items-center lg:mx-10 mx-2&quot; action={handleSearch}&gt;<br>        &lt;input className=&#39;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&#39; type=&quot;search&quot; name=&quot;search&quot; placeholder=&quot;Search for any mobile...&quot; /&gt;<br>        &lt;button type=&quot;submit&quot; className=&quot;absolute mx-2 text-xl bg-blue-800 p-2 rounded-xl text-white flex&quot;&gt;<br>          &lt;AiOutlineSearch /&gt;<br>        &lt;/button&gt;<br>      &lt;/form&gt;<br>      &lt;MobileSlider /&gt;<br>      &lt;SliderPage /&gt;<br>    &lt;/&gt;<br>  )<br>}</pre><p>Create a search folder in app directory and add loading.js in that folder.</p><pre>import React from &#39;react&#39;<br><br>const loading = () =&gt; {<br>    return (<br>        &lt;div className=&quot;lds-ripple&quot;&gt;<br>            &lt;div&gt;&lt;/div&gt;<br>            &lt;div&gt;&lt;/div&gt;<br>        &lt;/div&gt;<br>    )<br>}<br><br>export default loading</pre><p>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.</p><pre>import React from &#39;react&#39;<br>import { AiFillStar, AiOutlineSearch } from &#39;react-icons/ai&#39;;<br>import { handleData, handleSearch } from &#39;../action&#39;;<br>import dataJson from &#39;../../utils/data.json&#39;;<br>import Table from &#39;@/components/Table&#39;;<br>import PagenationPart from &#39;@/components/PagenationPart&#39;;<br><br>const Search = async ({ searchParams }) =&gt; {<br>    const { data, page, totalPages } = await handleData(dataJson, searchParams.query ?? &quot;&quot;, searchParams.page ?? null, searchParams.order ?? null, searchParams.tag ?? null)<br><br>    return (<br>        &lt;div className=&#39;flex flex-col w-full justify-center items-center&#39;&gt;<br>            &lt;form className=&quot;flex mt-10 justify-center items-center lg:mx-10 mx-2&quot; action={handleSearch}&gt;<br>                &lt;div className=&quot;flex justify-end items-center&quot;&gt;<br>                    &lt;input className=&#39;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&#39; type=&quot;search&quot; name=&quot;search&quot; placeholder=&quot;Search for any mobile...&quot; /&gt;<br>                    &lt;button type=&quot;submit&quot; className=&quot;absolute mx-2 text-xl bg-blue-800 p-2 rounded-xl text-white flex&quot;&gt;<br>                        &lt;AiOutlineSearch /&gt;<br>                    &lt;/button&gt;<br>                &lt;/div&gt;<br>            &lt;/form&gt;<br>            {data.length &gt; 0 &amp;&amp; &lt;PagenationPart query={searchParams.query ?? &quot;&quot;} page={page} totalPages={totalPages} /&gt;}<br>            &lt;Table query={searchParams.query ?? &quot;&quot;} page={page} data={data} /&gt;<br>            {data.length &gt; 0 &amp;&amp; &lt;PagenationPart page={page} totalPages={totalPages} /&gt;}<br><br>        &lt;/div&gt;<br>    )<br>}<br><br>export default Search</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bT-4U8k-BrLy8D-mHAkq7Q.png" /><figcaption>Search Page</figcaption></figure><p>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.</p><h3>Conclusion</h3><p>You may, of course, modify the code to make more unique websites. Next.13 includes an extensive list of features that make frontend and backend development simple. I hope you enjoyed my blog and learned something new.</p><p><em>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 Medium. If you missed anything or want to </em><a href="https://github.com/abhirupkumar/mobwiki"><em>check out the full code here</em></a><em>. Thanks for reading!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95dbed7e3f98" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Important Subjects For Placement Preparation]]></title>
            <link>https://medium.com/@abhirupkumar2003/important-subjects-for-placement-preparation-4884770e40d0?source=rss-d84f55f6ca33------2</link>
            <guid isPermaLink="false">https://medium.com/p/4884770e40d0</guid>
            <category><![CDATA[sde-interview]]></category>
            <category><![CDATA[software-engineer]]></category>
            <category><![CDATA[placement]]></category>
            <category><![CDATA[off-campus]]></category>
            <category><![CDATA[oops-concepts]]></category>
            <dc:creator><![CDATA[Abhirup Kumar Bhowmick]]></dc:creator>
            <pubDate>Fri, 30 Jun 2023 15:36:24 GMT</pubDate>
            <atom:updated>2023-06-30T15:36:24.625Z</atom:updated>
            <content:encoded><![CDATA[<h4>Important Subjects For Placement</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DlE2vRVcVv--BSmEOIrgtA.jpeg" /><figcaption>Desk Setup</figcaption></figure><p>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.</p><p>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.</p><h3>Important Subjects</h3><h4>Data Structures And Algorithms (DSA)</h4><p>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.</p><h4>Object Oriented Programming (OOP)</h4><p>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.</p><h4>Operating System</h4><p>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.</p><h4>Database Management System</h4><p>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.</p><h4>Computer Networks</h4><p>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.</p><h4>System Design</h4><p>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.</p><h3>Conclusion</h3><p>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.</p><p><em>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.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4884770e40d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Projects I’ve made that you can try.]]></title>
            <link>https://medium.com/@abhirupkumar2003/projects-ive-made-that-you-can-try-20aa55253525?source=rss-d84f55f6ca33------2</link>
            <guid isPermaLink="false">https://medium.com/p/20aa55253525</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[project-ideas]]></category>
            <category><![CDATA[cse-projects]]></category>
            <category><![CDATA[ui-design]]></category>
            <dc:creator><![CDATA[Abhirup Kumar Bhowmick]]></dc:creator>
            <pubDate>Fri, 23 Jun 2023 16:11:40 GMT</pubDate>
            <atom:updated>2023-06-23T16:11:40.474Z</atom:updated>
            <content:encoded><![CDATA[<h4>Web &amp; Android App Development Projects</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*JkdLKzBA3L_U4J5W_Mq_kQ.jpeg" /><figcaption>Code</figcaption></figure><p>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.</p><h3>Web Projects</h3><h4>Soldier Game</h4><p>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.</p><p><a href="https://soldier-game.abhirup-kumarku.repl.co/">kaboom</a></p><h4>Pixelwear</h4><p>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.</p><p><a href="https://pixelwear.vercel.app/">Pixelwear - Wear The Trend</a></p><h4>Portfolio Website</h4><p>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.</p><p><a href="https://abhirupkumar.netlify.app/">Abhirup</a></p><h4>Linkedin Clone</h4><p>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.</p><p><a href="https://linkedin-clone-mauve.vercel.app/">LinkedIn - Log In or Sign Up</a></p><h4>Crypto Tracker</h4><p>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.</p><p><a href="https://crypto-tracker-akb.netlify.app/">Crypto Tracker</a></p><h3>Projects Built using React Native</h3><h4>Deliveroo Clone</h4><p>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 <a href="https://expo.dev/@abhirup/deliveroo-clone-apk">link</a> to the app.</p><h4>Signal Clone</h4><p>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<a href="https://expo.dev/@abhirup/SignalClone"> link</a> to the app.</p><h4>Instagram Clone</h4><p>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 <a href="https://expo.dev/@abhirup/Instagram-Clone-Published-At-Expo">link</a> to the app.</p><h4>Instant</h4><p>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 <a href="https://expo.dev/@abhirup/Instant">link</a> to the app.</p><h3>Conclusion</h3><p>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.</p><p><em>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.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20aa55253525" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Want to learn web development? Check out this roadmap.]]></title>
            <link>https://medium.com/@abhirupkumar2003/want-to-learn-web-development-check-out-this-roadmap-b5f69c1bd299?source=rss-d84f55f6ca33------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5f69c1bd299</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[roadmaps]]></category>
            <category><![CDATA[html-css-js]]></category>
            <category><![CDATA[learning-and-development]]></category>
            <dc:creator><![CDATA[Abhirup Kumar Bhowmick]]></dc:creator>
            <pubDate>Sun, 18 Jun 2023 15:20:19 GMT</pubDate>
            <atom:updated>2023-06-18T15:20:19.847Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Comprehensive Guide to Web Development</h4><figure><img alt="Web Development" src="https://cdn-images-1.medium.com/max/1024/1*zZayvpcHeTEWaLZsJZKeDA.jpeg" /><figcaption>Web Development</figcaption></figure><p>If you want to learn how to build websites or web apps, you’ve come to the correct spot. Web development is a popular skill these days, and there are hundreds of resources available to help you master it. One may study for free on YouTube or through certain free courses, however premium courses are also accessible.</p><p>In this article, I will discuss where to begin and how to proceed with learning and building projects.</p><h3>Frontend and Backend</h3><p>The frontend of a website is the client-side that users interact with directly. It includes the design of visual components, user interface (UI), and user experience (UX). The frontend of a website is often built using technologies such as HTML, CSS, and JavaScript. Frontend developers are responsible for creating and implementing the user interface’s appearance, feel, and functionality.</p><p>The backend, often known as the server-side, is in charge of a website’s behind-the-scenes activities. It comprises server management, database integration, and application logic. Backend developers manage data, interface with databases, and handle frontend requests using server-side languages such as Python, PHP, Ruby, or JavaScript (Node.js). They ensure that the website functions smoothly and efficiently, managing the server infrastructure and handling the data processing and storage.</p><h3>So, from where should we start?</h3><h4>HTML</h4><p>Well, first and foremost, start with learning HTML5. <strong>HTML (Hypertext Markup Language)</strong> is the basic building block of any website. Let me tell you in this way: HTML builds the skeleton of a website. CSS gives design to a website, and Javascript gives functionality. Hence, first learn HTML. HTML is pretty easy to learn and usually takes 2–4 weeks to master. Some popularly used HTML tags are &lt;div&gt;, &lt;span&gt;, &lt;p&gt;, &lt;h1&gt;, &lt;img&gt;, &lt;title&gt;, &lt;body&gt;, etc.</p><h4>CSS</h4><p><strong>CSS (Cascading Style Sheets)</strong> is very crucial as it provides presentation and formatting to the website. It gives the ability to developers to specify font styles, sizes, widht, height, image , margin and many other properties to the HTML tags.</p><p>You definitely need to know at first that for adding CSS to a particular HTML tag or component, we use ids or classes. Id has to be unique, whereas several tags can have class names. There are very interesting concepts like CSS positioning, pseudo-classes, flex or grid layout. Nowadays, most people use Bootstrap or Tailwind CSS, which have pre-built classes to make our work easy. But still, I recommend everyone learn CSS and build some projects at first, and then try Tailwind or Bootstrap.</p><h4>Javascript</h4><p><strong>Javascript</strong> is a scripting language that provides functionality to websites. Js is the most popular language on the web and runs in any web browser.</p><p>It is mostly used to add dynammic properties to different components like hovering effects, animation, displaying dynamically, etc. But that’s not the only use of Javascript; it is also used for API calling and serves as a backend programming language. Similar to any other programming language, Javascript also has variables, loops, if-else statements, functions, and objects. Javascript is also capable of DOM manipulation.</p><h3>Now What?</h3><p>If you have finished learning HTML, CSS, and Javascript, you have finished learning frontend. So, build some great projects, and then, if you want, move on to learning the backend. You can use PHP or NodeJS for the backend. I have used NodeJS, so let me talk about it.</p><h4>NodeJs</h4><p>Node.js is an open-source, server-side JavaScript runtime environment built on Chrome’s V8 JavaScript engine. It allows developers to run JavaScript code on the server, enabling them to build scalable and efficient backend applications. It enables efficient handling of concurrent requests through its non-blocking, event-driven architecture. With a vast ecosystem of modules and libraries, Node.js allows developers to build scalable and high-performance backend applications, handle I/O operations, interact with databases, and create APIs, all using JavaScript.</p><p>Once you have learned all of these, you have learned both frontend and backend. Now, there are many frameworks available to make the frontend easy, like React, Vue, Vite, Django, etc. I would recommend React, as it is a very popular JavaScript library for building user interfaces. It follows a component-based approach, allowing developers to create reusable UI components that update efficiently. With its virtual DOM, React efficiently renders changes to the UI, resulting in fast and responsive web applications. React’s declarative syntax and one-way data flow make it easier to manage application state and build interactive and dynamic user interfaces.</p><p>Except these frameworks there are several other things like database mangement, Git &amp; Github which are very essential.</p><h4>Github</h4><p>GitHub is a web-based platform that serves as a version control repository and collaborative space for developers. It allows users to host, manage, and share their code repositories, enabling teams to collaborate on projects efficiently. GitHub provides features like issue tracking, pull requests, and branching, facilitating seamless collaboration and code review processes. It also offers integration with various development tools and services, making it a central hub for project management and continuous integration.</p><h3>Conclusion</h3><p>I’ve covered the most of the basic web development tools. It is now your task to learn at your own speed. However, keep in mind that you can only become an expert web developer by practising or building projects. There are several materials available on the internet, and with patience and perseverance, you may become a great developer. Check out <a href="https://github.com/abhirupkumar">my github</a> if you want to know more about me. I hope you enjoy studying web development.</p><p>Good Luck !</p><p><em>Guys, if you enjoyed this, please give it a clap and share it with your friends who are about to begin learning web development. And if you want more articles like this, follow me on Medium.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5f69c1bd299" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Experience with Solving DSA Problems on Leetcode.]]></title>
            <link>https://medium.com/@abhirupkumar2003/my-experience-with-solving-dsa-problems-on-leetcode-d758d2b22cdb?source=rss-d84f55f6ca33------2</link>
            <guid isPermaLink="false">https://medium.com/p/d758d2b22cdb</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[sad]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Abhirup Kumar Bhowmick]]></dc:creator>
            <pubDate>Fri, 16 Jun 2023 17:02:09 GMT</pubDate>
            <atom:updated>2023-06-16T17:02:09.150Z</atom:updated>
            <content:encoded><![CDATA[<h4>Mastering the Art of Problem Solving on Leetcode</h4><p>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.</p><h3><strong>How it all started?</strong></h3><p>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.</p><p>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 400+ 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.</p><p>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.</p><p>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.</p><p>I have covered a wide range of DSA topics in this manner, including arrays, strings, sorting, searching, recursion, backtracking, stacks and queues, linked lists, and trees. I haven’t touched Graphs and Dynammic Progamming yet. These 2 topics are pretty hard and would need a lot of dedication. 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.</p><h3><strong>Conclusion</strong></h3><p>I have already solved 250+ questions on Leetcode. If you look at my <a href="https://leetcode.com/Abhirup2003/">Leetcode profile</a>, 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.</p><p><em>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.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d758d2b22cdb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>