GoodDAPP
GoodDAPP copied to clipboard
Notifications/CMS API
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