Diaspora powered by Tent

From diaspora* project wiki

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.

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

Tent posts already support tags, an API powered by Skate will be required to search them.

Follow Tags

This feature will require an API powered by Skate.

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.

Cross posting (Twitter/Tumblr/Facebook)

This feature will be dropped.

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.)