Realtime Features for React: Easier Than You Think

  Рет қаралды 45,374

Josh tried coding

Josh tried coding

Жыл бұрын

When I was new to web dev, implementing real-time features into your apps seemed like a nightmare. So many things to keep in mind. How to deploy the web sockets? How to manage scaling? I think this might be one of the most beginner-friendly approaches to implementing real-time features into your own app.
My GitHub: github.com/joschan21
The minimal realtime chat code: github.com/joschan21/minimal-...
Pusher (not sponsored): pusher.com/channels
I wish you a lot of fun implementing real-time features into your app! Let me know if you build something cool with it! Cheers

Пікірлер: 45
@faizanahmed9304
@faizanahmed9304 Жыл бұрын
Thanks a lot! I was just looking the docs for pusher and was not understanding much and you've just dropped a video.
@joshtriedcoding
@joshtriedcoding Жыл бұрын
Been there, at first they confused me too
@NinjaNezie
@NinjaNezie 4 ай бұрын
Needed this for a clock in system I’m building. Very nice tutorial 🔥.
@ammarys9980
@ammarys9980 4 ай бұрын
bro you just created a conclusion for their bad documents, that's hard to believe, YOU A LIFE SAVER.
@malamhari_
@malamhari_ 9 ай бұрын
Thanks, this video is very helpful to grasp the basic of Pusher Hope you do well onwards!
@cameronmccoy2204
@cameronmccoy2204 15 күн бұрын
Pppppp😊pp
@angzar
@angzar Жыл бұрын
Excellent Josh, great video as always. ...(ps. prisma format -> makes it so pretty)
@jnayehsirine6222
@jnayehsirine6222 8 ай бұрын
KEEP GOING !!!, you have such GOOOD content
@Subhamremady
@Subhamremady Жыл бұрын
amazing bro. It was really something new for me . THnakss for the video
@mateuspaula_dev
@mateuspaula_dev Жыл бұрын
Good video, thank you very much for sharing your knowledge. I really hope you keep producing videos with the same intensity. Best regards, all the best from Brazil 🇧🇷
@joshtriedcoding
@joshtriedcoding Жыл бұрын
Cheers man, appreciate you
@murphyvanoijen6190
@murphyvanoijen6190 Жыл бұрын
@Josh, Great video again. Does this also work in NextJS 12?
@astronaut22
@astronaut22 2 ай бұрын
can we use pusher to implement ads campain feature like google ads, I mean showing users data as ad in queue in real time ?
@josht29
@josht29 Ай бұрын
Great tutorial! But what if I have multiple channel I need to listen to? Do I need to create one useEffect per channel or put all listeners in one useEffect?
@siosaiafonua9286
@siosaiafonua9286 10 ай бұрын
can react query do the same thing? provide real time updates?
@NhanNguyen-ng7vn
@NhanNguyen-ng7vn 6 ай бұрын
Today, i'm creating a chat in my school'project, and i don't khow how to unsubcribe channel_name inside return callback of UseEffect. Thanks you !
@AssBlasterChan
@AssBlasterChan Жыл бұрын
have you got a repo for reference? Curious how to set up the part where pusher talks to the db to preserve the state
@joshtriedcoding
@joshtriedcoding Жыл бұрын
Good call, will update that in the description
@asimalqasmi7316
@asimalqasmi7316 Жыл бұрын
@@joshtriedcoding waiting for the update 👍👍
@joshtriedcoding
@joshtriedcoding Жыл бұрын
@@asimalqasmi7316 It's available in the description now: github.com/joschan21/minimal-react-realtime
@asimalqasmi7316
@asimalqasmi7316 Жыл бұрын
I tried it myself before you sent the repo It stumbled on useRouter in app page since it wasn't clear in the video until I figured out it was imported from navigation not router. If you want to see my repo I'll share it here. 😁
@edihasrin7290
@edihasrin7290 Жыл бұрын
hi josh, Can you explain how to use SWR for realtime data. From the info I got on Twitter, it says it doesn't use third party services / web scoket. i am very interested about that
@tnctnctnctnc
@tnctnctnctnc 5 ай бұрын
Have you got your answer ?
@krisbude9607
@krisbude9607 9 ай бұрын
nice video Josh. Just one thing... I wouldn't teach other developers to use a let in a react client component instead of the useState hook. In this particular case it works because you don't have any parent component. But it is really a bad practice and should not be used in a client component to maintain state.
@justin9494
@justin9494 2 ай бұрын
Can I use this with Strapi?
@suaeb175
@suaeb175 Жыл бұрын
Thanks 🙏
@crazytydoo
@crazytydoo Жыл бұрын
I love the intros to these videos, very German 😆
@AaronMcCloud_Me
@AaronMcCloud_Me 10 ай бұрын
7:25 The real-time functionality
@TheDionysiac
@TheDionysiac 11 ай бұрын
I'm not overly familiar with Prisma, but I was under the impression that you needed to set it up to work with a 3rd party DB service like Supabase or Planetscale. If so, which are you using in this project? If not, where is the database located?
@filipjnc
@filipjnc 9 ай бұрын
Any supported dbs and hosted anywhere.
@acupofkoffi
@acupofkoffi Жыл бұрын
Hi. How long have you been learning web dev?
@joshtriedcoding
@joshtriedcoding Жыл бұрын
Gonna make a video on that soon :)
@alexmagwe
@alexmagwe Жыл бұрын
why dint you use useState for the input value?
@joshtriedcoding
@joshtriedcoding Жыл бұрын
no need to
@hn3m3s1s
@hn3m3s1s Жыл бұрын
Is it complex to setup a internal websocket on NextJS ?! 😢
@joshtriedcoding
@joshtriedcoding Жыл бұрын
Due to NextJS being serverless and WS requiring stateful connections, you can't. That's why I found this method so convenient, alternatively NodeJS with socket.io for small scale apps is totally fine too
@hn3m3s1s
@hn3m3s1s Жыл бұрын
@@joshtriedcoding Isn’t it that nextjs embed expressjs, and actually have a backend? The prisma calls for example are server side, right ?
@joshtriedcoding
@joshtriedcoding Жыл бұрын
@@hn3m3s1s Yes they are server-side. NextJS API routes use NodeJS, however, due to them being serverless, you don't have access to some APIs such as the file system. You can think of it as "every time my NextJS API gets called, I am 'renting' out a few seconds of a server's resources for this route to process the request".
@hn3m3s1s
@hn3m3s1s Жыл бұрын
@@joshtriedcoding Wuw, thanks for that! Very clear explanation and I understand now better how next works!
@eeespartak
@eeespartak 8 ай бұрын
@@joshtriedcodingWhy would you recommend it for small scale apps only? What better alternatives could you name for sth like a Java api + React/Next client?
@haijomblo-rn8pl
@haijomblo-rn8pl 6 ай бұрын
"use server" = prisma not api again 😢
@yacine5046
@yacine5046 6 ай бұрын
That's really good, but it's paid and limited. The free version is also limited
@ekchills6948
@ekchills6948 10 ай бұрын
Woow
@whoisasey
@whoisasey 2 ай бұрын
THANK YOU!! the Pusher docs were so trash.
@user-hg4sv8ms6n
@user-hg4sv8ms6n 2 ай бұрын
NOt helpful Just showing your code
Next 14 + React Query COMBO with Server Actions and RSC
9:49
developedbyed
Рет қаралды 91 М.
This UI Library Keeps Crushing It
4:36
Josh tried coding
Рет қаралды 66 М.
Looks realistic #tiktok
00:22
Анастасия Тарасова
Рет қаралды 30 МЛН
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 170 #shorts
00:27
I Can't Believe We Did This...
00:38
Stokes Twins
Рет қаралды 78 МЛН
Websocket là gì? Ưu - nhược điểm ra sao? Cách kết nối thế nào?
8:01
Domain - VPS - SSL - Wordpress
Рет қаралды 2,6 М.
We Need to Talk About Redis.
14:55
Josh tried coding
Рет қаралды 88 М.
Don't Use Websockets (Until You Try This…)
6:46
Code With Ryan
Рет қаралды 288 М.
Fetching Data Doesn't Get Better Than This
6:58
Josh tried coding
Рет қаралды 88 М.
Why I still choose next.js
19:39
Web Dev Cody
Рет қаралды 18 М.
ПОКУПКА ТЕЛЕФОНА С АВИТО?🤭
1:00
Корнеич
Рет қаралды 3,6 МЛН
Самый дорогой кабель Apple
0:37
Romancev768
Рет қаралды 216 М.
Что еще за съемные фронталки от Vivo? #vivo
0:41
When you have 32GB RAM in your PC
0:12
Deadrig Gaming
Рет қаралды 1,2 МЛН
После ввода кода - протирайте панель
0:18
Up Your Brains
Рет қаралды 1 МЛН