1. #1
    Sencha User
    Join Date
    Aug 2010
    Posts
    55
    Vote Rating
    0
    TotoTitus is on a distinguished road

      0  

    Post "goodTalk" chat application, done in ExtJS. Criticism needed!

    "goodTalk" chat application, done in ExtJS. Criticism needed!


    Hello everyone, after more than a month of simultaneously coding and learning extJS i have finally come to an appreciable milestone in my project. I have to address thanks to the ExtJS community and developers, for creating this framework.
    Special thanks to Condor and Animal for their patience in answering the questions put up by me, even when my questions were plain dumb. Also special thanks to those who have helped me indirectly, most notably the person who created the CSS styles at extjs.fudini.net, superdit.com, pixel-mixer.com

    I have no professional experience in programming since i am a college student, so any and every advice and criticism, both constructive and destructive is appreciated, especially from seasoned programmers.
    Both Javascript and PHP code are present, and i will post here the pictures with the explained SQL.
    I will also post questions of my own regarding the project

    1) I use the same MySQL table both for registration, and operations in real-time done on the account. Should i use two tables instead?
    2) The project is intended to be a real-time chat based on ajax, polling each 0.5 seconds for new messages, and each 4 seconds for buddy status (online/offline), but that's inherently very taxing to the server. Should i change it to a pseudo real-time chat, updating new messages each 10 seconds? Would that be catchy?
    3) Doesn't the name 'goodTalk' raise copyright issues? Most notably with google's gTalk ?
    4) What visible (or covert) security holes are in the project. (I implemented prepared statements wherever needed, but then again, i'm a noob)
    5) Is that paypal donation button functional? (no, i'm not suggesting anything)
    6) Please suggest some cool free hosting/domain sites, if you know any.
    7) There still are bugs most probably, you might encounter them as soon as you try anything out, so...yeah.
    8) Anything else on your mind, like the code inconsistencies you might find.

    Thanks !

    goodtalk.zip - project
    images.zip - images, place in 'images' folder.
    EDIT: The SQL file contains an error, it creates the 'goodtalk' database, but then creates table for 'chat' database. Rename the 'chat' references to 'goodtalk', or the other way.

    Database images:

    Database overview, database table 'accounts', and database table 'messages'.
    db1.JPGaccounts.JPGmessages.JPG
    Last edited by TotoTitus; 14 Sep 2010 at 9:55 AM. Reason: Forgot to attach project.

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    89
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    I haven't tested your application (I don't have a PHP server), but I do have some remarks about your javascript:
    1. You should really consider using an Ext.Viewport to contain all components instead of rendering them to divs.
    2. Why are you using displayfields for static text? Boxcomponents have far less overhead, e.g. {xtype: 'box', autoEl: {cn: 'Talk:'}}.
    3. flex:0 is meaningless.
    4. this.items.get() == this.getComponent() (for readability?)
    5. If you are already using custom components, then I would create separate methods for handlers and listeners instead of inlining them.
    6. Javascript programmers usually follow the Java code conventions (only constants are all uppercase).

    Regarding polling:
    A chat application could really benefit from a Comet type connection, e.g. long polling.

  3. #3
    Sencha User
    Join Date
    Jan 2008
    Location
    Romania
    Posts
    23
    Vote Rating
    0
    chriss is on a distinguished road

      0  

    Default


    Pooling is a really bad idea for building a chat. Why don't you try to use web sockets?

    Take a look over this
    http://github.com/LearnBoost/Socket.IO
    http://www.pusherapp.com/
    and try to use some asynchronus language for the server ( like nodejs or ruby eventmachine )

  4. #4
    Sencha User
    Join Date
    Aug 2010
    Posts
    55
    Vote Rating
    0
    TotoTitus is on a distinguished road

      0  

    Default


    Thank you for your replies.
    @Condor: I will not be using a viewport since the UI hasn't gotten that complex yet
    I have thought of Comet before even starting this project. The reason why i did not implement it is that i did not have sufficient knowledge of it.
    I've read that you can implement it with ajax long polling, or hidden iframe thing, but Apache is terrible at handling multiple open connections, and since i'm using Apache, i reverted to simple ajax polling. I've seen places on the Internet (like the ones you linked, chriss) offering push functionality, but they always revolve around the idea of implementing a server for this. I use XAMPP Apache, with came installed in a very comfortable manner (Install -> Next -> Next -> Next -> Finish).
    I have no idea how to configure a new server from scratch, how to link PHP, MySQL and stuff like that to it, so that's why i did not opt (yet) for Comet. If any of you could give me advice here, it would be much appreciated.

    Thanks.

  5. #5
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    Own server is so easy ... http://www.apachefriends.org/en/index.html

    Condor - is there anything you know showing how to do such "Comet" technique with ExtJs?
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

Similar Threads

  1. Replies: 2
    Last Post: 5 Oct 2010, 7:18 PM
  2. Replies: 3
    Last Post: 28 Oct 2009, 6:38 AM
  3. Replies: 30
    Last Post: 20 Apr 2009, 10:03 AM
  4. replace the "south" with the "new Ext.StatusBar" in "layout:'border'"
    By ealpha in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 18 May 2008, 8:28 PM

Thread Participants: 3

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi