JGate Blog http://blog.jgate.de JGate - The easiest way to get your ideas online. posterous.com Sat, 25 Jun 2011 08:03:00 -0700 A Native OpenID Consumer For AppJet http://blog.jgate.de/a-native-openid-consumer-for-appjet http://blog.jgate.de/a-native-openid-consumer-for-appjet

There are many advantages when a site offers OpenID or OAuth for login. Signup is instant and the users don't have to rember a new user name and/or a new password. For additional security an user can opt for two-factor authentication, which is offered by Google's federated login.

When a site accepts passwords, it is responsible to keep them secure. As many users reuse passwords, a security breach can cause broader damage, if a site uses unsalted hashes or wrong hash algorithms.

When using OpenID, there is no need to store any passwords. There are ready-made solutions for nearly every programming language. See: http://wiki.openid.net/w/page/12995176/Libraries

We added openid4java to the AppJet native API so that every AppJet application can now use OpenID and act as an OpenID consumer. The lib-login library can be used as a drop-in replacement for the lib-rpx library which does the same but relies on a third-party service (Jan Rain). Lib-login additionally supports Twitter's OAuth variant for authentication.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal
Sat, 30 Apr 2011 12:00:00 -0700 Closure Templates for AppJet http://blog.jgate.de/closure-templates-for-appjet http://blog.jgate.de/closure-templates-for-appjet

For a new web project we decided to go for a template solution as a replacement for AppJet's print tags. The print tags are fine, they ensure well-formed HTML code and are easy to handle. By using them however HTML code tends to get mixed up with application logic, something we didn't want for the new site.

EJS in AppJet 2

AppJet 2 (Etherpad) uses EJS, an engine normally used on the client side. By using AppJet's JavaScript engine these templates can be evaluated at the server side. A great solution.

Closure Templates

After evaluating different templating tools we decided to give Closure Templates a try. Google is making some real strong statements about it:

  • Easy to read. You can clearly see the structure of the output HTML from the structure of the template code. Messages for translation are inline for extra readability.
  • Designed for programmers. Templates are simply functions that can call each other. The syntax includes constructs familiar to programmers. You can put multiple templates in one source file.
  • Battle-tested. Closure Templates are used extensively in some of the largest web applications in the world, including Gmail and Google Docs.

The engine comes in two flavors, a compiler that generates client-side JavaScript and a Java library for server-side use and that one is a perfect fit for AppJet which is running on the JVM.

The Solution

We added the Closure Java library and have built a corresponding JavaScript library named lib-soy. Have a look at it to see how the templates are separated from the code in an extra section called /* appjet:soy */. The lib also includes the original sample from Google's tutorial:

/**
 * Greets a person and optionally a list of other people.
 * @param name The name of the person.
 * @param [additionalNames] The additional names to greet.
 */
{template .helloNames}
  // Greet the person.
  {call .helloName data="all" /}
  // Greet the additional people.
  {foreach $additionalName in $additionalNames}
    {call .helloName}
      {param name: $additionalName /}
    {/call}
    {if not isLast($additionalName)}
        // break after every line except the last
    {/if}
  {ifempty}
    No additional people to greet.
  {/foreach}
{/template}

This example demonstrates some important concepts of Closure Templates. Hierarchical templates, template parameters, iteration and conditional templates. Enough to get started. Just include lib-soy and you are ready to use soy templates in your own apps.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal
Tue, 04 Jan 2011 15:29:00 -0800 All Systems Go http://blog.jgate.de/all-systems-go http://blog.jgate.de/all-systems-go

CouchDB is up and running. It's time to Relax!

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal
Mon, 03 Jan 2011 05:33:53 -0800 New AppJet And CouchDB Hosting http://blog.jgate.de/whats-next-for-2011 http://blog.jgate.de/whats-next-for-2011

We have been busy working on the hosting platform to bring it to the next level. AppJet.jar and CouchDB make a great couple and offer a solution for building more "serious" applications. From now on CouchDB will be the main database for AppJet apps, offering some great advantages, technically and for you as a developer:

  • Flexible, scalable and increased storage
  • JavaScript everywhere (server, database and client)
  • A built-in data administration GUI
  • A flexible security model for your data
  • Support for attachments (css, templates, images etc.)
  • Two-way replication for mobile apps, off-line apps and new use cases
  • A strong and active community
  • Excellent documentation in form of books, presentations, and more
  • No lock-in. Take your data and programs where you like.

