Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability for students to add other students as friends #986

Open
1 of 13 tasks
JJamesWWang opened this issue Apr 2, 2023 · 4 comments
Open
1 of 13 tasks

Add ability for students to add other students as friends #986

JJamesWWang opened this issue Apr 2, 2023 · 4 comments
Assignees
Labels
feature-request For new feature request javascript Pull requests that update Javascript code medium-priority Needs to be done within about a month or so. python Pull requests that update Python code

Comments

@JJamesWWang
Copy link
Member

JJamesWWang commented Apr 2, 2023

Todo

  • Display students' user profiles publicly so that others can add them as friends.
    • Modify the GET endpoint of user/settings so that it takes a user's id. It should now detect if the id is the current user's id and change its display accordingly.
    • Add a way to copy a share link to a student's profile. The share link should have the student's user id so that our route can use it to look up which student it is.
  • Add an "Add friend" button to the profile page when others are viewing it.
    • This should be a view that creates a friend request for the other student.
    • Make this button say "Pending" if the student has already sent a friend request.
  • Display "Friend Requests" on a student's personal profile page.
  • From the "Friend Requests" view, allow the student to either add the friend or reject the friend request.
    • The accept view adds the friend if the student is not already a friend.
    • The reject view should remove the friend request if it exists.
  • Display all friends on the profile page.
  • Allow the student to remove friends
    • This should be a view that removes the friendship if it exists
@JJamesWWang JJamesWWang added feature-request For new feature request medium-priority Needs to be done within about a month or so. python Pull requests that update Python code javascript Pull requests that update Javascript code labels Apr 3, 2023
@JiaqiWang18
Copy link
Member

friend discovery: study groups
chatting? Display contact info: phone number, JHU email

Username

  1. have people choose username (moderation)
  2. user id (make sure we have authentication)

@JiaqiWang18 JiaqiWang18 assigned K02D and unassigned JiaqiWang18 Sep 23, 2023
@K02D
Copy link

K02D commented Sep 29, 2023

  1. Make a new page where users can search for or discover other users
    • For each user, add a 'Add friend' button
    • Show friend requests received (let user either accept / decline)
    • Show pending friend requests sent by the current user
    • Allow the user to remove existing friends

Add 3 new fields to the auth_user table

  • current_friends (list of User ids)
  • incoming_friend_requests (list of User ids)
  • outgoing_friend_requests (list of User ids)

@JiaqiWang18
Copy link
Member

  1. Make a new page where users can search for or discover other users

    • For each user, add a 'Add friend' button
    • Show friend requests received (let user either accept / decline)
    • Show pending friend requests sent by the current user
    • Allow the user to remove existing friends

I think these features make sense. We just need to ask user for their permission if they want their profile to be publicly available on this new page. This permission toggle can be done in the user settings modal.

@JiaqiWang18
Copy link
Member

Add 3 new fields to the auth_user table

  • current_friends (list of User ids)
  • incoming_friend_requests (list of User ids)
  • outgoing_friend_requests (list of User ids)

For modeling the relationship between them, we cannot directly store lists in a relational database.

Suggestion

We need to leverage ManyToMany relationship to model friends relationship.
For friend requests, we can create another table called FriendRequest and two fields from and to
This article explains this pretty well: https://medium.com/analytics-vidhya/add-friends-with-689a2fa4e41d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request For new feature request javascript Pull requests that update Javascript code medium-priority Needs to be done within about a month or so. python Pull requests that update Python code
Projects
None yet
Development

No branches or pull requests

4 participants