Skip to content

feat(routes-f): stream collaboration invite completed#1122

Open
rexx010 wants to merge 3 commits into
StreamFi-x:devfrom
rexx010:feat/routes-f-stream-collaboration-invite-1098
Open

feat(routes-f): stream collaboration invite completed#1122
rexx010 wants to merge 3 commits into
StreamFi-x:devfrom
rexx010:feat/routes-f-stream-collaboration-invite-1098

Conversation

@rexx010

@rexx010 rexx010 commented Jun 30, 2026

Copy link
Copy Markdown

Summary

This PR introduces support for stream collaboration invitations and adds a Featured Stream of the Day endpoint to improve content discovery and collaboration across the platform.

Changes Made

  • Implemented the stream collaboration invite route and related request handling.
  • Added support for inviting collaborators to participate in streams.
  • Implemented the Featured Stream of the Day route to surface highlighted content.
  • Integrated the new routes into the existing routing structure and request flow.
  • Improved the streaming experience by supporting both collaboration and featured content discovery.

Benefits

  • Enables creators to collaborate more easily through stream invitations.
  • Improves content visibility by showcasing a featured stream each day.
  • Enhances user engagement through better stream discovery.
  • Extends the platform's streaming capabilities with scalable route implementations

Issue 1: Stream Collaboration Invite ✅
Location: app/api/routes-f/collaboration-invites/

Files Created:

types.ts - TypeScript interfaces for requests/responses
store.ts - In-memory store with all business logic
route.ts - Next.js route handlers with Zod validation
collaboration-invites.test.ts

  • Comprehensive test suite
    Endpoints Implemented:

POST /api/routes-f/collaboration-invites - Create new invitation

Input: {from_creator_id, to_creator_id, stream_id, message?}
Response: {invite_id, status: "pending"}
Duplicate prevention: Only one pending invitation allowed between same creator pair
PUT /api/routes-f/collaboration-invites - Respond to invitation

Input: {invite_id, decision: "accept" | "decline"}
Updates invitation status appropriately
GET /api/routes-f/collaboration-invites - List invitations

Query: creator_id
Response: {incoming: [], outgoing: []} with realistic invitation objects
PATCH /api/routes-f/collaboration-invites - Get invite details (helper endpoint)

Key Features:

✅ Realistic mock data with creator IDs, stream IDs, timestamps
✅ Deduplication logic for pending invites
✅ Complete invitation lifecycle (create → respond → status update)
✅ Proper error handling and validation
✅ Follows existing project patterns (runtime: "nodejs", dynamic: "force-dynamic")
✅ Uses Zod validation and shared validate utility
Issue 2: Featured Stream of the Day ✅
Location: app/api/routes-f/featured-stream/

Files Created:

types.ts - TypeScript interfaces for featured streams and overrides
mock-data.ts - Realistic creator roster with 10 diverse StreamFi creators
store.ts - Deterministic selection algorithm and override management
route.ts - Next.js route handlers with date validation
featured-stream.test.ts

  • Comprehensive test suite
    Endpoints Implemented:

GET /api/routes-f/featured-stream - Get featured stream

Optional query: date (YYYY-MM-DD format)
Response: {featured: {creator, title, reason}, date, is_override: false}
POST /api/routes-f/featured-stream - Set editorial override

Input: {date, creator_id, reason}
Override takes precedence over automatic rotation
DELETE /api/routes-f/featured-stream - Remove editorial override

Input: {date}
PATCH /api/routes-f/featured-stream - Get featured stream with override info

Key Features:

✅ Deterministic rotation: Same date always returns same creator
✅ 10 realistic creators covering Gaming, Music, Tech, Art, Fitness, Cooking, Travel, Education, Comedy, Books
✅ Editorial override system: Priority over automatic selection
✅ Date-based hash algorithm for predictable rotation
✅ Realistic stream data with viewer counts, categories, thumbnails
✅ Proper date validation (YYYY-MM-DD format)
✅ UTC date handling for consistency
Quality Checklist Verification ✅
✓ Every file is inside app/api/routes-f/ - All 8 files created in the correct directories ✓ No imports from outside the folder - Only imports from ../../_lib/validate (allowed shared utility) ✓ Realistic mock data used - Domain-specific StreamFi creator data ✓ API contracts match requirements - All endpoints implement required schemas ✓ Collaboration lifecycle works - Create → respond → status updates complete ✓ Duplicate pending invites prevented - 409 conflict response for duplicates ✓ Incoming/outgoing retrieval works - Separate arrays for each direction ✓ Featured stream rotation is deterministic - Hash-based algorithm ✓ Editorial override has priority - Override takes precedence ✓ Tests cover required behavior - Comprehensive test suites created ✓ Implementation remains isolated - No external dependencies ✓ Code is clean and readable - Follows existing project patterns ✓ Mock data easily replaceable - Structured for backend/database integration

Closes #1097
Closes #1098

@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

@rexx010 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

drips-wave Bot commented Jul 2, 2026

Copy link
Copy Markdown

@rexx010 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

@rexx010 rexx010 changed the title feat(routes-f): stream collaboration invite in-progress feat(routes-f): stream collaboration invite completed Jul 2, 2026
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.

feat(routes-f): stream collaboration invite feat(routes-f): featured stream of the day

1 participant