Friend Service System Design
March 14, 2025
Friend Service System Design
The Friend feature facilitates the management of user relationships, enabling connections and providing options for blocking interactions when necessary. This functionality enhances player connectivity and serves as a foundation for additional features, such as activity tracking and social engagement opportunities.
Use cases diagram
A visual depiction of what is being written about
Database details
Database: NoSQL
#Database CollectionDescription
1friend_friend_requestsid: uuid • recipient_profile_id: ObjectId • requester_profile_id: ObjectId • status: String "PENDING"|"ACCEPTED"|"DECLINED" • message: String • feedback: String • created_at: Datecreated_by: ObjectIdmodified_at: Datemodified_by: ObjectId
2friend_friendsid: uuid • profile_id: ObjectId • friend_profile_id: ObjectId • created_at: Datecreated_by: ObjectIdmodified_at: Datemodified_by: ObjectIddeleted_at: Datedeleted_by: ObjectId
Database relationship
A visual depiction of what is being written about
API details
#PathDescriptionMethodHeadersRequestResponse
1profile/internal/v1/{userId}/friend-requestsView pending friend requestsGET• x-server-keyN/A{     items: [        {            id: String,            recipientProfileId: ObjectId,            requesterProfileId: ObjectId,            status: String "PENDING"|"ACCEPTED"|"DECLINED",            message: String,            feedback: String,            createdAt: Date,            createdBy: ObjectId,            modifiedAt: Date,            modifiedBy: ObjectId      }    ]    paging: {        cursors: {            before: String,            after: String        }    }}
2profile/internal/v1/{userId}/friend-requestsSend personalized friend requestPOST• x-server-key{    recipientProfileId: String,    message?: String, }{    id: String,    recipientProfileId: ObjectId,    requesterProfileId: ObjectId,    status: "PENDING",    message: String,    feedback: String,    createdAt: Date,    createdBy: ObjectId,    modifiedAt: Date,    modifiedBy: ObjectId}
3profile/internal/v1/{userId}/friend-requests/{requestId}/acceptAccept friend requestPUT• x-server-keyN/ASuccessResponseDTO
4profile/internal/v1/{userId}/friend-requests/{requestId}/declineDecline friend requestPUT• x-server-key{    feedback?: String  }SuccessResponseDTO
5profile/internal/v1/{userId}/friendsView all friendsGET• x-server-keyN/A{    items: [        {            id: String,            profileId: ObjectId            friendProfileId: ObjectId            createdAt: Date,            createdBy: ObjectId,            modifiedAt: Date,            modifiedBy: ObjectId,            deletedAt: Date,            deletedBy: ObjectId        }    ]    paging: {        cursors: {            before: String,            after: String        }    }}
6profile/internal/v1/{userId}/friends/{friendProfileId}Remove a friendDELETE• x-server-keyN/ASuccessResponseDTO
7profile/cms/v1/{userId}/friend-requestsView all friend requestsGET• x-access-tokenN/A{    items: [        {            id: String,            recipientProfileId: ObjectId,            requesterProfileId: ObjectId,            status: String "PENDING"|"ACCEPTED"|"DECLINED",            message: String,            feedback: String,            createdAt: Date,            createdBy: ObjectId,            modifiedAt: Date,            modifiedBy: ObjectId      }    ]    paging: {        cursors: {            before: String,            after: String        }    }}
8profile/cms/v1/{userId}/friendsView all friendsGET• x-access-tokenN/A{    items: [        {            id: String,            profileId: ObjectId            friendProfileId: ObjectId            createdAt: Date,            createdBy: ObjectId,            modifiedAt: Date,            modifiedBy: ObjectId,            deletedAt: Date,            deletedBy: ObjectId        }    ]    paging: {        cursors: {            before: String,            after: String        }    }}
Diagrams
A visual depiction of what is being written about
A visual depiction of what is being written about

Discussion (0)

Loading...

Recommended articles

More articles ➜
Xây dựng thói quen để thành công

Xây dựng thói quen để thành công

Trong văn hóa châu Á, đặc biệt là ở Việt Nam, chúng ta thường nghe câu "Có công mài sắt, có ngày nên kim". Điều này hoàn toàn đúng với việc học lập trình. Việc code mỗi ngày, dù chỉ một chút, cũng như giọt nước mưa kiên trì rơi xuống, từng giọt một sẽ tạo nên đại dương mênh mông của kiến thức và kinh nghiệm.

Career
Side hustle
Personal Stories
Beiryu

Beiryu

Contributor

0
Do These 5 Things Before Sleeping: Tips for a Better Night's Sleep

Do These 5 Things Before Sleeping: Tips for a Better Night's Sleep

To improve your sleep quality, try eating a few hours before bedtime, taking a shower, burning an organic oil lamp, practicing a nightly yogic chant, and reminding yourself that you're not just your body. These tips can help eliminate negative thoughts from your bedtime routine and improve your overall well-being.

Side hustle
Beiryu

Beiryu

Contributor

0
Subscribe to the newsletter
Get emails from me about web development, tech, and early access to new articles.