2
votes

I'm creating a web application with desktop and mobile versions using ExtJS and Sencha Touch.

ExtJS 4 and Sencha Touch 2 use an MVC approach, and Sencha Touch 2 incorporates "profiles" for different devices (iPhone, tablet, etc.).

ExtJs 4, however, has no notion of profiles. Is it realistically feasible to for dependencies for desktop, iPhone, and iPad versions of the app to live under one vhost, in the same app directory hierarchy?

Or, is it generally more acceptable to use different vhosts for desktop (app.com) and mobile sites (m.app.com) when dealing with the Sencha frameworks?

2

2 Answers

2
votes

I recently had the same situation. I have a single c# controller that returns the desktop or mobile index.html based on useragent. It all appears as http://www.mydomain.tld and runs under a single IIS site. Since all the calls are AJAX to REST, they share the same server code. It's only the view that changes. The same could be done with any other server and language.

My structure is:

Root
 |_desktop
 |   |_app
 |   |_lib
 |   |_resources
 |_mobile
 |   |_app
 |   |_lib
 |   |_resources
 |_shared
     |_localization.js (generic JS objects)
     |_proto.js (my generic prototype functions)
1
votes

Right now, no it's not realistic to have everything in the same project.

Ext JS and Touch, despite having similar APIs, do not have the same API. Therefore you likely cannot share any code between the frameworks (currently Ext JS 4.1.3 and Touch 2.1.0 are the latest releases).

Therefore, since you're ultimately writing separate apps, I'd keep them totally separate code bases.

As for your domain/vhost question... you could configure your server either way, I don't know if that matters so much in my opinion.