Diaspora powered by Tent: Difference between revisions

From diaspora* project wiki
No edit summary
Line 1: Line 1:
This document describes a high level outline of what is required to get Diaspora running on Tent. The desired outcome is to maintain the look of the existing app but build a completely new backend using the Tent JavaScript app framework.
This document describes a high level outline of what is required to get Diaspora running on Tent. The desired outcome is to maintain the look of the existing app but build a completely new backend using the Tent JavaScript app framework.


The current front-end is build on top of jQuery, Backbone, and Bootstrap; it uses Handlebars templates which shouldn't be too hard to update to use Mustache for a speed improvement.
The current front-end is build on top of jQuery, Backbone, and Bootstrap; it uses Handlebars templates which shouldn't be too hard to update to use Mustache. Handlebars is a fork of the Mustache template language with more features but slightly worse performance. This very minor change will increase the speed of the app a little bit.


== App Overview ==
== App Overview ==
Line 50: Line 50:
This can be handled via S3.
This can be handled via S3.


=== Tags ===
=== Tags / Tag Following ===


Tent posts already support tags, an API powered by Skate will be required to search them.
Tent posts already support tags, an API powered by Skate will be required to search them. Skate is a Tent search engine that we run. Tent search works more like the web, in that search is not handled by the protocol, but anyone can crawl posts. As a result search is realtime and global, rather than pod specific. Anyone could implement an alternative search engine and use their own API if they were so inclined.
 
=== Follow Tags ===
 
This feature will require an API powered by Skate.


=== Comments ===
=== Comments ===
Line 68: Line 64:
=== Bookmarklet ===
=== Bookmarklet ===


Ideally this would use a link scheme and be handled by any Tent app. Not a high priority and may be dropped.
Ideally this would use a link scheme and be handled by any Tent app. Not a high priority and may be dropped, although it is noted that the bookmarklet could be kept if enough people wanted it.


=== Cross posting (Twitter/Tumblr/Facebook) ===
=== Cross posting (Twitter/Tumblr/Facebook) ===


This feature will be dropped.
This feature will be dropped. In the case of some networks such as Twitter, this feature is an explicit violation of the Terms of Service. We're not interested in exposing ourselves to the legal ramifications of this. Due to the way Tent works, this could be a completely separate application that someone else could write easily, and it could also support other protocols like OStatus.


=== XML Import ===
=== XML Import ===

Revision as of 02:49, 13 December 2012

This document describes a high level outline of what is required to get Diaspora running on Tent. The desired outcome is to maintain the look of the existing app but build a completely new backend using the Tent JavaScript app framework.

The current front-end is build on top of jQuery, Backbone, and Bootstrap; it uses Handlebars templates which shouldn't be too hard to update to use Mustache. Handlebars is a fork of the Mustache template language with more features but slightly worse performance. This very minor change will increase the speed of the app a little bit.

App Overview

Create Post

  • Limit based on one or many groups
    • "All Aspects" (all groups) can be achieved by selecting all groups currently in existence and limiting the post to them.
  • Posts are not limited by size but are plain text. Therefore posts <= 256 characters should be created as a status post and larger posts as essays.
  • Posts can contain many images of seemingly any size. These can be created as individual photo posts and mention the original post or as attachments to the original post.
  • [Hash]Tags are inline and not parsed.

Posts Feed

  • Links and hashtags are auto-linked.
  • (Public|Limited), Like, Reshare (repost), and Comment actions.
  • Visibility on the number of likes a post has (and who they're from).
  • Comments are truncated at 1943 characters with a "show more" button to display the full text.

Email Notifications

An app backend will need to be setup to handle incoming web-hooks and send out email notifications.

The existing app sends email notifications for the following actions based on email preferences:

- someone comments on a post you've commented on (if you're following the author) - you are mentioned in a post - someone comments on your post - you receive a private message - someone 'starts sharing with you' (which just means 'someone followed you') - someone likes your post - someone reposts your post

Make followings in a group visible to each other

This can be easily done by adding the group to each followings' permissions within the group.

Community Spotlight

This feature will require an API powered by Skate.

People Search

This feature will require an API powered by friends.tent.is.

Upload Profile Photo

This can be handled via S3.

Tags / Tag Following

Tent posts already support tags, an API powered by Skate will be required to search them. Skate is a Tent search engine that we run. Tent search works more like the web, in that search is not handled by the protocol, but anyone can crawl posts. As a result search is realtime and global, rather than pod specific. Anyone could implement an alternative search engine and use their own API if they were so inclined.

Comments

Comments are really just a reply that is text only (e.g. status or essay post depending on the length.)

[private] Messages

These can be handled as status and essay posts (depending on size).

Bookmarklet

Ideally this would use a link scheme and be handled by any Tent app. Not a high priority and may be dropped, although it is noted that the bookmarklet could be kept if enough people wanted it.

Cross posting (Twitter/Tumblr/Facebook)

This feature will be dropped. In the case of some networks such as Twitter, this feature is an explicit violation of the Terms of Service. We're not interested in exposing ourselves to the legal ramifications of this. Due to the way Tent works, this could be a completely separate application that someone else could write easily, and it could also support other protocols like OStatus.

XML Import

The XML dump contains:

Namespace | Description
--------- | -----------
`export.user` | `username`, `serialized_private_key`, `person`
`*.person` | `guid`, `diaspora_handle`, `url`, `profile`, `exported_key`
`*.profile` | `diaspora_handle`, `first_name`, `last_name`, `image_url`, `image_url_small`, `image_url_medium`, `gender`, `bio`, `location`, `searchable`,  `nsfw`, `tag_string`
`*.profile.searchable` | Boolean describing if user is searchable
`*.profile.nsfw` | Boolean describing if user is "Not safe for work"
`*.person.exported_key` | Public Key
`export.aspects` | `name`, `post_ids`
`export.contacts` | `contact`
`*.contact` | `user_id`, `person_id`, `person_guid`, `aspects`
`*.contact.aspects` | `aspect`
`*.contact.aspects.aspect` | `name`
`export.posts` | `status_message`
`*.status_message` | `raw_message`, `guid`, `diaspora_handle`, `public`, `created_at`
`export.people` | `person`

and contains enough information to recreate posts with permissions, assign entities to groups, and determine if Skate follow them or if they should be added to friend finder automatically.

Friend finder could be given enough information to automatically add entities into groups upon following them.

There is also an option to download photos, but clicking it opens an alert "Photo exporting currently unavailable".

It would be helpful if the export data also included the users email, but that is already asked for when setting up the user in friend finder.

App Changes

Convert JavaScript Templates to Mustache

Most of the templates use basic Handlebars conditionals and variable interpolation which is very close to Mustache syntax. There are a few macros being used, but can easily be moved out of the template and into the context.

Convert Haml Templates to Mustache

A fair portion of the site is rendered server-side using Haml. As the app is being converted to primarily use JavaScript, these need to be converted into Mustache templates.

Compress images into sprites

There are many images that appear in the same context but are fragmented into separate assets. These need to be converted into CSS sprites or rendered as SVGs. The `graphics` directory in the repository contains some SVGs and an Adobe Illustrator file.

Missing Tent Features

Likes

Diaspora lets users "like" posts. This feature is currently scheduled for Tent 0.3 in March.

Ignore entity

Diaspora allows users 'ignore' other users. The Tent equivalent would be dropping notifications from a blacklist of entities. The app can handle filtering the content until this feature is implemented. (Not currently scheduled for any release.)