$ show lunarr-app/lunarr-go
Lunarr is a self-hosted media server and streaming web application (similar to Plex or Jellyfin) built as a full-stack SvelteKit app with TypeScript. Despite the 'go' in the repository name, the codebase is entirely TypeScript running on the Bun runtime. It manages media libraries from local filesystems, SFTP, and WebDAV sources, scans and matches media against TMDB metadata, transcodes video with FFmpeg, and streams via HLS. The app includes user management, admin-only settings, library sharing via token-based shares, device pairing, and watch progress tracking with Continue Watching and Next Up rails.
The LLM identified 3 files worth highlighting for reuse:
Token-based media library share management with secure token generation, expiry, and permission scoping. The pattern of creating, validating, and revoking scoped access tokens is self-contained and portable to any multi-tenant application requiring expiring share links.
Library CRUD tests exercising path overlap detection and active scan guards. The validation logic prevents multiple libraries from claiming overlapping directory roots and blocks concurrent scans of the same library – a domain pattern applicable to any filesystem-indexing application.
Reusable OpenAPI 3.1 schema builders (nullableNumberSchema, binaryResponse, stringSchema, yamlLines) that generate consistent API documentation programmatically, including problem+json and json response schemas. This pattern of code-defined OpenAPI generation is portable to any TypeScript API project seeking single-source-of-truth API contracts.