Design StackOverflow

Shivam Sinha
1 min readFeb 17, 2022

--

Stack Overflow is a question-and-answer website for professional and enthusiast programmers.

Requirements:

  1. Users: They can be admin, moderators, or normal members.
  2. Admin can add, delete or block any members.
  3. Members can add questions, post answers, upvote/downvote any questions or answers.
  4. Moderators can delete any questions or answers.
  5. Moderators can undelete any questions or answers if they are already deleted.
  6. Members will earn a badge.
  7. Tags can be added to any questions.

Main Actors:

We have 5 main actors:

  1. Admin: Add/ Delete members.
  2. Guest: View/search questions.
  3. Members: All the functions of Guests, Add/Delete their own questions, answers, UpVote/DownVote questions, and answers.
  4. Moderators: All the functions of Members also can close/delete /undelete any questions and answers.
  5. System: Assign badges to members and send notifications.

Use Cases for StackOverflow:

  1. Create questions and assign tags to them.
  2. Search questions.
  3. Add/modify answers to questions.
  4. Moderators can close, delete, and undelete any question.

Classes:

  1. Question
  2. Answer
  3. Tag
  4. Badge
  5. Account
  6. Notification
  7. Vote: To store upvote and downvote
UML Diagram

Implementation:

So it’s just an overview we can further add the logic like assigning tags to questions, etc.

You can access the code from here.

ThankYou. Please do give suggestions.

--

--

Responses (1)