Results 1 to 8 of 8

Thread: Best Server side solution for Sencha Touch apps

  1. #1
    Sencha Premium User
    Join Date
    Mar 2011
    Location
    Birmingham, UK
    Posts
    46
    Answers
    1

    Default Answered: Best Server side solution for Sencha Touch apps

    Just wondering what would be recommended for the server side jobs of writing or retrieving JSON data for a Sencha Touch app?

    I have been developing a google map based Sencha Touch app that currently reads in JSON from a static json file to plot markers, etc. The next phase of the development is an admin area for the app to manipulate the JSON. To begin with I was looking to use CodeIgniter and maybe saving to MySQL but I'm not sure such a complex architecture is required. All I want to do is bascially persist JSON data and not have to upload a lot of PHP and set up databases etc. for such a small task. I am thinking of using Sinatra and maybe heroku as the fast development and scalability is appealing as there will probably be multiple instances of the site running for different client requirements. I am even looking at Mongo DB for the database as again the apparently easy config, isolation and manageability sounds good, but Sinatra , Heroku and mongo DB are all new to me. Before I take the plunge I was wondering what other Developers have used and what would be recommended?

    Thanks

  2. I am using Node.js on the Heroku cedar stack and I love it. Javascript development on the client and server side. Basically, you have gem support as well as the node.js ecosystem. I am using express as my routing package. Adding in the nodeinspector package allows you to have the identical debugging strategy for client and server code (server side debugging in the browser). Good luck with whatever application stack you choose.

    https://github.com/joyent/node/wiki/modules

  3. #2
    Sencha Premium Member
    Join Date
    May 2008
    Location
    Pasadena, California
    Posts
    172
    Answers
    27

    Default

    I am using Node.js on the Heroku cedar stack and I love it. Javascript development on the client and server side. Basically, you have gem support as well as the node.js ecosystem. I am using express as my routing package. Adding in the nodeinspector package allows you to have the identical debugging strategy for client and server code (server side debugging in the browser). Good luck with whatever application stack you choose.

    https://github.com/joyent/node/wiki/modules

  4. #3
    Sencha Premium User
    Join Date
    Mar 2011
    Location
    Birmingham, UK
    Posts
    46
    Answers
    1

    Default

    Many thanks NickT. It sounds a good solution you have setup. I especially like the idea of js both sides and glad you mentioned NodeJs as this is something thats been on my radar for some months. I'll have a good look through what you propose and see if I can get something going... Thanks again for taking the time to post this.

  5. #4
    Sencha Premium User
    Join Date
    Mar 2011
    Location
    Birmingham, UK
    Posts
    46
    Answers
    1

    Default

    I have been looking at Node.js and have followed this http://devcenter.heroku.com/articles/node-js tutorial from Heroku to get something basic deployed. I have hit a stumbling block as I'm on Windows and Foreman doesn't work on Windows https://github.com/ddollar/foreman/issues/41. Do you know of a way to deploy to heroku cedar without the need for foreman? If not this looks like a majr problem for me, and was wondering if I could use Sinatra with sencha touch as a stack. I guess you can but Node.js appears a neater solution.

  6. #5
    Sencha Premium Member
    Join Date
    May 2008
    Location
    Pasadena, California
    Posts
    172
    Answers
    27

    Default

    Hello, lalexgraham,

    https://github.com/ddollar/foreman-windows


    This is a link to a windows compatible implementation of foreman. Give this a try. If you continue to run into issues, comment back on this post and we can work toward a solution.

    Nick

  7. #6
    Sencha Premium User
    Join Date
    Mar 2011
    Location
    Birmingham, UK
    Posts
    46
    Answers
    1

    Default

    Thanks for this. Will have a look when I have a spare few hours and let you know how I get on.

  8. #7
    Sencha Premium User
    Join Date
    Mar 2011
    Location
    Birmingham, UK
    Posts
    46
    Answers
    1

    Default

    Hi, I've downloaded code and am now running Foreman for Windows. Thanks for the tip. Unfortunately I have hit an issue with following the heroku tutorial for node.js that I can't seem to resolve. I think I have done everything asked to create the Hello World app. So, off root, I have the following file structure

    /
    |-web.js
    |-node.exe
    |-package.json
    |-Procfile
    |-.gitignore
    /node_modules/express

    In /node_modules/express I have the same files as in another test application with just the following structure:
    /
    |- web.js
    /node_modules/express

    which works fine when I execute through "node web.js" command.


    When I select the Procfile in Foreman of the HelloWorld app, I get the following error:

    Code:
     00:00:00 web    |  starting: node web.js
     00:00:00 web    |  
     00:00:00 web    |  node.js:207
     00:00:00 web    |          throw e; // process.nextTick error, or 'error' event on first tick
     00:00:00 web    |                ^
     00:00:00 web    |  Error: write EINVAL
     00:00:00 web    |      at errnoException (net_uv.js:566:11)
     00:00:00 web    |      at Socket.write (net_uv.js:389:18)
     00:00:00 web    |      at Object.<anonymous> (console.js:26:18)
     00:00:00 web    |      at HTTPServer.<anonymous> (C:.js:11:11)
     00:00:00 web    |      at HTTPServer.emit (events.js:88:20)
     00:00:00 web    |      at Array.<anonymous> (net_uv.js:645:14)
     00:00:00 web    |      at EventEmitter._tickCallback (node.js:199:26)
     00:00:00 web    |  process terminated
     00:00:00 system |  stopping all processes
    Hardcoding the port number
    Code:
    var port = 3000;
    solves the problem but Heroku cannot work with a fixed port number as I discovered. I've googled this problem with nothing found so far. Any suggestions would be welcome. Is it how I have structured my node_modules folder? I use this method to replicate NPM as suggested in this post , but instead of putting the dependecy in the root, I put it in a subfolder named node_modules. I use this subfolder because of this post, but I have found in previous test apps I don't need the lib subfolder. I have tried using express folder in the root of the HelloWorld app and placing node_modules subfolder in a lib subfolder but neither of these worked either. Thanks

  9. #8
    Sencha Premium User
    Join Date
    Mar 2011
    Location
    Birmingham, UK
    Posts
    46
    Answers
    1

    Default

    Hi Nick T, since the last post I decided to abandon Windows and start afresh with Ubuntu as it seems there were more tutorials out there and foreman, npm etc ran from the terminal. I put together a simple app to get started. My post about it is here . Now I have a basic understanding of heroku, node.js and mongoDB, I'd like to implement it all with a simple sencha touch app. Any pointers on helpful tutorials out there ? I'm thinking of doing something similar to this as it uses MVC, which I'd also like to learn.

    Thanks

Tags for this Thread

Posting Permissions

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