- Add Prisma schema with all database models - Creator channels, streams, VOD, clips, monetization - Real-time chat, polls, interactions - Subscriptions, donations, payouts - Social graph (followers), clips, leaderboards - Complete Platform Architecture documentation - API structure and routes documentation - Implementation roadmap (8 phases) - Updated README with platform vision - Install core dependencies: Prisma, Clerk, Stripe, Socket.io Ready for Phase 1 development with database setup.
5 KiB
5 KiB
AeThex LIVE - API Structure
API Routes
Authentication
POST /api/auth/register- Create accountPOST /api/auth/login- LoginPOST /api/auth/logout- LogoutGET /api/auth/me- Get current userPOST /api/auth/refresh- Refresh token
Users
GET /api/users/:id- Get user profilePATCH /api/users/:id- Update profileGET /api/users/:id/followers- Get user followersPOST /api/users/:username/follow- Follow userDELETE /api/users/:username/follow- Unfollow userGET /api/users/:id/stats- User statistics
Channels
POST /api/channels- Create channelGET /api/channels/:slug- Get channelPATCH /api/channels/:id- Update channelDELETE /api/channels/:id- Delete channelGET /api/channels/:id/streams- Get channel streamsGET /api/channels/:id/followers- Get followersPOST /api/channels/:id/follow- Follow channelDELETE /api/channels/:id/follow- Unfollow channelGET /api/channels/:id/analytics- Channel analyticsGET /api/channels/:id/settings- Channel settingsPATCH /api/channels/:id/settings- Update settings
Streams & Live
POST /api/streams- Create/start streamGET /api/streams/:id- Get stream detailsPATCH /api/streams/:id- Update streamDELETE /api/streams/:id- End streamGET /api/streams/:id/viewers- Get viewer countPOST /api/streams/:id/webhooks- Stream webhooks (from provider)GET /api/browse- Browse live streamsGET /api/search- Search streamsGET /api/recommended- Recommended streams
Chat (Real-time via Socket.io)
socket.emit('join-stream', {streamId})- Join chatsocket.emit('send-message', {message})- Send messagesocket.emit('delete-message', {messageId})- Delete messagesocket.on('new-message', handler)- Receive messagessocket.on('user-joined', handler)- User joinedsocket.on('user-left', handler)- User left
VOD & Archives
GET /api/vods/:id- Get VODGET /api/channels/:id/vods- Get channel VODsGET /api/vods/:id/progress- Get watch progressPOST /api/vods/:id/progress- Save watch progressPOST /api/vods/:id/report- Report VOD
Clips
POST /api/clips- Create clipGET /api/clips/:id- Get clipPATCH /api/clips/:id- Update clipDELETE /api/clips/:id- Delete clipGET /api/channels/:id/clips- Get channel clipsPOST /api/clips/:id/like- Like clipDELETE /api/clips/:id/like- Unlike clipGET /api/clips/trending- Trending clips
Monetization
POST /api/subscriptions- Create subscriptionGET /api/subscriptions/me- Get my subscriptionsDELETE /api/subscriptions/:id- Cancel subscriptionPOST /api/donations- Create donationGET /api/donations/me- My donationsGET /api/channels/:id/revenue- Channel revenueGET /api/payouts- Get payoutsPOST /api/payouts/request- Request payout
Interactions
POST /api/polls- Create pollGET /api/polls/:id- Get pollPOST /api/polls/:id/vote- Vote on pollPOST /api/reactions- Send reactionPOST /api/gifts- Send gift
Gaming/Tournaments
POST /api/tournaments- Create tournamentGET /api/tournaments/:id- Get tournamentPOST /api/tournaments/:id/join- Join tournamentGET /api/leaderboards/:name- Get leaderboardGET /api/leaderboards/:name/entries/:userId- Get user rank
Moderation
GET /api/moderation/queue- Get mod queuePOST /api/moderation/queue/:id/approve- ApprovePOST /api/moderation/queue/:id/reject- RejectPOST /api/channels/:id/bans- Ban userDELETE /api/channels/:id/bans/:userId- Unban userGET /api/channels/:id/bans- Get bans
Real-time Events (Socket.io)
Stream Events
stream:started- Stream went livestream:ended- Stream endedstream:updated- Stream metadata changedviewers:updated- Viewer count changedviewers:joined- User joined streamviewers:left- User left stream
Chat Events
chat:message- New chat messagechat:deleted- Message deletedchat:cleared- Chat clearedchat:emote- Emote sentchat:ban- User banned
Interaction Events
poll:created- Poll startedpoll:voted- Someone votedpoll:ended- Poll endedreaction:sent- Reaction/emote displayedgift:sent- Gift displayed to chat
Monetization Events
subscription:new- New subscriberdonation:received- Donation receivedmilestone:reached- Milestone (100 followers, etc.)
WebSocket Message Format
{
"type": "event_type",
"payload": {
// Event-specific data
},
"timestamp": "2026-02-07T12:00:00Z"
}
Error Responses
{
"error": true,
"code": "ERROR_CODE",
"message": "Human readable message",
"status": 400
}
Rate Limiting
- Public endpoints: 100 req/min per IP
- Authenticated endpoints: 300 req/min per user
- Streaming endpoints: 50 req/min
- Chat: 5 messages/10 seconds per user
Pagination
GET /api/resource?page=1&limit=20
Response:
{
"data": [...],
"total": 100,
"page": 1,
"limit": 20,
"hasMore": true
}