You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build API for 3rd parties to publish content to their feed
Users will be able to subscribe to these feeds and choose if to receive local notifications about new items.
Build as external project
Separate API logic from underlying data structre
Initial Implementation with GunDB
Data Structure
feeds: {
[name]: Feed
}
Feed: {
info:FeedInfo
items:FeedItems
privateItems: {
[publickey]: EncryptedFeedItems
}
}
FeedInfo
{
name,
description
id: <the record id to the feed itself>,
owner:<public key/ie user record soul>
}
FeedItems/EncryptedFeedItems: {
[date]: {
[id]: FeedItem/EncryptedFeedItem
}
}
API
login(user,pass):Feeds - login to the underlying database (in our case gun)
Feeds API
createFeed(FeedInfo):Feed - add to gun.user().get('feeds') {name: Feed}, sets correct soul/id in FeedInfo record once its created
getFeed(name):Feed
Feed API
updateFeedInfo(description)
addItem(FeedItem) - puts item in correct day
addPrivateItem(FeedItem, public key) - encrypts FeedItem with public key, puts the item in privateItems.publickey.date
Activity