Introducing random chat among people

My idea is to create a website where people can sign up and look for people to talk to. They can choose people from a certain country, genre, with a certain age, etc.

Yes, I know that there are many such sites, but I want to implement it because it looks very difficult.

Can you give me ideas how I can implement this using PHP + MYSQL + JQuery (Ajax)? I am not a newbie and do not advance with these things.

So how should this work? One person presses the search button, this person is placed in the database, that he is looking for someone to talk to, and what's next? I also want people to be able to talk to several people at the same time.

I am not asking for code or anything like that, just ideas on how to encode it, no code needed.

Thanks.

+6
jquery ajax php mysql
source share
7 answers

I do not think that a synchronous, blocking programming language such as PHP is a suitable platform for such an application. It was much wiser to choose an asynchronous, non-blocking language such as JavaScript. This has the great advantage that you can use Long Polling , which will improve chatting in your application.

Therefore, I recommend implementing this with NodeJS . You can see the implementation of simple chat in node.

+11
source share

Create a bucket for each organizational unit (Country, Genre, Age, etc.).

When using a join, give them an incremental index for each bucket to which they belong.

When the user wants to connect with someone from the bucket, just create a new random number from 0 to the maximum index value for the bucket ... and connect them!

+4
source share

I believe that using PHP + MySQL is ok. I suggest you use push services to improve your chat environment. When you click on your client should not request a server to receive new data +, it makes a chat in real time. Some of the push services include PusherApp , Kwwika , Hookbox, and BeaconPush . They have excellent support, documentation, and libraries. Good luck.

+2
source share

I do not think that a complex structure is a good solution for this kind of application. I would advise you to stick with basic javascript / jquery for the client side .. and php for the server side. The only problem you may encounter is that you will need a very reliable database solution, assuming that you are targeting at least some traffic, and ONLY if you need to keep a message archive, in this case I would suggest Oracle (known for working very well with large databases, but it's not free). If not, MySQL (for free) will do great with high traffic with relatively small databases.

Basically, the idea your application will rely on is simple. You can create a table with users, another with messages, preferences ... etc. on the client side ... just refresh the page every 3-5 seconds or let the user indicate the speed and refresh the web page with new messages / users / details .. etc., if any. As soon as the user disconnects, you can delete everything related to his activity from the database, this will save some space.

I hope you understand my English, Best regards.

+1
source share

Can you give me ideas how I can implement this using PHP + MYSQL + JQuery (Ajax)? I am not a newbie and do not advance with these things.

If you are what you say, then I believe that you do not know about any technology that you intend to use. So, in this case, I would advise you to first read, work through a few simple examples, and then move on from there. For example,

  • Start with PHP Usage Instructions - Learn the Syntax
  • Create a simple web page. Build your first website.
  • MySql practice articles - Examine Query / Syntax
  • Add a database, possibly mySql, implement simple CRUD operations
  • Read about chat apps - Work / Internal, various architectures that you can track.
  • Prepare a small client / server based application. Different protocols are used.

... and then when you start to feel comfortable with the code, when you start thinking in the code, go on to a full-blown chat!

You may end up twisting your original idea, but don't worry, its part of the process. Everything changes as we see a clearer idea of ​​what exactly we want.

Even if you plan to use existing open libraries / controls, you should know how to use them; you should get enough skills that, as you know, should be hammered with a nail, but not otherwise.

In addition, I see this cross-cutting phase from 2 to 3 months if it is done with dedication.

+1
source share

I'm not sure Flash will be fine with you, but the Adobe P2P Cirrus service can definitely serve as a good backend for you: http://www.flashrealtime.com/simple-chat-p2p-netgroup-rtmfp/

0
source share

You can use Orbited (along with js.io for the browser) and XMPP or IRC as the base system. These two provide a reliable chat infrastructure that will allow you to implement any feature you need, such as group chat.

0
source share

All Articles