Build a Search Bar with Next.js and Prisma (Search API endpoint)
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
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.
clean, good tutorial, and easy to implement
deserve like + subscribe!!
This is incredible!
Great video brother.. ✨
thanks bro love it ❤
Great work thanks for sharing
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
Thanks a lot brother this really help me.
Brother, thanks a lot!
You're welcome!
super useful
Glad you found it useful! Thanks for watching
Thanks ❤
why use nextjs if everything is a client sided component?
Is it possible to use SQLite instead of PostgreSQL in this project?
Yes, you have to change provider = "sqlite" in prisma schema.
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...
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
is it compatible with next@latest ? 13.4.4 ?
Yes, you would just create a route.ts file in your app router
can you make an integraion video of this in graphql ?
I will consider making a Next w/ GraphQL video! Thank you for the suggestion 😁
@@shadmerhi thanks i will wait for it.
SQ func: 10:13
Great video. Less great placement of your face, on top of the console 😛
Thanks for watching! Yeah haha I now know not to place my face there 🙈
I came here to say the same
what's your theme name?
GitHub theme! It's a VSCode extension:
Name: GitHub Theme
VS Marketplace Link: marketplace.visualstudio.com/items?itemName=GitHub.github-vscode-theme
@@shadmerhi thnxz
github link has been broken
My apologies, I just fixed it! Here it is: github.com/shadeemerhi/nextjs-fullstack-search
Camera is in front of the console, other than that great video 👍
Thank you for watching and for the feedback! Will keep this in mind for future videos :)
merhi from where in lebanon ?
My dad is from Mdoukha! Are you from there?
kabr chmoun my guy. mom is a merhi.@@shadmerhi
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 ✨
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
Lmao
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 }
);
}
}
~~~