This system should cater to millions of users
Authentication:
Account:
Tweet handling:
Account:
id, email, password, photo, bio, rank, partial_rank, timestamps
FollowedAccounts:
id, account_id, followed_accounts_ids, timestamps
FavouriteTweets:
id, account_id, favourite_tweets_ids, timestamps
Tweet
id, account_id, reply_tweet_ids, body, media, rank, edited_at, timestamps
* assumes no nested reply threads for V1
Ranking can be measured on an arbitrary scale where each 1000 tweet likes/account follows increases the rank by one unit
Mobile app:
BE Services:
* all services associated with the business layer (Create, Update etc)
A. Login -> auth API
email: string, password: string
B. Infinite Pagination
listFrom: timestamp, listToLimit?: timestamp = now - 24 hrs
listFrom: timestamp = last loaded timestamp, listToLimit?: timestamp
C. Marking/Unmarking a tweet as favourite
tweetId: string, favourite: boolean
D. Adding/Editing a tweet
body: string, media?: { filename: string, contentType: string, checksum: string, byteSize: number }
MarkAsFavoriteService:
params: tweet, user
ListTweetsService:
params: user
creates a list sorted by created_at/edited_at in descending order, from the following
For v1, not handling regional ranks, in other words we do not create different ranking based on the region of the world; while this will mean that some users might get tweets from accounts that are not relevant to the user's country/region, by not implementing this in v1 we will speed up the TTL of the app