PHP Flutter Chat App

Created At: 2023-10-22 06:38:40 Updated At: 2023-10-29 07:55:34

Over the years, we have developed many chat apps. Most of the chat apps have used Firebase as chatting service. We have also developed Flutter Nodejs chat app. This time we will introduce Flutter PHP chat app. With this we completely get rid of Firebase for chatting.

Nodejs chat app Flutter

We have developed a complete marketplace app. That means we can use this app for selling second products. Of course you may sell first hand products. This app also comes with a complete backend.

About the app

This is a marketplace app, where sellers, buyers meet each other as travellers. Anyone can upload products and see if someone wants to buy the products or not.

Sellers and buyers can talk to each other. We have used websockets to do that chat. They can also make offer like sending money as a bid. Chat also includes sending pictures.

Let's see the app frontend features.

  1. PHP and Flutter chat app
  2. Guest user login
  3. Facebook login
  4. Google login
  5. Apple login
  6. Collect user location info
  7. Sellers profile 
  8. Buyer profile
  9. Subscription based membership
  10. Stripe payment
  11. Make a post as buyer
  12. Make a post as a seller
  13. Make offer(make a bid)
  14. View products on front page
  15. Give rating
  16. Delete account

Chat feature

Chat feature has been done with a PHP server called Workerman. Workerman is a powerful chat tool. We have used it a few real world apps. So the server stability is guaranteed. This chat server library is 8 years old and very mature. At the same time it's constantly updating. Their github has over 10k stars.

Github workerman  Learn more about workerman here

In the benchmark test, it ranks number one among all the other PHP libraries. It's better than PHP swoole or PHP-NGX. So it's strongly recommended to use.

They also have an english manual to set it and it's very easy to do it. If you buy our code, you will get everything ready in source code. Just drag and drop and you are ready to chat.

While client to client communication happens using Workerman, the local chat storage on the client side happens using Sqflite. With this is you get extremely smooth app. As you scroll the app, it does not lag at all. So every time a user logs in, you get synchronized chat app message using Sqflite.

Backend features

Get the complete code here

Installation guide

1. make sure in your laravel project folder you change the address according to your ip address

Here you see the Gateway.php $registerAddress. Set up your ip address correctly. This could be your domain name as well. It could be local ip address as well. After that you can start your php server using 

php artisan serve --host= --port=8000

2. Here this ip address is same as in the above picture. But the port number is Laravel port number.

3. We also need to set up in the ChatWorker folder the below file

Here we set up the ip address in two different places. Make sure you make the changes in start_gateway.php file.

4. Next start our chat app of ChatWorker. Go inside the folder and run

php start.php start

5. You will check the below picture

Once you see all the green lights, it means the server is running correctly.

6. Check websocket online with site

Type in your address with ws like the picture and you will see the connection is ready


Add Reviews

Recommended Posts

Latest Posts

Subscribe our newsletter