Skip to content

feat(routes-f): add queue, archives, leaderboards, and clip collections#544

Merged
davedumto merged 4 commits intoStreamFi-x:devfrom
Jay-Peter-Egemasi:codex/routes-f-live-queue-leaderboards-archive-collections
Apr 5, 2026
Merged

feat(routes-f): add queue, archives, leaderboards, and clip collections#544
davedumto merged 4 commits intoStreamFi-x:devfrom
Jay-Peter-Egemasi:codex/routes-f-live-queue-leaderboards-archive-collections

Conversation

@Jay-Peter-Egemasi
Copy link
Copy Markdown
Contributor

Description

Implement the four requested standalone routes-f features in a single backend-focused PR: live viewer queue management, weekly/monthly/all-time leaderboard data, creator goal history archives, and public clip collections/playlists.
Closes #536
Closes #537
Closes #538
Closes #539

Changes proposed

What were you told to do?

Add the following routes-f endpoints and keep them isolated to their requested route trees:

  • Viewer live queue endpoints under app/api/routes-f/live/queue/
  • Weekly/all-time leaderboard endpoint under app/api/routes-f/leaderboard/weekly/
  • Creator milestone and goal history archive endpoint under app/api/routes-f/creator/goals/history/
  • Public clip collections and playlists endpoints under app/api/routes-f/clips/collections/

Open one combined PR instead of four, target the upstream dev branch, and skip GPG signing.

What did I do?

Live Queue

  • Added queue settings and queue entry storage for per-stream FIFO viewer participation.
  • Implemented GET, PATCH, join, leave, and next handlers with creator-only queue control.
  • Enforced queue-open state, FIFO advancement, viewer position lookup, and the 100-viewer cap.

Leaderboards

  • Added GET /api/routes-f/leaderboard/weekly with type, limit, and period query support.
  • Implemented creator/viewer rankings for earnings, tips_sent, watch_time, and new_followers.
  • Added 10-minute cache headers and normalized response entries to include rank, username, avatar URL, and value.

Goal History

  • Added authenticated creator archive listing for completed and expired stream goals.
  • Implemented newest-first cursor pagination and support for sub_count, tip_amount, and viewer_count filters.
  • Returned archive records with title, type, target, achieved value, completion timestamp, duration, and status.

Clip Collections

  • Added public creator collection listing, collection detail, create, update, and delete endpoints.
  • Enforced the requested 15 collections per creator and 30 clips per collection limits.
  • Preserved explicit clip ordering through 0-indexed positions and covered reorder/update flows.

Verification And Compatibility

  • Added focused Jest route tests for the four new endpoint groups.
  • Fixed a set of existing repo-wide type/build blockers that were preventing the required pre-commit build from succeeding.
  • Updated one legacy dynamic route signature for Next 16 route-handler validation compatibility.

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • This PR does not contain plagiarized content.
  • The title and description of the PR is clear and explains the approach.
  • I am making a pull request against the dev branch (left side).
  • My commit messages styles matches our requested structure.
  • My code additions will fail neither code linting checks nor unit test.
  • I am only making changes to files I was requested to.

Screenshots / Testing Evidence

  • npx jest "app/api/routes-f/live/queue/__tests__/route.test.ts" "app/api/routes-f/leaderboard/weekly/__tests__/route.test.ts" "app/api/routes-f/creator/goals/history/__tests__/route.test.ts" "app/api/routes-f/clips/collections/__tests__/route.test.ts" --runInBand
  • npm run type-check
  • npm run build
  • Build completed successfully with existing environment warnings for missing optional local env values such as Upstash and Mux credentials.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

@CMI-James is attempting to deploy a commit to the david's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 30, 2026

@Jay-Peter-Egemasi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@davedumto davedumto merged commit ebb74e9 into StreamFi-x:dev Apr 5, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants