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 ➜
The Purpose of Life: A Unique Perspective

The Purpose of Life: A Unique Perspective

The purpose of life is to live fully and explore every aspect of existence. The search for a higher, god-given purpose often leads to harm and neglect of life itself. The need for purpose stems from our psychological structure, not the process of life. Achieving balance allows us to dismantle the walls of our psychological maze and experience freedom. This exploration and understanding of all dimensions of life is the true purpose of life.

Side hustle
Beiryu

Beiryu

Contributor

0
A Comprehensive Guide to Deployment and Infrastructure: AWS, NestJS, MongoDB

A Comprehensive Guide to Deployment and Infrastructure: AWS, NestJS, MongoDB

This article provides a detailed overview of the deployment process, infrastructure. It covers everything from Git branching strategies to AWS infrastructure, CI/CD pipelines, database setup, and security considerations.

Frontend
Architecture
Backend
Beiryu

Beiryu

Contributor

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