views:

463

answers:

7

My idea is to make a website, where people could registry and search for a people to talk. They can choose people from certain country, genre, with certain age and so on.

Yeah, I know there is a lot of websites like this, but I want to implement this, because it looks really challenging.

Can you give me ideas how could I implement this using PHP + MYSQL + Jquery(Ajax)? I am neither a beginner nor advanced with these things.

So, how should this work? One person clicks search button, this person is put in database that he searches for somebody to talk, so what's next? I also want to be able to allow people to talk with a few people at the same moment.

I am not asking for a code or something, just ideas how to code it, no code needed.

Thank you.

+4  A: 

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

When a use connects, give them an incrementally larger index for each bucket they belong to.

When a user wants to connect with somebody from a bucket, simply generate a new random number between 0 and the max index value for the bucket...and connect them!

Justin Niessner
+9  A: 

I don't think that a synchronous, blocking programming language like PHP is the right platform for such an application. It were much wiser to choose an asynchronous, non-blocking language like JavaScript. This has the great advantage that you may use Long Polling which will improve the chatting experience in your application.

Thus I recommend implementing this using NodeJS. You may want to look at an implementation of a simple chat in node.

nikic
Since when is PHP a 'blocking' language and 'javascript' a non-blocking language? Or are you implying that because PHP is server-side and Javascript is client-side? Edit: I see now, you're advertising for NodeJS
smirkingman
I was late. +1 for Node.js it will just make the chat run smooth and low on resources, you can easily handle 1000s of concurrent users on a single vps, plus there are modules that will handle Twitter OAuth etc. so you don't even have to use a database if you don't want to and you can just proxy the conversations around with something like Socket.io
stagas
A: 

Not sure if Flash would be ok with you, but the Adobe P2P service Cirrus could definitely serve as a nice backend for you: http://www.flashrealtime.com/simple-chat-p2p-netgroup-rtmfp/

Chad Udell
A: 

You can use Orbited (along with js.io for the browser) and either XMPP or IRC as the underlying system. Those two are provide robust chat infrastructure that will allow you to implement any feature you need, group chat for example.

bobdiaes
+2  A: 

I believe using PHP+MySQL is fine. I suggest you to use push services to make the chatting environment even better. With push, your client doesn't have to request the server to get new data + it makes the chatting real-time. Some of push services are: PusherApp, Kwwika, Hookbox and BeaconPush. They have great support, documentation and libraries. Good luck.

Ngo Minh Nam
+1  A: 

I don't think that a sophisticated framework is a good solution for this kind of application. I would suggest that you stick with a basic javascript/jquery for client-side .. and php for server-side.. The only problem that you may encounter is that you'll need a very robust database solution, assuming that you are targeting at least some traffic, and ONLY if you'll need to store an archive of the messages, in this case I would suggest Oracle (known for working very good with big databases, but it's not free). If not, MySQL(free) will do great on high traffic with relatively small databases.

Basicly, the idea on which would rely your application is simple.. you can make a table with users, another with messages, preferences... etc. about the client side... just refresh the page every 3-5 seconds, or let the user specify the rate, and update the webpage with new messages/users/reques.. etc. if any. Once a user goes off, you can delete everything related to his activity from the database, this would save some space..

Hope you understood my English, Best Regards.

Victor Z.
+1  A: 

Can you give me ideas how could I implement this using PHP + MYSQL + Jquery(Ajax)? I am neither a beginner nor advanced with these things.

If you are what you say you are, then I believe that you dont know about any of the technology that you intend to use. So, in this case, I'd suggest you do some reading first, work over some simple examples, and then move on from there. For instance,

  • Start with PHP how-to articles - Learn syntax
  • Create a simple web page - Create your first web site
  • mySql how-to articles - Learn query/syntax
  • Add a database possibly mySql, implement simple CRUD operations
  • Read about chat apps - Working/internals, different architectures you can follow
  • Prepare a small client/server based app - Different protocols that are used

...and then when you start feeling comfortable with the code is when you start thinking in the code, move on to your full fledged chat-plication!

You might end up twisting your original idea, but do not worry, its the part of the process. Things get changed as we see clearer picture of what exactly we want.

Even if you plan on using the existing open libraries/controls, you must know how to use them; you should get enough of an skill that you know that a nail is to be hammered but not otherwise.

Plus, I see this end-to-end phase of around 2 to 3 months, if done with dedication.

KMan
@KMan: I have built a game based on php+mysql. I am novice only to jquery actually.
hey