Skip to content

feat: implement social layer, friends leaderboard, and milestone notifications - #101

Open
0xNinx wants to merge 1 commit into
MindFlowInteractive:mainfrom
0xNinx:Player
Open

feat: implement social layer, friends leaderboard, and milestone notifications#101
0xNinx wants to merge 1 commit into
MindFlowInteractive:mainfrom
0xNinx:Player

Conversation

@0xNinx

@0xNinx 0xNinx commented Jul 28, 2026

Copy link
Copy Markdown

I have successfully implemented the social layer, friends leaderboard scoping features, and the milestone notification system.

Changes Made
Social Module
Created
follow.entity.ts
representing relational follows in PostgreSQL.
Created
social.service.ts
exposing follow/unfollow logic (with self-follow and duplicate checks), and followers/following query logic.
Created
social.controller.ts
providing the corresponding REST endpoints:
POST /social/follow/:userId
DELETE /social/follow/:userId
GET /social/following
GET /social/followers
Created
social.module.ts
linking dependencies.
Friends Leaderboard
Added
getFriendsLeaderboard
in
leaderboard.service.ts
to retrieve and stand up ranked entries for followed players.
Added GET /leaderboard/friends in
leaderboard.controller.ts
protected by
JwtAuthGuard
.
Milestone notifications
Added STREAK_RECORD_BROKEN to NotificationType enum in
notification.entity.ts
.
Custom events emitted when a player unlocks a rare/epic achievement or breaks a streak record.
Created
social.listener.ts
which automatically detects these events and writes notification records for all followers of that player.
Module Configuration
Registered
SocialModule
on
app.module.ts
.
Verification Results
Unit Tests
We created comprehensive unit tests covering the follow/unfollow services, self-follow and duplicate validation rules, as well as the relative ranking for friends in the leaderboard. All 10 tests passed successfully.

Closes #76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build Player Follow System and Social Graph

1 participant