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 ➜
How to build a Portfolio Tracking like CoinMarketCap from Zero (Part 1)

How to build a Portfolio Tracking like CoinMarketCap from Zero (Part 1)

Tutorials
Crypto
Backend
Beiryu

Beiryu

Contributor

1
Gaming Industry from the Inside: My Gameloft Experience

Gaming Industry from the Inside: My Gameloft Experience

After facing challenges in job hunting and going through a rigorous 5-round interview process at Gameloft, I found myself in a professional environment that values work-life balance, documentation, and team bonding. The experience at Gameloft, from the welcoming first day to memorable team trips to Vinh Hy and Cam Ranh, has shown me that a workplace can be more than just about work - it can be a place where lasting relationships are built and professional growth is nurtured.

Side hustle
Career
Beiryu

Beiryu

Contributor

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