localstream is a personal/fun self-hosted streaming app for local video files.
It combines a Go backend and a SvelteKit frontend to scan local media libraries, stream videos with HTTP byte-range support, and track watch progress for movies and shows.
This is an actively evolving side project, not a production-hardened platform.
backend/ - API server, migrations, media scanning/streaming logicfrontend/ - SvelteKit appPrerequisites:
1.25.3+cp backend/.env.example backend/.env
At minimum, set DATABASE_URL and PORT in backend/.env.
cp frontend/.env.example frontend/.env
Set VITE_API_URL to your backend origin (default local dev: http://localhost:42069).
# backend
cd backend && go mod download
# frontend
cd ../frontend && bun install
cd backend
go run ./cmd/server
cd frontend
bun run dev
Open the app at Vite's dev URL (typically http://localhost:5173).
Backend (run from backend/):
go run ./cmd/servergo test ./...go vet ./...Frontend (run from frontend/):
bun run devbun run checkbun run lintbun run buildBackend (backend/.env):
PORT (required)DATABASE_URL (required)DB_MAX_OPEN_CONNS (optional)DB_MAX_IDLE_CONNS (optional)DB_CONN_MAX_LIFETIME (optional)VIDEO_LIBRARY_DIR (optional, default ./videos)VIDEO_ALLOWED_EXTENSIONS (optional, default .mp4)APP_ENV (optional, development/production)TMDB_API_KEY (optional; needed for TMDB movie metadata)ALLOWED_ORIGINS (required for production environment. set to '*' to allow all hosts or set to frontend url for proper CORS handling)Frontend (frontend/.env):
VITE_API_URL (backend base URL used by frontend API calls)MIT. See LICENSE.