What is this?
This is a feature-complete anonymous chat application.
Why are you doing this?
To make a point about how high performance scalable web applications should be implemented in PAAS. It uses Google Appengine, but the ideas applied here can be useful in many other cases.
Where is the source code?
In this github repository.
But there are rough edges everywhere!
I know. I did this for fun, and I don't care about your opinion unless you are willing to help.
How do I create a chat?
Go to the Your Chats tab, and log in with your Google account. You have to give a name to the chat, and configure it a little.
If you make the chat private, it won't be listed in the home page, but it will be listed in User page, and anyone can access it if you send them the link. Chats that are not persistent are deactivated after all connections to it are closed. By deactivating I mean that they are no longer listed anywhere, but you can still find them with the link. Have that in mind if you care about your privacy. You can ask the application to save all the messages of the chat, and you will be able to download them anytime in JSON. Finally, you can activate the support for private rooms, and any user of the chat will be able to send private room invitations to any other user.
How do I embed a chat?
Once the chat is created, it will appear in the list of the recently created chats in the User tab. In the corresponding row, there is a button to generate the embedding code, with an iframe tag. Feel free to configure the size that fits your needs, and you can paste that code in the HTML of the page of your choice.
If it runs on Google Appengine, who is paying for this?
Me. But It's not an expensive application to run. Really, and that was the point. You can build applications that handle lots of concurrent connections and traffic, and spend less than 1$/day. If I ever get tired of supporting this, I will leave it with the "free" account, that handles about 6K messages/day.
You have my attention now. How does it work?
It's just an example on how to implement soft-real-time application in a PAAS. If you have an efficient messaging platform, it's that easy.
The messages are sent through appengine's channels . Any other efficient asynchronous transport could be used, but I don't have the time to configure and deploy stuff. The browser is used as a client to the last consequence, since all the data of each page is sent to the AngularJS templating engine asynchronously with the requests library. This scheme has an additional benefit. The application gets feature-complete REST API, and anyone can write a chat client, as long as the client is in Javascript and can load the channels.
If you look at the code, there are some examples on how the Google's key-value database is used efficiently thanks to a good application design, and how the information that goes through the wire is minimized all the time.
There are some performance-wise technical decisions, but if you know me in the Real World®, high performance computing is what I do for a living.