In my previous post I described the idea of a small mobile webapp. In this article I will briefly describe the architecture of the application.
The main goals of the architecture are:
- Maintainability – the application should be clearly structured and understandable
- Portability – although it is currently deployed to Google App Engine, it should be easy to port it to a different platform
- Performance – the application should be fast and lightweight; considering the characteristics of Google App Engine, it should have a short cold start time
Here is an diagram showing the architecture of the webapp (click to enlarge):
The application consists of 4 services:
- The UserService manages user data and multitenancy. Both is provided by the GAE environment, so the user service itself is quite small.
- The ItemService manages the items. An item can be reused in multiple lists (called “notes” in my application).
- The NoteService handles items in a note (a list), such as adding and removing items to a note and ticking items.
- The LocationService manages locations and sorting of items in a note depending on the actual location.
Each service encapsulates functions, entities and data access. Services can interact with each other, but direct access to data access objects of other services is prohibited. More on this in a later post.
The main client platform is the iPhone (although it should run on Android devices as well), so the application is designed to run as a fullscreen webapp started from the iPhone’s home screen. Sometimes, links are opened in Safari when using fullscreen mode. To avoid this, all links are handled by the AJAX framework Sugar JS, which I developed for this application. It is based on jQuery and allows development of a normal request based web application (such as Stripes Framework, which is request based), and have an AJAX frontend.
On a side note: is this architecture over-designed for this kind of application? Certainly it is. But the intention of this application was not be be ready as quickly as possible, but to practice some techniques which I haven’t looked at recently in detail.