A Node.js backend service for managing real-time streaming interactions, built with Express, Socket.IO, and MongoDB.
- WebSocket support for live interactions
- Real-time viewer count tracking
- Live chat functionality
- Stream status monitoring
- Audio response handling
- Comment system with profanity filtering
- Like system
- Gift transaction support
- User profile management
- Room-based messaging
- Stream status management
- Scene configuration
- Animation and expression controls
- Audio response handling
- Viewer statistics
- CORS enabled
- API key authentication (configurable)
- Profanity filtering for chat messages
- Solana blockchain support
- Token transaction handling
- Gift transactions with SPL tokens
- Node.js
- MongoDB
- Solana CLI (for blockchain features)
PORT=6969
MONGO_URI=your_mongodb_uri
API_KEY=your_api_key
npm install
npm start
GET /api/scenes # Get all active streams
POST /api/scenes # Create a new stream
PUT /api/scenes/:agentId # Update stream configuration
GET /api/comments # Get recent comments
POST /api/comments/mark-read # Mark comments as read
GET /api/likeCounts # Get total likes
GET /api/commentCounts # Get total comments
GET /api/rooms/:roomId/messages # Get room messages
POST /api/rooms/:roomId/messages # Send a room message
PUT /api/rooms/:roomId/messages/mark-read # Mark messages as read
GET /api/user-profile/:publicKey # Get user profile
PUT /api/user-profile/:publicKey # Update user profile
POST /api/user-profile # Create user profile
GET /api/agents/:agentId/gifts # Get gifts for an agent
PUT /api/agents/:agentId/gifts/mark-read # Mark gifts as read
GET /api/agents/:agentId/top-gifters # Get top gift senders
socket.on('join_agent_stream') // Join a stream
socket.on('leave_agent_stream') // Leave a stream
socket.on('update_streaming_status') // Update stream status
socket.on('new_comment') // New comment received
socket.on('new_like') // New like received
socket.on('new_gift') // New gift received
socket.on('audio_response') // Audio response ready
socket.on('update_animation') // Animation update
socket.on('update_expression') // Expression update
socket.on('update_emotion') // Emotion update
MIT