A real-time streaming backend service built with Node.js, Express, Socket.IO, and SQLITE.
- Prerequisites
- Installation
- Configuration
- Running the Server
- Architecture Overview
- API Documentation
- 📚 Additional Resources
Before you begin, ensure you have the following installed:
- Node.js (v18 or later)
- SQLITE (local or Atlas account)
- Bun (for package management and running)
- Git
- Clone the repository:
git clone https://github.com/Bor-Protocol/Bor-Server.git- Install dependencies:
bun install- Create environment file:
cp copy.env .env- Configure your
.envfile with the following variables:
PORT=6969
BUNNY_STORAGE_API_KEY=your_bunny_cdn_key-
Start SQLITE (if using local instance)
-
Run the server in development mode:
node --inspect src/index.js - Using Docker:
docker build -t borp-server .
docker run -p 6969:6969 -p 8080:8080 borp-server- Runtime: Node.js with Bun
- Server: Express.js
- Real-time Communication: Socket.IO
- Database: SQLITE
- File Storage: BunnyCDN
- WebSocket implementation using Socket.IO
- Event-based architecture for:
- Stream status updates
- Chat messages
- Audio responses
- SQLITE schemas for:
- Comments
- Audio file upload system
- BunnyCDN integration for file storage
- Streaming media support
socket.emit('join_agent_stream', agentId)
socket.emit('leave_agent_stream', agentId)
socket.emit('new_comment', commentData)socket.on('streaming_status_update', statusData)
socket.on('comment_received', commentData)
socket.on('audio_response', audioData)GET /api/scenes # Get all active streams
POST /api/scenes # Create new stream
PUT /api/scenes/:agentId # Update stream config
GET /api/streams/:agentId/stats # Get stream statistics
POST /api/comments/mark-read # Mark comments as read
POST /api/upload/audio # Upload audio file
The server implements comprehensive error handling:
- Socket connection errors
- Database operation failures
- File upload issues
- API request validation
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
to launch in debug mode : node --inspect src/index.js