A decentralized streaming platform client built with React and TypeScript, enabling peer-to-peer video/audio streaming through the Swarm network with integrated real-time chat functionality.
- Decentralized Video/Audio Streaming: Stream content through the Swarm network using HLS protocol
- Stream Management: Create, edit, and manage your streams with metadata persistence
- Real-time Chat: Interactive chat system integrated with each stream
- Media Type Support: Both video and audio streaming capabilities
- Scheduled Streaming: Plan and schedule streams for future broadcast
- Stream Browser: Discover and browse available streams
- Stream Watcher: Watch streams with integrated chat and media controls
- Responsive Design: Optimized for desktop and mobile viewing
- User Authentication: Ethereum wallet-based authentication system - WIP -
- Admin Controls: Protected routes for stream creators and administrators
- Swarm Integration: Built on Ethereum Swarm for decentralized storage and streaming
- Custom HLS Player: Specialized player for Swarm-based streaming with adaptive bitrate
- Real-time Updates: Live stream state synchronization across clients
- Thumbnail Support: Upload and display stream preview images
- Error Handling: Comprehensive error management and user feedback
- Node.js 18+ (see
.nvmrcfor exact version) - pnpm package manager
- Ethereum wallet (MetaMask or compatible)
- Swarm Bee node access (local or remote)
-
Clone the repository
git clone https://github.com/Solar-Punk-Ltd/msrs-client.git cd msrs-client -
Install dependencies
pnpm install
-
Environment Configuration
cp .env.sample .env
Configure the following environment variables in
.env:VITE_READER_BEE_URL=http://localhost:1633 # Swarm Bee node for reading VITE_WRITER_BEE_URL=http://localhost:1633 # Swarm Bee node for writing VITE_STAMP=your_postage_stamp_id # Swarm postage stamp VITE_STREAM_STATE_OWNER=owner_address # Stream state owner VITE_STREAM_STATE_TOPIC=state_topic # Stream state topic VITE_CHAT_GSOC_RESOURCE_ID=chat_resource_id # Chat resource identifier VITE_CHAT_GSOC_TOPIC=chat_topic # Chat topic VITE_STREAMER_GSOC_RESOURCE_ID=streamer_resource # Streamer resource ID VITE_STREAMER_GSOC_TOPIC=streamer_topic # Streamer topic
-
Start development server
pnpm dev
The application will be available at
http://localhost:5173
pnpm buildThe built application will be in the dist directory, ready for deployment.
/- Stream Browser (discover available streams)/watch/:mediatype/:owner/:topic- Stream Watcher (watch and chat)/create- Create New Stream (admin only)/edit/:owner/:topic- Edit Stream (admin only)/manage- Stream Management (admin only)
- StreamBrowser: Browse and discover available streams
- StreamWatcher: Watch streams with integrated chat
- StreamForm: Create and edit stream metadata
- StreamManager: Manage your streams (edit, delete, generate tokens)
- SwarmHlsPlayer: Custom HLS player for Swarm streaming
- Chat: Real-time chat system with emoji support
- StreamList: Display and filter available streams
- AdminGuard: Protected route component for authenticated users
- LoginModal: Ethereum wallet connection interface
- MainLayout: Application layout with navigation and status
src/
βββ components/ # Reusable UI components
β βββ Button/ # Button component with variants
β βββ Chat/ # Chat system components
β βββ SwarmHlsPlayer/ # Custom HLS player for Swarm
β βββ Stream/ # Stream-related components
βββ hooks/ # Custom React hooks
βββ layouts/ # Page layout components
βββ pages/ # Main application pages
βββ providers/ # React context providers
βββ styles/ # Global styles and variables
βββ types/ # TypeScript type definitions
βββ utils/ # Utility functions and helpers
The project includes comprehensive testing with 79+ tests covering:
# Run all tests
pnpm test
# Run tests in watch mode
pnpm test:watch
# Run tests with UI
pnpm test --ui# Build Docker image
docker build -t msrs-client .
# Run container
docker run -p 80:80 msrs-client- Build the application:
pnpm build - Deploy the
distdirectory to your web server - Configure nginx or similar server for SPA routing
- Swarm Bee Node: Access to a Swarm Bee node for decentralized storage
- Postage Stamps: Valid Swarm postage stamps for data upload
- HTTPS: Required for wallet connection and media streaming
# Linting
pnpm lint
# Type checking
pnpm typecheck
# Code formatting (handled by Prettier)
# Runs automatically on commit via HuskyThis project uses Conventional Commits:
feat: add new streaming feature
fix: resolve chat connection issue
docs: update API documentation
test: add stream management tests
- Write tests for new features and bug fixes
- Follow the existing code style and patterns
- Update documentation for API changes
- Ensure all tests pass before submitting
This project is part of the Solar Punk ecosystem. Please see the license file for details.
- Ethereum Swarm - Decentralized storage and communication
- Bee Client - Swarm Bee node implementation
- Swarm Chat JS - Real-time chat library