Results 1 to 7 of 7

Thread: Bandcast (my first Sencha Touch app)

  1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    3

    Default Bandcast (my first Sencha Touch app)

    I just finished my first Sencha Touch app, called Bandcast, which I created for the HackLolla competition.

    http://m.bandca.st
    You can log in with username and password "demo".

    The goal of it is to help you organize and connect with your friends at Lollapalooza. You can send status updates, tips and private messages, share schedules, find friends, and easily connect with new friends by scanning their unique QR code.

    The non-mobile site is here.

  2. #2

    Question Could you release the source please?

    Hi ln8r!

    I am new to Sencha Touch and trying to figure out how to create a login panel that appears in a model window very much like your app Bandcast. I like how you force the user to log in before they can access the web app. Would you please be willing to send me your source so that I can see how you have created this functionality and also so I can see how you authorize permission through that FormPanel? Do you call upon a SQL directory to verify that the user has permission/credentials to login to the web app? I would GREATLY appreciate being able to see the source. Thank you!!! App looks great and I'm just trying to implement my own log-in functionality to the start of my app.

    -Kyle

  3. #3
    Touch Premium Member
    Join Date
    Jan 2011
    Posts
    37

    Default

    kdaffolder: you can just de-obfuscate the javascript: http://pastebin.com/uF50X67Y

  4. #4
    Sencha User
    Join Date
    Jun 2011
    Posts
    3

    Default

    I use a custom login API that I wrote (which uses PHP and SQL) to handle the login system. The deobfuscated JS that colworx posted covers all the Sencha-specific code. I sort of fumbled my way through building this, relying on the examples they provided, and I tried using the MVC approach but it seems like not everything is set up for MVC (tab panel, for example) so it's a bit of a hybrid. Also the routing doesn't work so well with this setup so I had to sort of hack that. So while this definitely works, it may not be "right". But then again, it doesn't seem like there is a right way to do anything because all the examples are pretty different.

    If you look at the pastebin code you can see at the top there's a setup and an authorize function. Those are the first steps in authorizing the user. The setup function creates a "before-dispatch" listener that runs every time a page is loaded and if there's no sid (session ID) then it will destroy the viewport and run the authorization system. It also passes the current URL to it so the user can be redirected back to where they came in.

    There's an auth model, auth controller and several auth views also in the pastebin code. I had to hack the auth model system a bit because it's not a straight CRUD system. The PHP login code returns JSON data with sid (session ID), cookie (a standard authorization cookie) and user (some user data like user ID, username, etc). For each subsequent API request I pass the session ID and cookie data to the API and then the API verifies each request with that info. You can see that happening in the Ext.data.BandcastProxy class.

    There's a lot of stuff going on and it's sort of intertwined so I'm afraid I can't just pick out the auth system and give you a shell to start working with, but hopefully you can pick it apart and figure it out.

    Here's a stripped down example of the JSON returned from the login API call:

    {
    "success" : true,
    "cookie" : "1:e151e22196c826bc18e75a67c04b895c",
    "sid" : "vrs59lhl2j50cbvh3u9qs1tli1",
    "user" : {
    "displayname" : "Elenor",
    "id" : "1",
    "username" : "elenor"
    }
    }
    Last edited by ln8r; 20 Jul 2011 at 2:21 PM. Reason: Added example JSON

  5. #5
    Sencha User
    Join Date
    Jul 2011
    Location
    Holland
    Posts
    98

    Default

    Looks good. Can you upload a copy of the source code? Would be interesting to take a look at how you did a few things in there. Since it's open source software I reckon it shouldn't be a problem? Thanks.

  6. #6
    Sencha User edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939

    Default

    Very nice, though you're pushing it a bit with the number of items in that grouped list... look for that to get a lot better in 2.x though
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  7. #7
    Sencha User jayrobinson's Avatar
    Join Date
    Jan 2010
    Location
    Palo Alto, California
    Posts
    194

    Default

    Great work for your *first* Sencha Touch app, Ln8r. I can't wait to see what you come up with in the future!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •