-
Notifications
You must be signed in to change notification settings - Fork 123
The anatomy of an app
An App is something that provides value on top of collections. For example:
- A timeline of all your photos
- A gallery of all your contacts
- A Customer Relationship Management Tool
- A map of all the photos you've ever taken
- A calendar with all the places you've visited
In fact, there are many examples of apps that already exist that could be improved if they used a locker to manage the data problem that exists with connecting with multiple web services. Going one step further though, the data is available to applications in JSON via a RESTful API. Your app asks for photos, and (with permission) the individual's Locker will give you a collection of photos. No more issue with constantly changing APIs, and supporting multiple photo services.
For the purpose of demonstration, I picked HelloContacts to discuss the core parts of an app. Note that this app runs internally within the individual's Locker, and not externally (as defined below).
- hellocontacts.app - This is the manifest file for the hellocontacts app. It describes the application.
- hellocontacts-server.js - This file is what runs when someone accesses your application from within their Locker Dashboard. In our case, it is a thin wrapper for an Express server, which serves up files from static/. This server could return a response as well instead of serving up our static client.
- [static/index.html] (https://github.com/LockerProject/Locker/blob/master/Apps/HelloContacts/static/index.html) - This is the HTML that in this case loads up hellocontacts-client.js to access contact data.
- static/js/hellocontacts-client.js - Client which performs an XHR (AJAX) call to http://localhost:8042/query/getContact.
Applications placed inside the Apps directory will show up in the Dashboard.
People can release their own internal apps to build on top of the platform. Let us know if you build something awesome!
http://twitter.com/lockerproject/
Many of these types of apps exist. Think of the "Connect with Facebook" buttons that websites use to get personal data with your consent to make their service better. For example, a health website might want to both save health related data to a person's Locker, and also do reporative analysis on their online social life too. A third party website can use the API in the same way as an Internal app, with the user's expressed consent. That consent is negotiated using OAuth2.
As stated by Thomas, '"Native" apps will have to use the TeleHash Distributed Hash Table to find and contact a locker and set up a tunnel to that locker directly that can be anywhere'.