-
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, the data is available to your application in JSON via a RESTful API.
No need to learn multiple APIs and spend time maintaining them. Apps on top of Locker get the benefit of the platform.
For the purpose of demonstration, I picked HelloContacts to discuss the anatomy 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 create custom reports about them based on their online social life. 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'.