Build a Search Bar with Next.js and Prisma (Search API endpoint)

Sdílet
Vložit
  • čas přidán 25. 02. 2023
  • In this video, we'll cover how to build full-stack search functionality into your Next.js application using Prisma. We'll look at how to add search query params to the URL, and use the search params to make a GET request to a /search API endpoint.
    ❤️ Tips & Donations Link: paypal.me/shadeemerhi?country...
    ( Thank you very much for your support!)
    Code: github.com/shadeemerhi/nextjs... (please see the README for starter instructions)
    Discord Server: / discord
  • Věda a technologie

Komentáře • 43

  • @ciscoramonsanchez5192
    @ciscoramonsanchez5192 Před rokem +9

    I don't like to handle myself the encoding and decoding of query from url. Instead I use the native api **URLSearchParams** . It parse, encode, decode has a toString method that convert the value on it into search params encoded.

  • @AlleinArk
    @AlleinArk Před 10 měsíci +2

    clean, good tutorial, and easy to implement
    deserve like + subscribe!!

  • @imAskja
    @imAskja Před 9 měsíci

    This is incredible!

  • @hassaantahir3861
    @hassaantahir3861 Před rokem

    Great video brother.. ✨

  • @bilegtsdf5776
    @bilegtsdf5776 Před rokem

    thanks bro love it ❤

  • @KJPrince
    @KJPrince Před 7 měsíci

    Great work thanks for sharing

  • @mackenandsouza3311
    @mackenandsouza3311 Před rokem

    Hi I've been watching your reddit tutorial and have encountered an issue with the useCreation with Email and password ,i tried joining the discord but it wasn't letting me in ,could u please help me

  • @Sumi-ql3wj
    @Sumi-ql3wj Před 4 měsíci

    Thanks a lot brother this really help me.

  • @SimonEdmund
    @SimonEdmund Před rokem +1

    Brother, thanks a lot!

  • @salmansheriff8243
    @salmansheriff8243 Před rokem +2

    super useful

    • @shadmerhi
      @shadmerhi  Před rokem

      Glad you found it useful! Thanks for watching

  • @mohammadmalek5042
    @mohammadmalek5042 Před 11 měsíci

    Thanks ❤

  • @sweattypalms_0183
    @sweattypalms_0183 Před 2 měsíci

    why use nextjs if everything is a client sided component?

  • @harrykara4121
    @harrykara4121 Před rokem +1

    Is it possible to use SQLite instead of PostgreSQL in this project?

    • @abdulrafay1951
      @abdulrafay1951 Před rokem

      Yes, you have to change provider = "sqlite" in prisma schema.

  • @TomoDevelops
    @TomoDevelops Před rokem +1

    I was doing the exact same thing before watching this vid but for some reason when I change the query and re-search the page doesn't re-render like yours....
    My code looks exactly like yours and I can't seem to figure out what's wrong...

    • @shadmerhi
      @shadmerhi  Před rokem

      Hmmm that's interesting. If you're still stuck, feel free to join my Discord server and we can chat about it further there! discord.gg/kFVVYbcy7D

  • @mediacreatif
    @mediacreatif Před rokem

    is it compatible with next@latest ? 13.4.4 ?

    • @shadmerhi
      @shadmerhi  Před rokem

      Yes, you would just create a route.ts file in your app router

  • @vaquarshaikh9790
    @vaquarshaikh9790 Před rokem

    can you make an integraion video of this in graphql ?

    • @shadmerhi
      @shadmerhi  Před rokem

      I will consider making a Next w/ GraphQL video! Thank you for the suggestion 😁

    • @prashlovessamosa
      @prashlovessamosa Před rokem

      @@shadmerhi thanks i will wait for it.

  • @MO-432
    @MO-432 Před 8 měsíci

    SQ func: 10:13

  • @Svish_
    @Svish_ Před rokem +1

    Great video. Less great placement of your face, on top of the console 😛

    • @shadmerhi
      @shadmerhi  Před rokem +1

      Thanks for watching! Yeah haha I now know not to place my face there 🙈

    • @crickey.
      @crickey. Před 5 měsíci

      I came here to say the same

  • @nirbhayjain2186
    @nirbhayjain2186 Před rokem

    what's your theme name?

    • @shadmerhi
      @shadmerhi  Před rokem

      GitHub theme! It's a VSCode extension:
      Name: GitHub Theme
      VS Marketplace Link: marketplace.visualstudio.com/items?itemName=GitHub.github-vscode-theme

    • @nirbhayjain2186
      @nirbhayjain2186 Před rokem

      @@shadmerhi thnxz

  • @maverick456-33
    @maverick456-33 Před rokem

    github link has been broken

    • @shadmerhi
      @shadmerhi  Před rokem +1

      My apologies, I just fixed it! Here it is: github.com/shadeemerhi/nextjs-fullstack-search

  • @andretavares5602
    @andretavares5602 Před rokem

    Camera is in front of the console, other than that great video 👍

    • @shadmerhi
      @shadmerhi  Před rokem

      Thank you for watching and for the feedback! Will keep this in mind for future videos :)

  • @psyferinc.3573
    @psyferinc.3573 Před 5 měsíci

    merhi from where in lebanon ?

    • @shadmerhi
      @shadmerhi  Před 5 měsíci +1

      My dad is from Mdoukha! Are you from there?

    • @psyferinc.3573
      @psyferinc.3573 Před 5 měsíci

      kabr chmoun my guy. mom is a merhi.@@shadmerhi

  • @hassaantahir3861
    @hassaantahir3861 Před rokem +3

    Bro can you build something (a website) on top of AI like using their API.
    You can use any AI tool or you can combine multiple to build a new product.
    Or can you make a video of 4-5 SaaS ideas build using Apis of multiple AI .. plzzz
    Thanks in advance ✨

  • @MJ46.91
    @MJ46.91 Před rokem

    I just wanted to know what the endpoint might look like instead I watched a dude making a frontend tutorial, adding tons of complexity, this qualifies as a click bait, unccol

  • @personal1872
    @personal1872 Před rokem

    i am trying to send fetch("/api/users/me") with access_token as header but when i console.log the logged in user is null
    ~~~
    import { nextAuthOptions } from "@/app/api/auth/[...nextauth]/route";
    import { NextRequest, NextResponse } from "next/server";
    import { getServerSession } from "next-auth";
    export async function GET(req: NextRequest) {
    try {
    const session = await getServerSession(nextAuthOptions);
    console.log({ session: session });
    return NextResponse.json(
    { status: 200, data: { user: "test" } },
    { status: 200 }
    );
    } catch (error: any) {
    return NextResponse.json(
    { status: 500, error: error.message },
    { status: 500 }
    );
    }
    }
    ~~~