Syncit is a simple collaborative video-watching platform that enables users to synchronize their YouTube video playback in soft real-time utilizing Elixir Phoenix Channels to establish WebSocket connections between users for bidirectional communication.
-
Auth:
Platform integrates the
Phoenix.Auth
module to provide a robust and secure authentication system for users accessing. -
Pause and Resume:
The system supports the ability to pause and resume video playback seamlessly across all connected clients. This is achieved by broadcasting pause and play events.
-
Seek Position Synchronization:
When a user seeks to a specific position in the video, the
Phoenix.Channels
handle the synchronization of this action across all connected clients. -
Dynamic Viewers Count Display:
Through
Phoenix.LiveView
, the platform provides a dynamic display of the current number of viewers, ensuring that the count is updated in soft real-time as users join or leave site. -
LiveView Hooks for Integration:
Custom
phx-hook
implemented to manage replacing videos seamlessly. -
Player Agent for State Management:
Platform leverages the
Agent
module to manage the state of the video player across the entire app.
Clone the repo:
git clone https://github.com/yakimenko73/syncit.git
- Install and setup dependencies:
mix setup
- Start Phoenix endpoint:
mix phx.server
or inside IEx:
iex -S mix phx.server
- Build image with
MIX_ENV
argument:
docker build --tag syncit --build-arg MIX_ENV=dev .
- Create
.env
file and fill it according to the.env.sample
cat .env.sample >> .env
- Run container:
docker run --net host --env-file .env syncit
Now you can visit localhost:4000
from your browser.