CouchDB's RESTful interface and JSON format fit nicely into AppJet's programming model. For an example see the couchdb-test app and it's source.

And the best part: Free CouchDB hosting will start very, very soon for every developer on JGate.

Couchdb-admin2

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal
Thu, 30 Dec 2010 03:37:56 -0800 Appjet Server In A Jar - Now On GitHub http://blog.jgate.de/appjet-server-in-a-jar-now-on-github http://blog.jgate.de/appjet-server-in-a-jar-now-on-github

Appjet.jar has now a new home on GitHub. We have committed the original version as well as our additions, so that you can see our changes.

We have also prepared a Wiki, a Tracker and a binary distribution of appjet-1.0.4.jar.    

Jarlogo
Download

appjet-1.0.4.jar -- Dec 12 2010 20:47:10 GMT+0100

Running an application

$ java -jar appjet-1.0.4.jar myapp.js

That's it! myapp.js should contain the same JavaScript code that you would use for an app hosted on apps.jgate.de.

For full instructions have a look at the wiki.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal
Sun, 19 Dec 2010 13:57:00 -0800 Introducing The New AppJet.jar Version 1.0.4 - Now With a CouchDB Client http://blog.jgate.de/introducing-the-new-appjetjar-version-104 http://blog.jgate.de/introducing-the-new-appjetjar-version-104

Today we are announcing a new version of appjet.jar. As you know, AppJet Inc. has focused on other things and there have been no updates to the framework since 2008. Many links of the old jar still point to the appjet.com domain, which has been shut off since Google's takeover. Despite missing images some pages show some strange behavior due to the missing jquery.js library. For instance the callstack cannot be displayed anymore and footer links point to nowhere.

We have corrected all this plus we added an updated RESTful client. You can now use the platform to build RESTful servers and clients with GET, POST, PUT and DELETE methods, like the new CouchDB client. The new client allows it to talk to local and remote CloudDBs, like those offered by Cloudant.

Talking To CouchDB

See the couchdb-test application for details. You can use the public demo db also for you own tests. We will soon offer a private CouchDB addon for every user.

Apache_couchdb_relax

CouchDB offers dozens of new use cases. You can free your data, replicate databases across the Internet, talk to the database backend directly from the browser and many more.

Future Proof

All the new features can not only be used on our hosted platform, we will open source our additions and offer a new AppJet in a Jar distribution so that you can host your own server and use it as a local server on your development machine. Stay tuned.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal
Thu, 30 Sep 2010 12:03:00 -0700 Details On JGate's New Caching Layer http://blog.jgate.de/details-on-jgates-new-cache-layer http://blog.jgate.de/details-on-jgates-new-cache-layer

With the latest change, we added Varnish as a caching reverse proxy. Varnish is often called a "HTTP Accelerator", and it indeed gave our site a huge speed boost.

As soon as the caching layer was activated in week 34, the simultaneous connections to the back-end were reduced by more than 50% and the load was lowered significantly.

Conns

Varnish uses numerous techniques to improve the performance. It even has compiled configuration libraries, in-memory logging, and works hand in hand with the OS for memory management.

Cache Invalidation

Recently several sites (for instance Heroku and Posterous) reported the introduction of Varnish, but all have chosen a different cache strategy. The biggest challenge when using caching is the control of the cache TTL and cache invalidation. Varnish has built-in support to control caching, but this requires a lot of work and is specific to Varnish. Posterous has done a more generic, very interesting ajax-based approach

We use a more traditional way using parameter control. Varnish only delivers a cached page, when it is absolutely safe to do so. The URL and all parameters have to match for a cache hit. So the backend can control caching by adding a synthetic parameter to every request, that we call a cache token.

To explain this, here is an example: The response to the "list applications" Ajax call is cached for a hour. Without cache control a deleted application, for example, would still be listed for a hour. The trick here is to issue a new cache token with such an operation. Varnish sees a parameter difference and delivers a fresh response from the back-end in return.

Cache TTL Control

