This project implements a Reddit-like engine using the actor model in the Go programming language. It was developed as part of COP5615 - Distributed Operating System Principles coursework and includes features such as user management, subreddit creation, post and comment handling, voting, and performance simulation. The engine also supports REST APIs and multi-client interactions.
Source: Reddit
This repository contains the code for the last two projects (Project 4 and Project 5) of COP5615 - Distributed Operating System Principles.
The specific APIs supported by Reddit can be found at: Reddit API Documentation.
For an overview of Reddit and its functionality, visit: What is Reddit?.
- Project 4: Build a Reddit-like engine and implement a simulator to analyze the performance of the engine.
- Project 5: Extend the previously built engine by creating REST APIs and implementing multiple clients that can interact with the engine simultaneously using two separate processes.
The Reddit-like engine includes the following functionality:
-
User Management
- Register an account.
-
Subreddit Management
- Create and join subreddits.
- Leave subreddits.
-
Post Management
- Post in subreddits (text-only posts; no support for images or markdown).
- Comment on posts (supports hierarchical comments, i.e., commenting on comments).
-
Voting and Karma
- Upvote or downvote posts and comments.
- Compute user karma based on votes.
-
Feed and Messaging
- Retrieve a feed of posts from subscribed subreddits.
- Send and receive direct messages.
- Reply to direct messages.
-
Simulator
- Simulate as many users as possible.
- Simulate periods of live connection and disconnection for users.
-
The project is designed with a separation between:
- Client Processes: Handle user actions such as posting, commenting, and subscribing.
- Engine Process: Distributes posts, tracks comments, handles votes, and manages user data.
-
Multiple independent client processes simulate thousands of users interacting with a single-engine process.
- Install Go Programming Language.
- Familiarity with REST APIs is recommended.
Check ReadMe of respective Project
POST /register: Register a new account.
POST /subreddit/create: Create a new subreddit.POST /subreddit/join: Join a subreddit.POST /subreddit/leave: Leave a subreddit.
POST /post: Create a new post in a subreddit.GET /feed: Retrieve posts from subscribed subreddits.
POST /comment: Add a comment to a post or another comment.
POST /vote: Upvote or downvote a post or comment.
GET /messages: Retrieve direct messages.POST /message/reply: Reply to a direct message.
The project includes a tester/simulator to validate functionality:
- Simulate thousands of users performing actions like posting, commenting, voting, etc.
- Test periods of live connection and disconnection for users.
