API used for communicating with the servers in Reddit

RESTful APIs (Representational State Transfer) are an ideal choice for the Reddit system design due to their simplicity, flexibility, and compatibility with various client applications. Reddit, being a large-scale platform, benefits from RESTful APIs’ statelessness, allowing for scalability and reduced server load. These APIs enable straightforward communication between clients and servers, offering a uniform interface for accessing and manipulating resources like posts, comments, and user profiles.

User Registration

Register




Endpoint: 'POST /api/users/register'


Request For Body




{
  "username": "example_user",
  "email": "user@example.com",
  "password": "examplePassword123"
}


User Login

Login




Endpoint: 'POST /api/users/login'


Request For Body




{
  "username": "example_user",
  "password": "examplePassword123"
}


User Profile

User Profile




Endpoint: 'GET /api/users/{userID}/profile'


Returns user profile information.

Update User Profile

UpdateUserProfile




Endpoint: 'PUT /api/users/{userID}/profile’


Request for Body




{
  "bio": "New bio description",
  "preferences": {
    "theme": "dark",
    "notifications": true
  }
}


Create Post

Create




Endpoint: 'POST /api/posts/create'


Request for Body




{
  "title": "Title of the post",
  "content": "Text, link, or media content",
  "type": "text/link/media"
}


Add Comment to Post

Comment




Endpoint: 'POST /api/posts/{postID}/comment'


Request Body




{
  "content": "Comment text"
}


Upvote Post

Upvote




Endpoint: 'POST /api/posts/{postID}/upvote'


Downvote

DownVote




Endpoint: 'POST /api/posts/{postID}/downvote'


Subscriptions & Feeds:

Follow Subreddit

follow




Endpoint: 'POST /api/subreddits/follow'


Request for Body




{
  "subreddit": "subreddit_name"
}


User Feed

Feed




Endpoint: 'GET /api/users/{userID}/feed'


Retrieves personalized feed based on subscriptions and user interactions.

Design Reddit | System Design

Designing Reddit is not just about sharing posts and comments; it’s about managing a bustling community, ensuring everyone’s voice is heard, and delivering personalized content to keep users engaged. Let’s dive into the system design of Reddit to handle a huge amount of user-generated content while making sure everyone gets their slice of the conversation.

Important Topics for the Reddit System Design

  • What is Reddit?
  • Requirements for Reddit System Design
  • Capacity Estimation for Reddit System Design
  • Uses Case Diagram for Reddit System Design
  • Low Level Design(LLD) in Reddit System Design
  • High Level Design(HLD) of Reddit System Design
    • Microservices Used in Reddit System Design
  • Database Design in Reddit Design
  • API used for communicating with the servers in Reddit
  • Further Optimizations in Reddit Design
  • Conclusion

Similar Reads

What is Reddit?

Reddit is an American social media platform and online community where registered users can submit content, such as text posts, links, images, and videos. Other users can then vote on and discuss these posts, creating a dynamic and interactive environment. Reddit is a widely used platform that has had a significant impact on online discussions and content sharing....

Requirements for Reddit System Design

Functional Requirements for Reddit System Design:...

Capacity Estimation for Reddit System Design

To estimate the scale of the system and to get the idea about the storage requirements, we have to make some assumptions about the data....

Uses Case Diagram for Reddit System Design

...

Low Level Design(LLD) in Reddit System Design

The low level components are:...

High Level Design(HLD) of Reddit System Design

The design is read intensive as more users will fetch the conte nts than the users who will actually upload the contents. At a high level, our system will need to handle two core flows:...

Microservices Used in Reddit System Design

...

Database Design in Reddit Design

In the above diagram, we have discussed about the database design:...

API used for communicating with the servers in Reddit

...

Further Optimizations in Reddit Design

...

Conclusion

...