Every application that is hosted on JGate, even when running on a custom domain, leverages the caching layer. The time to live, or TTL, can easily be controlled using AppJets response.setCacheable() call. By default, pages are not cached. When set to true, pages are cached for a long time, a perfect choice for pictures and other static content. When set to undefined, the cache headers need to be supplied by the application. This option allows custom control of the cache.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal
Sat, 14 Aug 2010 04:04:00 -0700 An Improved Bespin-based IDE for AppJet http://blog.jgate.de/an-improved-bespin-based-ide-for-appjet http://blog.jgate.de/an-improved-bespin-based-ide-for-appjet

We have been following the Bespin project since its beginning and think that it is the perfect cloud based editor for the AppJet IDE. Since its so called reboot the feature list has dramatically improved. The latest TIP version (0.9a1) includes support for plugins. They were needed to tailor Bespin for its use in the AppJet IDE.

Bespin-command-line

Commands

Beyond basic typing, everything you do in Bespin is controlled by a "command". Commands can be entered on the command line, or invoked by keyboard control. Over time, we expect Bespin to get an additional user interface for working with commands. For now, it's enough to know that commands are how Bespin gets things done. The help command is a useful command to know: it will list all of the commands available to you right now. The Wiki will mention some commands in the context of larger topics, but the up-to-date list of commands is available via help.

Bespin-commands
Settings

Our plan is to equip the AppJet IDE with a very configurable editor. You can see the list of available settings and change them by using Bespin's set command.

To use Bespin as your editor and to change its default settings go to "My Account". You can choose a white or a dark theme, switch tab sizes, font sizes and other settings.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal
Fri, 30 Jul 2010 10:17:00 -0700 Monitoring and the new Stashboard http://blog.jgate.de/monitoring-and-the-new-stashboard http://blog.jgate.de/monitoring-and-the-new-stashboard

When stashboard was released as Open Source earlier this week, it immediately caught my attention. This Software is the missing piece for a monitoring and dashboard solution for JGate. The ability to run independently from JGate's hardware makes it a perfect choice. Stashboard uses OAuth to authenticate write access, which is supported by JGate's lib-oauth library. Writing an event is a matter of a few lines of server-side JavaScript. See the source code of the monitoring app, if you are interested in the details.

There are currently three services which are monitored:

  • The AppJet Grid, which executes the AppJet apps and provides JavaScript object storage
  • The Backup Service, which provides daily backups of all user apps and their data
  • The Platform Service, which serves the JGate site and the browser-based IDE

The status application is running on Google AppEngine. If you ever need status information about any of the services running on JGate, use that link.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal
Sun, 18 Jul 2010 01:37:00 -0700 Nginx is doing well http://blog.jgate.de/nginx-is-doing-well http://blog.jgate.de/nginx-is-doing-well

As we announced in our change log, we exchanged the reverse proxy layer from Apache web server to Nginx. There are a lot of positive reports all over the net that favor Nginx over Apache especially for static content and high number of requests. This is due to the different architecture they are using. Apache is using a blocking IO model with threads and processes. Nginx on the other hand is using event loops and a non-blocking model.

The new servers are now running for 40 days with great success. The performance has gone up significantly, not only shown in monitoring values but also in real statistics measured by Google Labs:

Performance overview: On average, pages in your site take 0.7 seconds to load (updated on Jul 5, 2010). This is faster than 96% of sites. These estimates are of low accuracy (fewer than 100 data points). The chart below shows how your site's average page load time has changed over the last few months. For your reference, it also shows the 20th percentile value across all sites, separating slow and fast load times.

Chart

Non-blocking IO really seams to be the key to better performance. So it does not surprise that Node.js, which uses the same architecture, is currently getting so much attention. We are keeping an eye on this. 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal
Sat, 15 May 2010 01:38:00 -0700 Improved Statistics, IDE and new Check-In Database http://blog.jgate.de/latest-jgate-additions-improved-statistics-id http://blog.jgate.de/latest-jgate-additions-improved-statistics-id

In the last post, I introduced the new Aristo skin being available as lib-aristoforms. JGate is using it now to display all pages with form elements and it is looking great. The IDE profits from a consistent look on different browsers and OS'es. The new "click to publish" button hopefully inspires more developers to publish their apps. Currently only every fifth app is set to published. This is kind of sad, as learning from other apps is, what makes the JGate platform so powerful.

