https://github.com/wendy556/A3-api-gRPC
Important: I did the EXTRA CREDIT for data model - Subreddit (5 pt)
Name | Type | Description |
---|---|---|
user_id | string | Unique identifier for the user |
Name | Type | Description |
---|---|---|
post_id | int64 | Unique identifier for the post |
title | string | Title of the post |
text | string | Text content of the post |
video_url | string | URL of the video associated with the post (if media is video) |
image_url | string | URL of the image associated with the post (if media is image) |
author | User | The user who authored the post |
score | int64 | Score or votes of the post |
status | PostStatus | Status of the post (e.g., NORMAL, LOCKED, HIDDEN) |
publication_date | string | Timestamp of when the post was published (as a string) |
Name | Type | Description |
---|---|---|
comment_id | int64 | Unique identifier for the comment |
parent_post_id | int64 | Identifier of the parent post |
parent_comment_id | int64 | Identifier of the parent comment (if this is a nested comment) |
author | User | The user who authored the comment |
text | string | Text content of the comment |
score | int64 | Score or votes of the comment |
status | CommentStatus | Status of the comment (e.g., NORMAL_COMMENT, HIDDEN_COMMENT) |
publication_date | string | Timestamp of when the comment was published (as a string) |
Name | Type | Description |
---|---|---|
name | string | Human-readable name of the subreddit |
status | SubredditStatus | Indicates if the subreddit is public, private, or hidden |
tags | string repeated | Set of tags associated with the subreddit |
Name | Type | Description |
---|---|---|
post | Post | The post to be created (optional field) |
Name | Type | Description |
---|---|---|
success | bool | Whether the post creation was successful |
post_id | int64 | The unique identifier for the created post |
Name | Type | Description |
---|---|---|
post_id | int64 | The unique identifier for the post to be voted on |
user | User | The user who is voting |
is_upvote | bool | True for upvote, false for downvote |
Name | Type | Description |
---|---|---|
success | bool | Whether the vote was successful |
new_score | int64 | The new score of the post after the vote |
Name | Type | Description |
---|---|---|
name | string | The name of the subreddit being requested |
Name | Type | Description |
---|---|---|
comment_id | string | Identifier of the comment to vote on |
user | User | The user who is voting |
is_upvote | bool | True for upvote, false for downvote |
Name | Type | Description |
---|---|---|
success | bool | Whether the vote operation was successful |
new_score | int32 | The new score of the comment after the vote |
Name | Type | Description |
---|---|---|
post_id | string | Identifier of the post to retrieve content for |
Name | Type | Description |
---|---|---|
success | bool | Whether the content retrieval was successful |
post | Post | The content of the post |
Name | Type | Description |
---|---|---|
comment | Comment | The comment data to be created |
Name | Type | Description |
---|---|---|
success | bool | Whether the comment creation was successful |
id | int64 | The identifier of the newly created comment |
Name | Type | Description |
---|---|---|
post_id | string | The ID of the post to retrieve top comments for |
limit | int32 | The maximum number of top comments to be retrieved (N) |
Name | Type | Description |
---|---|---|
comment | Comment | Details of the comment |
has_replies | bool | Indicates whether the comment has replies (true or false) |
Name | Type | Description |
---|---|---|
comments | SubCommentDetails[] | List of details for the most popular comments |
Name | Type | Description |
---|---|---|
comment_id | string | The ID of the comment to expand |
limit | int32 | The maximum number of top comments to retrieve for each branch (N) |
Name | Type | Description |
---|---|---|
parent_comment | Comment | The parent comment |
sub_comments | Comment[] | List of sub-comments under the parent comment |
Name | Type | Description |
---|---|---|
branches | CommentBranch[] | List of comment branches with their sub-comments |
Name | Type | Description |
---|---|---|
post_id | string | The ID of the post to monitor |
comment_ids | string repeated | List of comment IDs to monitor, can be added continuously |
Name | Type | Description |
---|---|---|
post_update | Post | Contains score update for the post |
comment_update | Comment | Contains score update for the comment |
Important: I did the EXTRA CREDIT for service definitions - Moniter Updates (5 pt)
Input | Output | Description |
---|---|---|
CreateRequest | CreatePostResponse | Creates a new post and returns the created post |
Input | Output | Description |
---|---|---|
VotePostRequest | VotePostResponse | Submits a vote for a post and returns the new score |
Input | Output | Description |
---|---|---|
RetrievePostContentRequest | RetrievePostContentResponse | Retrieves the content of a post |
Input | Output | Description |
---|---|---|
CreateCommentRequest | CreateCommentResponse | Creates a new comment and returns the created comment |
Input | Output | Description |
---|---|---|
VoteCommentRequest | VoteCommentResponse | Submits a vote for a comment and returns the new score |
Input | Output | Description |
---|---|---|
TopCommentsRequest | TopCommentsResponse | Retrieves a list of the top N most upvoted comments under a specific post |
Input | Output | Description |
---|---|---|
ExpandCommentBranchRequest | ExpandCommentBranchResponse | Expands a comment branch to show the top N most upvoted comments and their respective top N child comments |
Input | Output | Description |
---|---|---|
MonitorUpdatesRequest (stream) | MonitorUpdatesResponse (stream) | Initiates a stream where the client can monitor score updates for a post and its comments in real-time |
Input | Output | Description |
---|---|---|
Subreddit | Subreddit | Creates a new subreddit and returns it |
Input | Output | Description |
---|---|---|
SubredditRequest | Subreddit | Retrieves information about a subreddit |
Note: A one paragraph writeup on the storage backend being used.
- Server Class:
- Client Class:
Note: Links to the implementation of the high level function and its test
- Data model - Subreddit (5 pt), I did in Protobuf Buffer Definition
- Service design - Moniter Updates (5 pt), I did it in Service Definitions