$ show streamaserver/streama
Streama is a self-hosted media streaming server implemented as a Grails 3 (Groovy) monolith with an AngularJS 1.x single-page application frontend. In production, it allows users to upload or mount video files (movies, TV shows, generic videos), fetch metadata from TheMovieDB, stream videos via HTTP range requests (or optional transcoding via FFmpeg), manage subtitles (manual or from OpenSubtitles), track viewing progress, and manage multi-profile accounts with role-based access. The system relies on MySQL (or H2 for dev), Java 8, and external APIs (TheMovieDB, OpenSubtitles). The architecture is a traditional Grails web application with RESTful controllers, Groovy services for business logic, and a rich client-side AngularJS interface that includes a custom video player directive, admin panels, and dashboard views. The codebase shows signs of a long-lived project with a large number of vendored frontend dependencies (Bower-managed), some now outdated (AngularJS 1.x, jQuery UI, Bootstrap 3). While the application is functional and well-documented, the technology stack is aging, and the frontend particularly would benefit from modernization.
The LLM identified 5 files worth highlighting for reuse:
A self-contained service that converts SRT subtitle files to WebVTT format, a common requirement for HTML5 video players. The logic is pure string processing and can be extracted into any Java/Groovy project without dependencies on the rest of Streama.
A utility class for extracting ZIP archives with built-in path traversal protection. It implements a secure unzip pattern (validating that extracted file paths are within the target directory) which is a reusable security best practice for any application handling user-uploaded archives.
A generic AngularJS $resource factory that creates CRUD services for domain objects with minimal configuration. It reduces boilerplate by mapping standard REST endpoints (list, get, save, update, delete) and can be repurposed in any AngularJS application that communicates with a RESTful backend.
Implements the OpenSubtitles hashing algorithm that generates a unique hash from a video file's size and first 64KB of data. This is a standalone, algorithmically interesting component that can be reused in any project needing to query OpenSubtitles, without any dependency on the Streama application.
A collection of approximately 60 custom Lodash mixins (e.g., formatString, pickDeep, insertOrReplaceBy, bytes, guid) that extend the utility library with functions commonly needed in data-heavy frontend applications. The mixins are self-contained and can be extracted to enhance Lodash in any JavaScript project.