CodeIgniter 4 Real Time Chat App using WebSockets

preview_player
Показать описание
In this CodeIgniter 4 tutorial we will develop a real-time chat application using WebSockets and Ratchet PHP Library. You will learn how you can use WebSockets in PHP, check online users connections, receive and send messages to the chat room.

This project will help you dive even more into CI4 but also learn how to use other PHP libraries via Composer for your needs.
This CodeIgniter 4 Chat Tutorial will give you the basis upon which you will be able to continue developing your own chat application in CodeIgniter 4.

GitHub repository for the full project:

GitHub repository for helper files:

Some of the improvements that can be done are:
- Store messages into the database
- Retrieve messages from the database
- Create one-to-one sessions
- Create Group chats

Link to CodeIgniter 4 Simple Blog Tutorial Part 1:

Link to Codeigniter 4 User Login Tutorial Part 1:

Рекомендации по теме
Комментарии
Автор

I just discovered your content and am LOVING IT!!! Well done! Best CodeIgniter 4 videos!

frikkievandermerwe
Автор

Alex, thank you so much for your time. This video helped me a lot. Regards from the Dominican Republic. Keep moving forward.

Ylliwx
Автор

I can't help but wait to find time and implement this tutorial. Big thanks Alex for such amazing content.

kennethkipchumba
Автор

nice one alex i would binge watch all of your videos :)

madie
Автор

Thank you, Alex. I was surprised to find someone else in Athens used Codeigniter 😁😁 Hope to see you soon
and nice topic Although I still find it difficult to enforce this realtime

codetogether
Автор

After CI 3 stalled, I left Codeigniter for Laravel when CI 4 was in beta and it was clear 3 had ended. CI was the black sheep of the PHP frameworks. But now, I see that it has been embraced by many developers. Alex has a bunch of CI4 tutorials and so many others have developed content in CI4. As great as Laravel is, CI has its place because even in CI4, it is till the light framework it has been.

AndrewKwabula
Автор

Thank you so much for the great content!

DanielZaponi
Автор

@Alex Lancer, thanks your greate article. Why run via the command-line, same 20:04, my terminal error ..system/Common.php on line 49. But I don't interfere Common.php file. Why error? Do you can help me??? Please.

hieuhiti
Автор

What changes would need to be made to the described set up to have it send broadcast messages to all connected
clients based on an independent event (not onconnect, onclose or onmessage) e.g a database update? Any help welcome.

edwinmurage
Автор

great tutorial alex.would you mind if you create another video in deploying this app on live server.preferably on digital ocean or cpanel.

mikesaerial
Автор

whatever the answer is please make it a yes :D hahaha got me clicking the subscribe button fast!

johnmahugu
Автор

Hey, first of all thanks for the tutorial.
Regarding minute 39:13 of this video:
No one in the comments seems to have noticed this vulnerability. You are using a user id as the GET parameter called "access_token" to establish a WebSocket connection. However, this compromises the purpose of authentication, as anyone can change the GET parameter and thus impersonate any user. The two servers (Apache & WebSocket server) should actually refer to the same session. Do you have a tutorial on this? :)

ronsn
Автор

In ci4, how to close websocket, i trying $server->loop->stop(); error [An error has occurred: Trying to get property 'loop' of non-object] Can anyone recommend?

เป็ดหูหมี
Автор

there is no vendor folder on your github project, where can i find it ...?

kajian_masjid_basen
Автор

Hi
I have a question please.
Can not I create a chat where more than 2 person can join together? Is this support more than 2 person chat together?

It would be very helpful if you reply me according this.
Thank you

codefixx
Автор

Thanx for the channel content in general. In a real app I don't want a message to be sent to all connected users to web sockets server. Is there a method to store user id for exp with websocket client. How to handle this?? On server, How to run websocket server? in local setup I run it via command line.

abdallahabdedaiem
Автор

beautiful work.. i hope you can make socket in codeigniter3 😇😇😇

katarinagaming
Автор

Please how do I get the right-click Duplicate in my vs code explorer

GoodSham
Автор

Great Job Alex, I have to develop chat module in our project. Can I create following your’s.. I hope it will work

muhammadyasin
Автор

I'm encountered this error when trying to clone and composer install, using php 8.2. can you help me with this?

Fatal error: Uncaught Error: Call to a member function run() on int in Stack trace: #0 {main} thrown in on line 45

GianGamingMLBB
join shbcf.ru