Once you have published your application, the IDE shows the Subversion controls. From that point you can commit versions of your app to the repository. The new commit database records your revisions and allows querying the history records. It also provides RSS feeds for every application and a consolidated feed of all applications.

Changes to the platform statistics allow now sorting, application statistics per month and additional metrics like storage use.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal
Tue, 13 Apr 2010 09:37:00 -0700 Fancy Forms Made Easy http://blog.jgate.de/fancy-forms-made-easy http://blog.jgate.de/fancy-forms-made-easy

HTML forms are central elements of nearly every web application. AppJet.jar supports HTML forms with its QuickForms library, which makes it easy to create even complex forms. It has some limits though and uses just the built-in browser control elements. Most UI JavaScript libraries shine through the use of skinning effects which provide a modern and consistent look and feel.

Pixelmatrix Design's Josh Pyles has written a cool forms skinning library based on jQuery. Uniform currently provides 3 great looking skins, among them the Aristo theme from 280North, which is also used by the Cappuccino framework. You can even design your own themes using the theme kit and the theme generator. 

We have combined the QuickForms and Uniform libraries, added missing theming for input fields and multi button support, both build on top of QuickForms. The resulting library is ready for use in your own applications. We will also adapt the platform code to make use of it.

Lib-aristoforms

See the lib-aristoforms library for its use and the source code.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal
Sun, 28 Mar 2010 04:48:00 -0700 Using the server-push technique called Comet http://blog.jgate.de/using-the-server-push-technique-called-comet http://blog.jgate.de/using-the-server-push-technique-called-comet

The AppJet protocol stack includes the org.cometd server component which implements the server-side Bayeux API. On the client-side there are implementations and bindings for the Dojo toolkit and the JQuery toolkit. Having all these components on-board makes JGate an ideal prototyping platform for server-push experiments.

I reactivated the comet-counter sample and the required libraries written by David and J.D. from AppJet Inc. The sample is now online and includes the complete source code as with every AppJet application. These server-push experiments are kind of fascinating and where the foundation for AppJet Inc's later EtherPad platform. It is now being merged with Google's Wave and also available as open source.  

See: http://comet-counter.jgate.de

 

Soundtrack: "Transitions I" by soundprank (CC) Attribution (3.0)

 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal
Sun, 21 Mar 2010 03:31:00 -0700 Tutorial: Building a Task Web Application on AppJet http://blog.jgate.de/tutorial-building-a-task-web-application-on-a http://blog.jgate.de/tutorial-building-a-task-web-application-on-a

For those of you, who just started using the AppJet framework on JGate, we have prepared a short tutorial. It explains the basics from creating a new application, adding database support and designing the UI using Ajax. It also shows how to use server-side and client-side JavaScript and how to import libraries.

Time needed: 9 min.
Lines of code: 60
Difficulty: beginner 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal
Sat, 13 Mar 2010 08:03:00 -0800 Version Control Now Online http://blog.jgate.de/version-control-now-online http://blog.jgate.de/version-control-now-online

The JGate platform keeps now track of all versions of an application and makes it easy to see what has changed from revision to revision. Adding an application to the repository is easy.

  1. Go to the IDE and load your application.
  2. When you want to commit a version, just click Commit in the toolbar. Commit as many versions as you need.
    Toolbar

  3. Clicking Revision Log opens a list of all revisions of you application. From the log you can compare revision, create deltas and download old versions.
    Revision Log

There is also readonly public access to the repository using Subversion client tools. There are several of them for every operating system. When asked for the repository location enter the following URL: svn://jgate.de/appjet

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal
Fri, 05 Mar 2010 13:25:00 -0800 JGate Soon With Version Control http://blog.jgate.de/jgate-soon-with-version-control http://blog.jgate.de/jgate-soon-with-version-control

Ever had the feeling that something could break during application updates? With the next platform update, JGate supports version control using Subversion and ViewVC. It allows you the see what has changed from revision to revision, generate patches and download old versions of your apps.

The Repository

The repository is located on the JGate servers with a projects folder for each of your public apps. Whenever you wish to keep a version during development, just hit the "Commit" button in the IDE. That's all, not additional software or knowledge about Subversion is needed.

ViewVC

