Skip to content

shiv213/sameframe

Repository files navigation

SameFrame

SameFrame is a minimal, local-first watch room for video files everyone already has. It synchronizes playback without uploading or transferring the video itself.

Live app: sameframe.io

SameFrame interface

Features

  • Shareable rooms at sameframe.io/{room-id}
  • Automatic host assignment and host transfer
  • Local SHA-256 file validation before playback unlocks
  • Synchronized play, pause, and seeking
  • Host-only or everyone-can-control playback modes
  • Host-controlled video replacement
  • No accounts, chat, video uploads, or host-to-peer file transfer

How it works

  1. Create a URL-safe room name or open an existing room link.
  2. Choose a unique display name. The first participant becomes the host.
  3. The host selects a local video file. Every other participant selects their own copy of that file.
  4. SameFrame hashes each file locally and unlocks the player only when the hash matches the host's selection.
  5. Playback events and timing travel through the room's WebSocket connection.

Room IDs contain lowercase letters, numbers, and single hyphens. Display names must be unique within a room.

Privacy model

Video bytes never leave a participant's device. SameFrame sends the selected filename, SHA-256 hash, file size, duration, participant readiness, playback timing, and control permissions to the server. The server stores room state in memory and discards it when the process restarts or the room empties.

The filename and hash are room metadata, not secrets. Do not use a sensitive filename or rely on SameFrame for access control.

Architecture

  • React and Vite client
  • Express production server
  • ws WebSocket room transport
  • In-browser streaming SHA-256 via hash-wasm
  • In-memory room state with no database

The production server serves the built client and WebSocket endpoint from one process. A multi-instance deployment requires sticky sessions or a shared room-state adapter.

Local development

Requirements: Node.js 20 or newer and npm.

git clone https://github.com/shiv213/sameframe.git
cd sameframe
npm ci
npm run dev

Open http://localhost:5173. Use two browser windows to test a room.

Commands

npm run dev    # Vite client and WebSocket server
npm test       # Node test suite
npm run build  # Production client build
npm run check  # Tests and production build
npm start      # Serve the built app on PORT (default 8787)

Production

npm ci
npm run build
npm start

The deployment must support WebSocket upgrades at /ws. Set PORT if the platform does not inject it automatically, and terminate TLS at the platform or reverse proxy so production clients use wss://.

Contributing

Contributions are welcome. Read CONTRIBUTING.md before opening a pull request. For vulnerabilities, follow SECURITY.md instead of opening a public issue.

License

MIT © 2026 Shiv Trivedi

About

A local-first synchronized watch room for video files everyone already has.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors