What is the best way to use a database (be it Redis, SQLite, WebSQL or just about anything actually) from a UWP app being developed in HTML5/Javascript? For a C# or VB.NET app I guess it would be quite easy, since you can just use stuff like this. But how would I do that for a JS-based app?
I guess one option would be to do a wrapper C# project and use that as a data layer (since I believe my JS/HTML project can invoke methods in my other projects in the solution). Is that the best/easiest way or are there any other really good options that I'm missing somehow? It feels a bit clumsy, since I would prefer a solution with 100% Javascript in this case.
You could use IndexedDB in UWP javascript apps.
You can easily find samples online (here for example) and relevant MSDN documentation is here.
Related
There's a specific app that I want to make, and I was wondering if I can use JavaScript to code it entirely.
There are a number of frameworks out there that let you write your code in HTML, CSS, and JS and then compile/build apps to native devices I for instance Apache Cordova or Phone Gap do this.
Choices are countless. Try Cordova for hybrid app development.
You're most likely thinking of a single page HTML5-based "app".
(though it's arguably not an app, it's just a web page).
These are often built using frameworks such as Angular, Backbone, or Ember.
Watch out, there's still constant debate on the merits of HTML5 vs. native apps.
Currently, we have a number of GUIs that have been developed using PyQt4 and PyQtGraph.
We need to make these interfaces accessible to a number of remote users and are hoping to do so by serving the GUIs through an HTML/CSS/JavaScript Web-Application.
The link below provides a few suggestions for this task, but these seem to apply to a project that is in its initial stages of creation. I'm familiar with the development of Python-JavaScript Web-Applications using the Pyramid Server and would like to use this same method for providing users access to PyQt4 GUIs that have already been developed.
https://softwareengineering.stackexchange.com/questions/109572/can-i-create-a-desktop-python-gui-application-and-run-it-as-a-web-app
So my question is, can I serve a functional PyQt4 GUI as a widget using HTML/CSS/JavaScript?
This is hard. In theory you could use a VNC-like approach that sends an image of the window to the client browser and sends user events back to the server. This will probably have poor interactivity depending on the networking and would require a lot of server power, depending on the number of users. (For an example of this, see: https://github.com/campagnola/webqt)
You're probably better off distributing the application with something like py2exe, py2app, cx_freeze, etc.
I personally haven't tried it but you could look into Wt: http://www.webtoolkit.eu/wt/
It is a C++ framework that has a Qt flavour. It has a Java version called JWt. Hence, a Jython binding exists for us Python programmers: http://www.webtoolkit.eu/wt/other_language
It is not a direct replacement of Qt, and might need modification to your Qt code to work as a Wt web app, but it certainly seems worth it to look into.
I've been working with Node+Express for a while now, and I'd like to start looking for a strong structure for building average to huge web apps, but which could also be used (and not be too much overkill) for simple websites.
I've been taking interest for backbone, but I'm looking for something much more "complete" already. I Know backbone can do everything with the right plugins and by respecting the best practices, but what I'm looking for is something more "strong" as is and from the start, like AngularJS, CanJS or Ember (maybe CanJS is the best compromise between flexibility and conventions althought all of this can be mostly subjective).
Just to be sure to keep into the best practices, even if I must stick to an opinionated FW.
Now, before choosing anything, and because I'll be using Node in the backend, so full JS, I'd like to know if there is a framework which would deliver client+server MVC capabilities, or if I must use Node/Express in the back and something else for the front.
Other info that may be useful, I'd like to code in CoffeeScript/LESS, and keep HTML as is (so no Jade-like stuff). If I'm not asking too much, I'd like to use this technology for all of my projects, which will be targeting also mobile phones, as websites (for sure), and sometimes even as Phonegap-based apps. Maybe this becomes hard (Meteor doesn't support Phonegap for it's client-side part for what I've read, maybe Derby ?).
Also, I must point out that I'm not asking anything subjective like "what is the best between ..." but simply if full client+server MVC JS framework exists, and if yes, which ones meets those needs.
rendr (backbone with server-side support)
meteor (very real-time oriented)
Meteor and DerbyJS seem great but very real-time oriented, I am not going for those.
I think I'll use TowerJS which seems to have really great features (live JS/CSS injection in browser when files updated, live node files reloading without restarting, pre-built development, staging and prod environments, MVC+ORM client+server-side, Redis for temp data and Mongo for DB...).
For Phonegap projects, I'll keep tower server-side and I'll find something else for the client, maybe simple backbone.
Take a look at the ExtJS 4. Also there is Sencha Touch 2 for mobile app development. Both of them has strong support for MVC.
sails.js is the most popular node.js MVC framework nowadays, and has a huge and growing community.
Meteor is also a great tool; my experience with the extjs community is that they are not very welcoming (rtfm noob! type of stuff).
I am quite a novice when it comes to web application development. The projects that I have done thus far have purely been Client Side and Jquery powered.
Recently I made a discovery that Javascript has an MVC framework (http://backbonejs.org/)
This really excites me as about 90% of my experience to date has been with Javascript, so the possibility of using an MVC framework within a familiar coding language is actually quite awesome.
After some more reading and probing I discovered a local storage adapter for backbone:
http://documentcloud.github.com/backbone/docs/backbone-localstorage.html
Basically if I have understood this correctly - it will store and retrieve data in cookies
So the above framework (backbone) and addin (local storage) will allow web applications to operate in a "server-less" environment.
Before I get crucified by any techies - I do understand that this is a very generous, generic and simplified statement - but I am just trying to find out a few things at this point:
Is my understanding of the framework correct?
Has anyone had any development experience with the above?
Where can I get novice level tutorials on developing MVC Web applications that use Backbone.js
Looking forward to the discussion and your answers
Is my understanding of the framework correct?
First off there are several "mvc" like frameworks for Javascript besides for Backbone.js (assuming you consider backbone.js an mvc framework, take at look at this SO question as well as the official documentation) for example Ember.js, Knockout.js, JavascriptMVC. That said local Storage is a feature of HTML5 and isn't specific to backbone.js (so the browser would need to support it, here's a SO question with some more info on localStorage), what the backbone.js localStorage adapter does is saves the backbone.js data to localStorage instead of the server.
Has anyone had any development experience with the above?
Yes (you can take a look at the questions tagged with backbone.js here on SO for starters...).
Where can I get novice level tutorials on developing MVC Web
applications that use Backbone.js
Have a look at this site for some backbone.js tutorials.
I'm wondering if using Node.js (express.js) is the best option to go for a complete website. I've been using Rails + Node.js and am wondering if this is still the best option or if I should move completely to Node.js.
Are there websites built completely with node.js? I imagine it must lack many things Rails offers.
I imagine it must lack many things
Rails offers.
I gave a short list below but I would like to know what you could be missing and I think(almost certain) we can give you some alternatives on node.js.
Modules
node.js is getting pretty complete and I think you can run your entire site using only node.js using for example the following modules. I assume you know about npm. If not I really advice you to google for it and learn that. To search npm you can use http://search.npmjs.org:
web framework:
High performance, high class web
development for Node.js
https://github.com/visionmedia/express
Socket.IO aims to make realtime apps possible in every browser and mobile
device, blurring the differences
between the different transport
mechanisms.
https://github.com/learnboost/socket.io-node
I believe with these two web-frameworks you can create a lot of sites. For example express is a very powerfull web framework and supports a lot of cool things like:
session support.
a lot powerful template engines. I like Jade for example. You could also share these between client and server a lot of the times easily.
excellent routing.
just to name a few.
database:
Redis is an open source, advanced
key-value store. It is often referred
to as a data structure server since
keys can contain strings, hashes,
lists, sets and sorted sets.
https://github.com/mranney/node_redis
MongoDB (from "humongous") is a scalable, high-performance, open source,
document-oriented database.
Mongoose is a MongoDB object modeling tool designed to work in an
asychronous environment.
https://github.com/learnboost/mongoose/
With those two databases I think you should be able to accomplish most of your tasks. The nice thing is that Redis is extremely fast/simple advanced KV-store(dataset in memory/also supports VM) and supports replication while Mongodb is more completely(slower then redis) and also supports sharding.
authentication:
Authentication and authorization (password, facebook, & more) for your node.js Connect and Express apps.
https://github.com/bnoguchi/everyauth
Like I said previously you can get a long way with only these modules.
Express.js is more akin to Sinatra. They're simpler frameworks than rails.
Express's list of sites is fairly small http://expressjs.com/applications.html
So I think it's also good to look at Sinatra's list http://www.sinatrarb.com/wild.html
So to answer your questions in reverse order. Yes it lacks all the features of rails. Yes there are sites written completely in Express. And going to 100% Node.js might be the right decision for your site.
It depends on which features you'd miss and what performance you need.
I'm not sure, but I guess it's perfectly possible. I have built complete sites using plain server side javascript for years without problems. The advantage of node.js seems to be its event driven model and things like socket.io. I just started experimenting with it, I'll probably will try porting an existing site to node.js.
Here you can find a large list of sites built with node.js.
Finally, you may want to read: What it’s like building a real website in Node.js
Yes, as of now node.js lacks many (well, at least a few) things rails offers. Eventually the set of available node.js modules will collectively provide good alternatives to RoR across the board. Or at least different (and often more modern) approaches to the same fundamental problems. There are still some important things missing in the node.js ecosystem including a good ORM for postgresql (rails has ActiveRecord which is great) and a good DB schema management subsystem. Both of these do not exist in the node.js ecosystem as of this moment, but surely they will be there in due time. Rails has these down pat right now.
There are some tricks node.js has that RoR doesn't. Debugging in node.js is more seamless than RoR and express.js is more flexible. Express is the library approach (you tell it what to do) whereas rails is the framework approach (you fill out the boilerplate it creates for you). There are also some fantastic things like stylus and jade, which have equivalents in rails, but when you have a full app written in one language (either javascript or CoffeeScript, which I prefer) and everything is in a modern node.js/TJ Holowaychuck style, you get a level of cohesiveness that is really nice to work within.
The other thing to keep in mind is that while the list of available node.js modules is quite impressive, many of them are not as mature and battle-tested as their rails/django analogs. It's hit or miss, so beware.