Next.js Authentication Tutorial using React Context API and Appwrite

  Рет қаралды 9,211

James Q Quick

James Q Quick

Күн бұрын

ChatGPT is my go to when I need to write some code. I recently used ChatGPT to generate a useUser hook in Next.js that uses the context API and Appwrite to handle authentication. We'll be able to track a logged in user across different pages, conditionally display information, and protect authenticated routes.
*GIVEAWAY*
5 FREE Appwrite t-shirts 👕 To enter:
1. Go to jqqmemes.com/ and create a fun meme
2. Share on Twitter with #jqqmemes OR share the link in the comments below!
*SPONSORED BY APPWRITE*
Check out Appwrite - appwrite.io/
*QUESTIONS ABOUT MY SETUP*
Check out my Uses page for my VS Code setup, what recording equipment I use, etc. www.jamesqquick.com/uses
*STAY IN TOUCH 👋*
Check out the Podcast - compressed.fm/
Courses - jamesqquick.com/courses
Newsletter 🗞 - www.jamesqquick.com/newsletter
Follow me on Twitter 🐦 - / jamesqquick
*DISCORD*
Join the Learn Build Teach Discord Server 💬 - / discord
*Timestamps*
00:00 - Intro
00:20 - What We'll Build
01:10 - Starter Code and Requirements
03:40 - Giveaway
04:50 - Why the Context API in React
06:15 - ChatGPT to Create React Context and Hook
11:05 - Update User Hook with Appwrite
13:10 - Configuring Appwrite in Next.js
17:05 - Creating New Appwrite Project
18:40 - Configuring User Provider
19:45 - Testing Authentication Methods
21:20 - Showing Content Based on Authenticated User
23:40 - Protecting Next.js Routes Based on Authenticated User

Пікірлер: 15
@shayanalijalbani9894
@shayanalijalbani9894 Жыл бұрын
Hi sir can you create a separate playlist on next Js projects
@adrianfr05
@adrianfr05 Жыл бұрын
would be cool to see how this works in sveltekit. I've been waiting for the cloud services for a while now
@JamesQQuick
@JamesQQuick Жыл бұрын
That's a good idea. In theory, it would be pretty similar but using Svelte stores
@antoniors
@antoniors Жыл бұрын
When using this approach the app instantly becomes complete client side, right? Because when use useContext() u are baically invoking a hook at the top-level of the application or am I wrong?
@codeheaven559
@codeheaven559 11 ай бұрын
can you give me a better approach to handle authentication using contextapi?
@DimasAnwarAziz
@DimasAnwarAziz Жыл бұрын
can you share the code? Please
@NeverCodeAlone
@NeverCodeAlone Жыл бұрын
Thx a lot!!
@JamesQQuick
@JamesQQuick Жыл бұрын
Glad you enjoyed it!
@NeverCodeAlone
@NeverCodeAlone Жыл бұрын
@@JamesQQuick love your videos. What color skin is it and do you publish your VSC setup?
@MarcelRezende
@MarcelRezende Жыл бұрын
James, my man. Do you have the complete code for this? Great content by the way
@JamesQQuick
@JamesQQuick Жыл бұрын
Ah no I don't have that source code specifically but I do have the source code for the JQQ Memes project - github.com/jamesqquick/jqq-memes-nextjs-cloudinary-appwrite
@MarcelRezende
@MarcelRezende Жыл бұрын
@@JamesQQuick I'll check it out. Thanks.
@benemma5602
@benemma5602 Жыл бұрын
That's a really bad way to implement protected routes.
@GoutamReddydazz
@GoutamReddydazz Жыл бұрын
😂😂😂😂
@gaura-krishna
@gaura-krishna Жыл бұрын
very confusing.
I Built a Shelter House For myself and Сat🐱📦🏠
00:35
TooTool
Рет қаралды 26 МЛН
A pack of chips with a surprise 🤣😍❤️ #demariki
00:14
Demariki
Рет қаралды 16 МЛН
Заметили?
00:11
Double Bubble
Рет қаралды 3,4 МЛН
Do you have a friend like this? 🤣#shorts
00:12
dednahype
Рет қаралды 59 МЛН
I Built a Shelter House For myself and Сat🐱📦🏠
00:35
TooTool
Рет қаралды 26 МЛН