Reels - april1703/SpotiReels GitHub Wiki
Page in which the user can look to see which songs other users have posted. They can interact with posts by liking, disliking, commenting, or adding that song to their liked songs page.
The right-hand sidebar includes a post composer, allowing users to create new posts by searching for a song and adding an optional caption. At the end of the feed, users also see recommended accounts to follow.
In each post, the user is given the option to like or dislike using either button. The like count is kept track of.
- When Like button is pressed,
toggleLike(postId)checks to see if the post is already liked, adds it tolikedByMe. - The numeric count is increased by 1.
At the bottom of the users feed, there is a section of 5 users that the app has chosen to show that user. There is a follow button next to the account name. These accounts are recommended at random.
- The client side calls
fetchRecommendedUsers({ username, limit })which then does a GET request torecommend/users?username=<me>&limit=<limit>. - The server normalizes to lowercase and then runs a SQL
SELECTthat excludes you and other users you already follow. - It then gives you 5 random users to follow.