views:

99

answers:

5

I have an unusual situation - I have an embedded video streaming device with a complicated UI, and I need to use an embedded web server to reproduce that UI through a web browser. I'm thinking of using JavaScript/JQuery on a C++ backend (I am NOT coding all this myself, I need to hire people for the grunt work).

The embedded web server is much less powerful than a PC, so I want to write an application that runs the entire UI in the browser, and only communicates with the server to pass new program settings back and forth, get status updates from the device, and control video playback.

In other words, the client gets one big page or a small number of big pages (effectively downloading the application), the application maintains significant local memory storage, and once the pages are first loaded the server never sends anything layout-related.

The application has two rows of tabs to navigate ~40 menu pages, drag-and-select controls to pick cells in a grid, sorted lists, lots of standard data entry options, and it should be able to control up to 16 embedded video players at once (preferably VLC).

Is this possible in JavaScript/JQuery with a C++ backend?

+1  A: 

It's definitely possible. Look into Jquery's AJAX framework for communicating with the server, and then look at some C++ web toolkits for making some lightweight web service controllers.

Jweede
+1  A: 

Everything is possible.

Is it worth it? Depends on your requirements. Keep in mind:

  • You'll have to have some kind of application server support. Coding it by hand will take resources.
  • You'll also have to update the c++ executable on the embedded device. You may potentially end up supporting multiple devices. So this can be a problem if a number of supported devices grows.
  • c++ engineering resources are typically more expensive (and with cheap c++ engineers you'll pay 2x in bugfixes) vs php/ruby/perl developers on the server.
Zepplock
Remember this is an embedded web server, like I said it is much less powerful than a PC. PHP barely fits in memory and Perl's performance is not tolerable. That's one reason I want to have complicated "web stuff" done on the client, so the server just has to do video streaming, interface with the device firmware, etc.My thought is to extend the device's local Qt application to have more server-friendly APIs, then have a thin C++ layer running under the Lighttpd web server.
Ian
My 3rd bullet was meant to be "php/ruby/pearl on the server side, not embedded". Aside from that implementing http server is very easy (read transport), but providing application support is more complex. Overall it boils down to thin/thick client conversation.
Zepplock
A: 

You might want to take a look at using Dojo as opposed to jquery. Its really gear more towards this type of thing. By no means does that mean you couldnt do it in jquery, Dojo is just better design IMO to create an entire JS application. Of course it should be noted that this also makes its usage much more complex than jQuery's.

prodigitalson
+3  A: 

Ext JS would save you a lot on the UI side, it can be used to create very complicated layouts with rich controls in very little time. It even has its own graphical editor where you can create the UI prior to adding handlers.

Its API Documentation is also very good, its far better than most other libraries.

And for the rest, well, I'm pretty sure that there are ready made webservers that you could look into; take a look here - most of these can probably expose a CGI application.

Sean Kinsey
Thanks for the link, Ext JS looks like it might be very convenient because of the number of predefined UI elements.
Ian
But to beat the rest, it does have its flaws, but none bigger than any of the other libraries...
Sean Kinsey
A: 

You might instead consider a rich client technology like Silverlight. Complicated UI is what it's built for and the development experience is much nicer than most other options.

Silverlight doesn't require .NET on the server and can easily communicate over simple REST or SOAP services (see gSOAP).

hemp
However Silverlight does require a client-side plugin, and especially on Linux I don't want to require users to install plugins. JavaScript comes with every browser and "make sure JavaScript is turned on" isn't much to ask of people who want to use the app.
Ian
That wasn't stated anywhere in your question. I think the downvote is a little harsh.
hemp
I didn't downvote it, I'm not registered with this site. However I do think that requiring the client to install a plugin is something unusual that should be mentioned.
Ian