Tasks
Table of contents
Important Links
Projects
Tasks
Idea and Requirements
It will be a social media kind of application where users can
- Create post.
- Comment on Post
- Like on Post
- Follow each other.
- Have personalized home feed.
SRS - Software Requirement Specification
<aside>
💡 Project Name: My Social Media
</aside>
1. Introduction
The Social Media REST API Application is a collection of public and private API endpoints that enables users to create post and manage them, comment on post, and follow each other in a simple social media app. The backend application provides authentication functionality, allows users to create and view posts, comment on post, post with image, follow each other etc. This document outlines the functional and non-functional requirements for the developments for the development of the Social Media REST API Application.
2. System Overview
The Social Media REST API Application aims to provide a seamless user experience while ensuring the security and integrity of user data. It allows users to see posts without authentication, but authentication is required for commenting and creating posts. Administrators have access to an admin dashboard for managing posts, comments and users.
3. Functional Requirements
i. Authentication
- Users should be able to register for an account by providing their email address and a secure password.
- Users should be able to log in securely using their email address and password.
- Administrators should be able to log in securely using their credentials.
ii. User Management
- Admin can create new users.
- User can update their information (name, bio, etc.)
- Admin can see a list of users.
- Admin can ban users.
- Admin can remove users.
iii. Post management
- Authenticated users can create, edit, and delete their own posts.
- Posts must contain a body (max 256 characters), and an optional photo (max 5mb).
- Users can set the audience who can see their posts. It could be everyone (everyone can see), public (only authenticated users can see), or only_me (only postee and admin can view)
- Anyone can view a list of posts and individual post.
- Public post can only be viewed by authenticated users.
- Admin can manage posts.
iv. Commenting
- Authenticated users can comment on posts. (if audience is only_me, then only postee and admin can only comment)
- Comments must have user’s name, their profile URL, and body.
- Anyone can view comments associated with the post.
- Postee and Admin can turn on/off commenting on their posts.
- Admin can manage comments. (hide, delete)
v. Like
- Authenticated users can like on posts. (if audience is only_me, then only postee and admin can only like)
- Who can view likes and who likes depends on the audience of the post.
vi. Following
- Users can follow/unfollow other users.
- Anyone can see the follower and following of a user.
vii. Photo management (Backlog)
- Authenticated users can upload photo associated with their post.
- Authenticated users can update and remove photo of their own posts.
- The system should support various image formats and validate uploaded photos.
Entities
1. User
- id - int
- name - string
- bio - string
- email - string
- password - string (hashed)
- role - enum [user, admin] default - admin
- status - enum [unverified, verified, banned] default - unverified
- timestamp
2. Post
- id - int
- body - string
- photo - string (URL)
- audience - enum [everyone, public, only_me] default - everyone
- creatorId - relation to User
- commenting - boolean
- timestamp
3. Comment
- id - int
- body - string
- postId - relation to Post
- commentorId - relation to User
- status - enum [public, hidden]
- timestamp
4. Like
- id - int
- likerId - relation to User
- postId - relation to Post
- timestamp

API Endpoints
Post
- Get all posts
- Get all posts of a user
- Create a new post
- Get a single post
- Update a post using put
- Update a post using patch
- Delete a post
- Get all comments for a given post
- Create a new comment for a given post
Like
- Get all likes for a given post
- Create a new like for a given post
- Delete a like of given post