Calendar.js uses the Central Repository

Calendar.js is a Kinto application that is written in javascript. This application, as the name suggests is a calendar application. In this app, the user can mark or add notes on dates. These notes are stored in the IndexedDB. On synchronizing it, it uses a remote storage and is reflected in all active calendar.js applications. The idea of a central repository could be quite helpful here, as the user could store the data from this application in his/her own storage only.

I made modifications to the code, in order to make the application a consumer of the central repository.

The modified version does this:

1) authenticates with Firefox accounts.

2) with these credentials, a request is sent to the server to retrieve the url of the user’s storage.

3) if the user has already written to the central repository, i.e. created a record with his/her storage url then the url received as a response from the central repository is the user’s url

4) if the user has no record on the central repository, the user will have to use a default server url provided.

Note: the permissions on the central repository are such that any user authenticated with Firefox accounts can write to the central repository, but, only the author of the record can read the record, for keeping the data (url) of the user safe.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s