PHP Chat application (Complete Project) [+SOURCE CODE]

preview_player
Показать описание

This is a real time chat application created using pure PHP.
The application doesn't use any frontend or backend framework except jquery which is a library just to reduce the javascript syntax so the project is frameworkless if you want
Along with php and mysql, I used AJAX for sending requests and perform actions without refreshing the page, and some other techniques like long polling wich is used to simulate the real time between users when they exchanging messages



The application contains too many features including exchanging messages between users asynchronously in form of organized components, a real-time notifier when users chatting, reply to certain message, add friends, accept friendship requests, follow a friend to be able to see his posts and have conversation with him, sharing posts in different forms including textual posts, post with one image, or more and video posts as well and too many features .
When you have friends OR follow people, you're gonna be able to fetch their posts either by checking your timeline or to navigate for certain user to see his posts. The user can also like posts, comment on posts, and share a particular post.
There's a profile page where the user could change his personal information and see his own posts or there's a setting page where the user can change everything in there including the password, username, cover .. etc.

Messaging section is implemented using long polling method, where the user sends a request to the server and tell the server to not close the connection until he gets some new data to that user; when the server get a data from another user to that userit will automatically send it back to that user and close the connection. When that client get the data or response from the server by automatically seeing it in the screen, the connection will be closed, and this user will send a new long polling request again to the server to wait for some new data and this process will be repeated until the user close chat section or the application. If you're using a framework you may use websockets which is better than long polling but because I'm not using any framework here I used long polling method to create this real-time channel between users to exchange messages and generate this notifier.

Notes:
1. This is one of my side projects that I written to apply everything I've learned in PHP and also to challenge myself by creating a chat application without any framework because I like to know how things happen behind the scenes. You may find some misuses or mistakes like in the way how I implemented the rest api or in the way how I structured the project ! but as I said this project is created just for learning and testing stuff, so you may pick up something useful and I'll very happy to see your feedback or any idea that makes that project much cleaner and useful.
2. The code will be available to anyone and I'll let the link to the code in the description, so If you want to collaborate, the code is available in github so you can make changes.
3. If you're using a framework like laravel or symfony, you can grab the project and try to convert it to a framework project and that will be a challenge that makes you understand framework concepts much better.
Рекомендации по теме
Комментарии
Автор

Seriously you deserve more subscription and views thanks for sharing this wonderful project with us

nitinchandraushaamallick
Автор

my man made an entire social media app

FaudiaxProductions
Автор

This is very cool you added features from social media wall and chat together into one.

DiyintheGhetto
Автор

Mehn ..you deserve an award for this Script .. plane php and JavaScript .. awesome bro .

debrain
Автор

i am subscribing! u deserve more man! excellent work keep it up. which algorithm did u use for the app BTW

brucemlambo
Автор

Dude, this is awesome, great time put into this

lex-coded
Автор

It's amazing bro, GG and thanks for source code <3

gamermaster
Автор

COOL. I WILL TAKE TIME TO WATCH IT. THANK YOU

godwinegwu
Автор

Oh bro you... I cant description this project... Amazing thank you

biaypanie
Автор

Wow just wonderfull ! Thanks you very very munch

raymondmoundzele
Автор

Awesome but please can you do a step by step tutorial on this?

theJohnCode
Автор

I already install "Composer" but the "Vendor" folder is missing in file. especially the "autoload.php" that's our problem.. can you help us?

AdrianOrig
Автор

Can you make this project from scratch by explaining the code and explaining the structure of how to build comment box, real time sending message etc features which you have included in your system . Your work is awesome

omyele
Автор

legend never die, ,, were are you from ?

AMEMORENGEURISR
Автор

you make me learn much more about the php, many thanks.
I have a question that why I input the password twice to enter, can you fix the problem?

tammykan
Автор

habibi, I'm new to programming. Everything is above my head. How can I deploy it online? I'm trying to learn.

htmoh
Автор

i loved your work and i have hard you said if any issues you would love to help. i need help can you make a tutorial on a music sharing site. using streams of data please not am very very php beginner and want to learn php streams with a practical music streams and sharing site

nathanielleegraham
Автор

What can i do, i try to insatll the composer of json and doesn't accept
help me

uzimagerishomo
Автор

love it, but can you do it over to use web sockets

siddhuwilson
Автор

Just because you leaved source code i subbed like and commnet

juliozamudio
join shbcf.ru