feat(routes-f): scheduled streams, creator recommendations, stream analytics & push tokens#1084
Merged
Merged
Conversation
|
@codebestia is attempting to deploy a commit to the david's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@codebestia 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds four self-contained practice API routes under
app/api/routes-f/, eachfully scoped to its own subfolder (route handler, types, seed data, helpers and
tests). No shared app code is imported or modified — every route is independent
and mergeable in any order.
Routes
1.
GET /api/routes-f/upcoming-streamsLists streams creators have scheduled but not yet started.
within_hours(default 48, max 2 weeks), optionalcategory{ scheduled: [...] }, future-only, filtered by time window +category, sorted by
starts_atascending2.
GET /api/routes-f/similar-creatorsRecommends creators similar to a given creator.
creator_id(required),limit(default 10, max 50){ creators: [{ creator, similarity_score, reason }] }similarity_score = jaccard(categories) + jaccard(follower set)(range 0..2),zero-score creators dropped, follower sets never leaked in the response
3.
GET /api/routes-f/stream-analyticsComputes a single live or past stream's analytics summary.
stream_id(required){ duration_minutes, peak_viewers, average_viewers, unique_viewers, total_messages, total_tips_usdc }recorded end time
4.
POST/DELETE /api/routes-f/push-tokenRegisters or removes a viewer's push notification token (FCM / APNs).
POST { viewer_id, platform: ios|android|web, token } -> { token_id }DELETEbytoken_idor byviewer_id+platformvalue while reusing the token_id slot; identical re-registration is idempotent
Tests
Each route ships with a Node-environment Jest suite covering validation, the
core behavior (time/category filters, Jaccard overlap shapes, live vs completed
streams, register/replace/remove lifecycle) and response shape.
Related Issues
Closes #1008
Closes #1009
Closes #1016
Closes #1019