|To main page | Opera Unite HowTo's|
Intro: Web Apps with Opera Unite
Maybe you were looking for From PHP to Opera Unite ? (I don't know why Google thinks this is the relevant page and not that one.)
In a nutshell: if you know PHP/MySQL, you're probably already too advanced for Unite (no grinding), but for the rest of people - Unite is a great way to develop Web Applications.
If you ARE advanced user - that won't stop you from creating a simple local helper app, like billing for your customers that only you would use.
If you're too advanced - see "Future" section below, point #3.
If you haven't tried Opera Unite → yet - go do it. It's basically a browser with a button "Run a web server on my computer", you push it and instantly your visitors can access whatever you share - music, movies, etc.
Web Apps?But this won't impress your regular PHP guy. Here's a kicker:
Also Opera's JS engine is lightning-fast, so I guess it's JS can easily compete with PHP and without calls to MySQL - it's even faster.
There's a problem of size though. You can't build a Flickr-sized service on your local computer. But, actually, you don't need to. You can prototype/build a service that is "you"-centric. For example - you and millions of other users are using Flickr to show your pictures, so Flickr needs to be huge to handle the load. But when you take those images back from cloud and build a local (but availble from Web) photo-sharing service, you need to serve only a handful of users, therefore the amount of data is not that big and can easily fit into memory. And it it grows - there's an option of growing with local databases that have REST interface.
If you want to jump start, glance at Basic HowTo.
There is a number of problems though.
Concerns1. When you close Opera - service is closed. Probably solvable with things like TrayIt.
2. Security. I do really trust Opera with security stuff - they've been more than reliable in that matter, but still, maybe it would make sense to run Opera inside of some controlled environment, like local virtualized VMWare.
3. Performance. Probably not an issue, since you're going to only serve a handful of users. If you need to server more - well, then you need to move to a bigger language, like PHP & MySQL (as a first step). But since there are many services that aren't moving beyond the point of serving <100 visitors a day - Opera Unite seems to be a great way to prototype things withough having to deal with PHP/MySQL/DNS.
4. User-friendly URLs. http://my.login.operaunite.com isn't a great URL to start with, and http://my.login.operaunite.com/test/service is even worse. So I need to figure out how to hide it behind real_domain.com. One way could be to use framed domain, which is a service many registrars offer. (You can't use CNAME's, that's for sure. Maybe some kind of VPS-hosted proxy? maybe nginx?)
Possibly a problem?5. Persistence. Opera Unite primer → doesn't show how to store data after Opera is closed (or after service is stopped), but since they have sandbox filesystem, this should be possible.
ConclusionsIs Opera Unite for everybody? I'd say "no".
Compared to PHP/MySQL (or other server-side languages) it's like Google SketchUp vs 3DSMax - you can create complex models in SketchUp, you can even use it for game modelling, etc, but your regular "professional" will dismiss it as it isn't advanced enough. But SketchUp is highly popular among non-professional 3D modelers, like architects or wood-workers.
Likewise, Unite isn't "advanced", it's simple. It's meant to do simple things, that are browser-owner-centric. I believe it will achieve those goals.
The professional web developers won't use it, but guys, who just want some simple stuff - will. Given the speed of JS engine of Opera - I'd say those "simple" things will be complex enough.
But, no denying it - it's probably a great prototyping tool and maybe even for solving small local tasks (like my own client billing, which is written in Django and works on localhost, probably could be replaced with Opera web app in much-much less code).
1. Damn simple - simple counter app is 15 lines of code
2. Has templating library
3. No problems with maintaining your DNS entries
3a. No problems with routers/NATs
4. Zero-configuration (vs httpd.conf & mysql.cnf)
5. Opera with Opera Unite = 7Mb (Google Chrome is 17MB)
6. 2 languages (HTML/JS both client-side and server-side) vs 4 languages (HTML/JS
for client-side, PHP/SQL for server-side)
7. Number of libraries → available, even for graphs (incl. charts for output), feed readers →, animation, multi-page help and even web scraper →. All this can be used "server side" (i.e. on your computer). Seems like no installation required.
8. Your visitor is free to use whatever browser he wants to (no need to install Gears or plugins like AIR).
9. Cross-platform → runs on Windows, Unix, and Mac.
10. All your data belongs to you and stored on your computer (as opposed to storing data in the "cloud")
11. Three ways of distributing your app:
- upload it to unite.opera.com (but you can't delete it, if it gets approved)
- just ZIP IT and distribute yourself, user would just drag-and-drop the file
- Serve a zip from your webserver with "Content-Type: application/x-opera-uniteservice; charset=UTF-8" header.
Disadvantages1. If Opera is closed - web app is unavailable too => need to keep computer on 24/7
2. User-unfriendly URLs
Future1. If they ever plan to implement this on Opera Mini - it would be the day my phone would start being a web server. Might be stupid, but awfully fun.
2. Cross-platform web server? Opera runs on many platforms, including Mac and Linux.
3. I'm pretty sure somebody would soon develop some kind of real web server for production Linux/FreeBSD use, probably like noss@HN points out → V8-based.
So, like Google App Engine you would develop an app on your local computer and then push-button deploy it to production server.
See alsoBasic HowTo