This system provides a scalable solution for synchronizing video playback across multiple browsers with millisecond-level precision. It allows clients to join mid-playback and maintains synchronization based on server-dictated timing.
- Backend: Go with Go Kit
- Frontend: React
- State Management: Redis
- Development Workflow: Tilt
- WebAssembly: TinyGo
- Container Orchestration: Kubernetes (local with Docker Desktop)
video-sync-system/
├── .git/
├── .gitignore
├── Tiltfile
├── README.md
├── docker-compose.yml
├── .env
├── example.env
├── kubernetes/
│ ├── redis.yaml
│ ├── backend.yaml
│ ├── frontend.yaml
│ └── other-services.yaml
├── services/
│ ├── video-sync-backend/
│ │ ├── Dockerfile
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── main.go
│ │ ├── .env
│ │ ├── example.env
│ │ └── internal/
│ ├── video-sync-frontend/
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── .env
│ │ ├── example.env
│ │ ├── public/
│ │ └── src/
│ └── other-service/
├── shared/
│ ├── protos/
│ └── utils/
└── scripts/
├── setup.sh
└── deploy.sh
-
Clone the repository:
git clone https://github.com/elleshadow/video-sync-system.git cd video-sync-system -
Set up environment variables:
- Copy
example.envto.envin the root directory - Copy
example.envto.envin each service directory - Fill in the appropriate values in each
.envfile
- Copy
-
Install dependencies:
- For Go services:
cd services/video-sync-backend go mod tidy - For React frontend:
cd services/video-sync-frontend npm install
- For Go services:
-
Set up Docker Desktop:
- Install Docker Desktop
- Enable Kubernetes in Docker Desktop settings
-
Install Tilt:
- Follow the instructions at https://docs.tilt.dev/install.html
-
Start the development environment:
tilt up -
Access the services:
- Backend: http://localhost:8080
- Frontend: http://localhost:3000
- Tilt dashboard: http://localhost:10350
- Make changes to your code
- Tilt will automatically detect changes and rebuild/redeploy as necessary
- Use the Tilt dashboard to monitor services and view logs
- Create a new directory under
services/ - Add necessary Dockerfile and code
- Create Kubernetes YAML in the
kubernetes/directory - Update the Tiltfile to include the new service
- Add any shared dependencies to the
shared/directory
- Run backend tests:
cd services/video-sync-backend go test ./... - Run frontend tests:
cd services/video-sync-frontend npm test
(Add specific deployment instructions based on your production environment)
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License:
MIT License
Copyright (c) 2024 @elleshadow
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Eli Davidson - edavidson0@gmail.com
Project Link: https://github.com/elleshadow/video-sync-system