ViewVC is a Web-based browser interface for Subversion. It generates templatized HTML to present navigable directory, revision, and change log listings. It can display specific versions of files as well as diffs between those versions. The revision log is easily accessible right out of the IDE.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal
Sun, 21 Feb 2010 11:46:00 -0800 How It All Started http://blog.jgate.de/how-it-all-started-5 http://blog.jgate.de/how-it-all-started-5

AppJet was a website that let users create web applications in a client web browser, with no other client software. It went public beta in December 2007. "AppJet" also refers to the server-side JavaScript framework that powers AppJet applications. 

AppJet Inc. not only provided app hosting, they also released appjet.jar to the community with everything needed to run applications on own servers. Later it has been open sourced in the version used to run the EtherPad platform. The multi-app hosting technology however, was kept as their secret sauce.

The Clone

Using the original service, a few community members came up with the idea of an AppJet clone simply by executing (eval) sub applications from a running instance of appjet.jar. The idea of an alternative hosting platform was born. In February 2009, we at JGate took the idea and added multi-tenancy, multi-app hosting, thus building an alternative platform. Herby, one of the active community members added new ideas and provided security tips. He also came up with his own AppJet clone implementation following a different approach.

Taking The Torch

In June 2009 AppJet Inc. informed their users, that they were cancelling AppJet hosting a month later. This was a big surprise, because the platform was amazingly hosting over 2,500 apps at that time. AppJet played their joker with their new EtherPad realtime communication platform, which they had developed in parallel on AppJet. It was years ahead of Google's Wave platform which played in the same field. AppJet Inc. concentrated on a new business model and left app hosting out of focus.

AppJet users however looked for something to migrate their work to. Having the clone platform, it was time for JGate to take the torch and to start hosting migrated apps. Community members wrote libraries to migrate even the data to the new platform. Since then JGate is hosting the old jewels, like infinitecanvas from the Microsoft Live Labs, or Groupr as well as newly developed apps of all sorts.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal
Wed, 03 Feb 2010 09:13:00 -0800 AppJet: The Platform behind JGate http://blog.jgate.de/appjet-the-platform-behind-jgate http://blog.jgate.de/appjet-the-platform-behind-jgate

JGate was created and hosted using the AppJet Web Platform, a new platform, that has been developed by AppJet Inc. for building realtime web apps. We are providing a free hosting service, so that you can run and develop your own applications using this fantastic platform.

AppJet Features:

JavaScript execution on both the client and server

This enables authors to be more productive by writing all parts of the application in the same language, and shuttle data between the client, server, and database all using JavaScript objects.

Flexible, memory-cached JavaScript object database

All the objects that the AppJet application code works with are JavaScript objects, so why on earth would we convert them to and from any other format when storing them in the database? JGate stores all its data in the AppJet Database, which automatically scales and caches itself in memory as necessary. This makes it fast to implement new features, fast to change storage models, and fast to serve requests in production.

Access to the world's biggest collection of libraries: the JVM

There are more high-quality and well-documented libraries written for the Java VM than for any other runtime. We wanted access to all of them when building JGate, so we made an easy way to import Java libraries for use in JavaScript, based on Rhino's JavaScript/Java bridge.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal
Tue, 02 Feb 2010 20:46:00 -0800 About JGate http://blog.jgate.de/about-jgate http://blog.jgate.de/about-jgate

What is JGate about?

JGate provides cloud-based application hosting using the AppJet Web Platform. It features a web-based IDE, an object database and everything needed to run modern web applications. We launched in February 2009 and we've been steadily growing and adding features.

Who is behind JGate?

JGate is driven by a small team of technology professionals and internet enthusiasts. Our aim is to make internet developers' lives easier by providing everything to run web applications without the need of deploying the necessary infrastructure. A modern web browser is all that is needed to start developing. 

More Information

To contact us for any reason, please use this form and we will respond as soon as possible. We love to hear from our users. You may also follow us on Twitter.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal
Tue, 02 Feb 2010 09:47:00 -0800 Welcome To The JGate Blog http://blog.jgate.de/welcome-to-the-jgate-blog http://blog.jgate.de/welcome-to-the-jgate-blog

This blog is about interesting product or technical stories regarding JGate.

You may also follow us at:

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/432472/gravatar.jpeg http://posterous.com/users/36uaAvWGell7 dvbportal dvbportal