Question

I'm on developing a new application. It is going to work as follows,

=> All the user will be assigned to a group.

=> When a user logs in, the home page will show a textarea to add a message with all messages of the users who are in that group

=> Somtimes it is possible for one user will be assigned with more than one group, in that case the user have to select the groups they want to share their message.

=> The message sometimes have images and videos as well

In other words a chat room which is almost like the facebook newsfeed.

Now, my question, is there any plugins or script which is easy to be customised. Flash, Javascript.

Or what I can do is send ajax request every second to check the database for new message, grab and fetch on the screen. But the only thing I'm afraid is will it makes the server and/or the app slow or dead.

Please suggest me good solution dear genius brothers.

Was it helpful?

Solution

There are no such scripts to create an chatgroup that easy, you can use ajax to fetch the messages if you like.

But websockets or Server sent events would be a much better idea. However using Server sent events (SSE) on apache is also not really a good idea as apache will create a proces for each open connection. If you would like to use SSE I suggest using nginx

Link to SSE.
https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Error_handling

Websockets.
https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API

OTHER TIPS

Well learn:

  • jquery
  • nodejs

And then come back with other questions.

If you can learn, then learn the following:

  1. Node.js
  2. Angular.js
  3. Socket.io
  4. Express.js

They can make your life easier and this app can be possible in minutes. Look for a demo on the angular site.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top