Design StackOverflow
1 min readFeb 17, 2022
Stack Overflow is a question-and-answer website for professional and enthusiast programmers.
Requirements:
- Users: They can be admin, moderators, or normal members.
- Admin can add, delete or block any members.
- Members can add questions, post answers, upvote/downvote any questions or answers.
- Moderators can delete any questions or answers.
- Moderators can undelete any questions or answers if they are already deleted.
- Members will earn a badge.
- Tags can be added to any questions.
Main Actors:
We have 5 main actors:
- Admin: Add/ Delete members.
- Guest: View/search questions.
- Members: All the functions of Guests, Add/Delete their own questions, answers, UpVote/DownVote questions, and answers.
- Moderators: All the functions of Members also can close/delete /undelete any questions and answers.
- System: Assign badges to members and send notifications.
Use Cases for StackOverflow:
- Create questions and assign tags to them.
- Search questions.
- Add/modify answers to questions.
- Moderators can close, delete, and undelete any question.
Classes:
- Question
- Answer
- Tag
- Badge
- Account
- Notification
- Vote: To store upvote and downvote
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.