feat(routes-f): add creator earnings breakdown api#543
feat(routes-f): add creator earnings breakdown api#543davedumto merged 15 commits intoStreamFi-x:devfrom
Conversation
- move past streams from tab to inline section on explore home - add proper empty states to live, trending sections (dashed border card with icon) - add skeleton loaders to /explore/live and /explore/trending pages - add explore/loading.tsx for page-level navigation skeleton - remove unimplemented watch-later and saved pages and nav links - fix Heart icon missing import in sidebar data
- replace about section image with streamer.jpg, full-height flex layout - rewrite about section body copy and steps to remove nft/defi/staking claims - update all 4 faq answers with accurate, distinct, no-hyphen copy - delete unused about-image svg
- build twitch-style carousel: left/right peek cards, nav arrows, progress dots - auto-play featured stream (live or vod recording) via mux player - unmute on play via ref+event to bypass autoPlay="muted" browser restriction - fall back to past recordings in featured slot when no live streams - move streamer info, live/vod badge, view count and mute button to top bar - suppress neon db connection warn in dev so next.js overlay doesn't trigger
seo: - fix metadataBase to www.streamfi.media - add robots, manifest, icons metadata and json-ld scripts - dynamic sitemap with top 500 users + static routes - per-page metadata for landing, explore, browse pages - username layout: live-aware title, og:profile, person + videoobject json-ld - dynamic og image for streamer profiles (1200x630, nodejs runtime) - x-robots-tag noindex for /dashboard and /settings layouts - robots.txt and pwa manifest.json profile icons: - add lib/profile-icons.ts with 9 icons, random and deterministic helpers - avatar modal: 3x3 icon grid, fix preview sync on selection - registration routes: assign random icon on signup - auth provider: support string avatarUrl alongside file upload - api update routes: handle preset icon saves + cloudinary cleanup - replace all user.png fallbacks with getDefaultAvatar(username) fix: resolve curly-brace lint errors that were blocking ci
- add /admin layout with sidebar, protected route (privy session allowlist) - analytics page: 6 real-time stat cards (30s SWR refresh) - user management: paginated list, search, filter, ban/unban, delete - content moderation: stream reports + bug reports with status actions - category management: create, edit, delete with cloudinary image upload - wire ReportLiveStreamModal and ReportBugForm to real API endpoints - add admin auth guard to category POST/PATCH/DELETE routes - add admin subdomain redirect in middleware (admin.streamfi.media) - db migration: is_banned cols on users, stream_reports, bug_reports tables
- Banner upload in profile settings with Cloudinary, shown on profile - Profile share buttons copy URL to clipboard with toast feedback - Chat input always visible via absolute inset-0 scroll container - Emoji picker with 4 categories in chat input - Fix SidebarWrapper height overflow hiding chat input - Fix LIVE badge clipping in Sidebar expanded view - Add UsernamePromptModal with 24-hour snooze for users without a username set - Fix DialogTitle accessibility error in ReportLiveStreamModal - Fix watch page share to clipboard-only - Fix stream info section design system tokens
- Updated chat-section.tsx: replaced Wallet icon with LogIn, added onLoginClick prop - Updated view-stream.tsx: wired Privy login() to sidebar and fullscreen overlay chat - Updated chat-section.test.tsx: updated test expectations for new prompt text - Fixed pre-existing lint error in profile-header.tsx (missing curly braces) - Ran Prettier on files with formatting issues
- fix window.location.replace for live redirect (avoid RSC fetch failure) - add mobile chat clearance for bottom nav - extract shared emoji data to lib/emoji-categories.ts (DRY) - add emoji picker to dashboard stream-manager chat - increase chat icon spacing - add fullscreen chat overlay outside-click-to-close on mobile - move fullscreen collapsed chat button to bottom on mobile - fix StreamInfo empty src when thumbnail is null - add share button to clip player page and clips grid cards - add OG metadata layout and branded opengraph-image for clip detail pages
|
@ACOB-DEV is attempting to deploy a commit to the chibuikemmichaelilonze's projects Team on Vercel. A member of the Team first needs to authorize it. |
👷 Deploy request for streamfi pending review.Visit the deploys page to approve it
|
| } | ||
|
|
||
| function StreamerAvatar({ src, name }: { src: string; name: string }) { | ||
| if (src.includes("cloudinary.com")) { |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High
| opacity-50 hover:opacity-75 transition-all duration-300 hover:scale-[1.02] | ||
| ${side === "left" ? "origin-right" : "origin-left"}`} | ||
| > | ||
| {thumb.includes("cloudinary.com") || thumb.includes("mux.com") ? ( |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High
| opacity-50 hover:opacity-75 transition-all duration-300 hover:scale-[1.02] | ||
| ${side === "left" ? "origin-right" : "origin-left"}`} | ||
| > | ||
| {thumb.includes("cloudinary.com") || thumb.includes("mux.com") ? ( |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High
| /> | ||
| ) : ( | ||
| <div className="absolute inset-0"> | ||
| {thumb.includes("cloudinary.com") || thumb.includes("mux.com") ? ( |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High
| /> | ||
| ) : ( | ||
| <div className="absolute inset-0"> | ||
| {thumb.includes("cloudinary.com") || thumb.includes("mux.com") ? ( |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High
Description
Implements the creator earnings breakdown API for
routes-f, including authenticated earnings time-series responses, cached lifetime/monthly summaries, top supporters aggregation, and the supporting XLM pricing/schema helpers needed for the endpoint to run.Closes #408
Changes proposed
What were you told to do?
Build
GET /api/routes-f/earningsandGET /api/routes-f/earnings/summaryso creators can view their earnings by source and period, with USD conversion from the cached XLM price endpoint, top supporters, date filtering, and summary caching.What did I do?
Earnings endpoints
GET /api/routes-f/earningswith session auth,from/tofiltering,day|week|monthgrouping, totals, and per-transaction detail.GET /api/routes-f/earnings/summarywith all-time, this-month, last-month, and top-10 supporter aggregation for the authenticated creator.Pricing and caching
/api/prices/xlmplus the earnings service to use the same cached price source.Schema and verification support
tip_transactions,gift_transactions, andsubscriptions.Check List (Check all the applicable boxes)
Screenshots / Testing Evidence
npm test -- --runInBand __tests__/lib/routes-f/format.test.tsnpm run type-checknpm run build