Overview
Discover what makes Stretto powerful
Stretto is a lightweight, self‑hosted web music player that transforms any track into an audio stream backed by YouTube or SoundCloud resources. It exposes a rich API for playlist management, lyric retrieval, and cross‑device library sync while remaining fully open source under the MIT license. The application is designed for developers who want a plug‑and‑play media server that can be extended or embedded into larger ecosystems without vendor lock‑in.
Backend
Frontend
Database
Deployment
Overview
Stretto is a lightweight, self‑hosted web music player that transforms any track into an audio stream backed by YouTube or SoundCloud resources. It exposes a rich API for playlist management, lyric retrieval, and cross‑device library sync while remaining fully open source under the MIT license. The application is designed for developers who want a plug‑and‑play media server that can be extended or embedded into larger ecosystems without vendor lock‑in.
Technical Stack & Architecture
- Backend: Written in Go, leveraging the standard library’s
net/httpfor routing and concurrency. The codebase is intentionally minimal, exposing a RESTful API that interacts with MongoDB for persistence and uses OAuth2 to authenticate with external services (Spotify, Google, SoundCloud). - Frontend: A single‑page application built with React (or a similar framework, inferred from the use of JSX in the repo). The UI consumes the Go API via
fetch/axios, and WebSocket connections are used for real‑time playback updates. - Database: MongoDB is the sole persistence layer, storing user profiles, playlist metadata, and caching YouTube/SoundCloud URLs.
- Deployment: The project ships with a Dockerfile and docker‑compose script that bundles the Go binary, Node.js build step for the frontend, and MongoDB. The
bin/gohelper script starts both services, simplifying local development.
Core Capabilities & APIs
- Playlist Import: OAuth2 flows for Spotify and iTunes charts allow bulk import of tracks. The backend scrapes the source platform, normalizes track metadata, and generates a YouTube/SoundCloud link via the
youtube-dlstyle lookup. - Library Sync: A lightweight sync API lets multiple instances share a common MongoDB deployment, effectively mirroring libraries across devices.
- Lyric Fetching: The server queries external lyric services (e.g., Genius) and caches results in MongoDB, exposing them through a
/lyrics/:trackIdendpoint. - Discovery: Endpoints for iTunes/Spotify top charts (
/discover) return curated lists that the frontend can render. - Webhooks & Extensions: Although not fully documented, the architecture supports custom webhooks to notify external services on playlist changes or playback events. The companion Chrome extension demonstrates a client‑side integration pattern.
Deployment & Infrastructure
- Self‑Hosting: Requires only Docker (or Node.js 12+ and MongoDB). The
docker-compose.ymlpulls the official Mongo image, builds the Go binary, and serves static assets. - Scalability: Because MongoDB is the single source of truth, horizontal scaling can be achieved by clustering MongoDB and deploying multiple stateless Go instances behind a load balancer. The real‑time features are lightweight, using WebSockets that scale with the number of concurrent users.
- Containerization: The image is small (<200 MB) and can be run on any OCI‑compatible runtime, making it suitable for Kubernetes, Docker Swarm, or even edge devices.
Integration & Extensibility
Stretto’s open API encourages integration into larger media stacks. Developers can:
- Build custom clients (mobile, desktop) that consume the REST endpoints.
- Hook into the sync API to merge with other services (e.g., Home Assistant media integrations).
- Extend the plugin system by adding new OAuth providers or lyric sources, as the codebase is modular and well‑commented.
Developer Experience
- Configuration: Environment variables (
GOOGLE_CLIENT_ID,SPOTIFY_CLIENT_ID, etc.) control OAuth scopes; MongoDB URI is read fromMONGO_URL. - Documentation: The README covers setup, API endpoints, and the companion extension. While minimal, it is sufficient for experienced Go/React developers to bootstrap quickly.
- Community: MIT licensing and an active GitHub repo foster contributions; the Chrome extension demonstrates a living ecosystem.
Use Cases
- Personal Media Server: Run on a NAS or Raspberry Pi to stream music from Spotify playlists using YouTube as the backend.
- Embedded Media Player: Integrate Stretto’s API into a custom smart‑home dashboard or IoT device that requires music playback.
- Developer Sandbox: Use the sync API to experiment with real‑time collaboration features in a test environment.
Advantages Over Alternatives
- Zero Vendor Lock‑In: Unlike commercial players, Stretto uses freely available streaming sources and stores all metadata locally.
- Lightweight & Fast: Go’s compiled binary delivers low latency, while MongoDB’s document model suits music metadata.
- Open Source & Extensible: MIT license allows modification; the architecture encourages adding new providers or extending functionality without touching core logic.
In sum, Stretto offers a solid foundation for developers looking to build or extend self‑hosted music services with minimal friction and maximum control.
Open SourceReady to get started?
Join the community and start self-hosting Stretto today
Related Apps in other
Immich
Self‑hosted photo and video manager
Syncthing
Peer‑to‑peer file sync, no central server
Strapi
Open-source headless CMS for modern developers
reveal.js
Create stunning web‑based presentations with HTML, CSS and JavaScript
Stirling-PDF
Local web PDF editor with split, merge, convert and more
MinIO
Fast, S3-compatible object storage for AI and analytics
Weekly Views
Repository Health
Information
Explore More Apps
Remark42
Privacy‑focused lightweight comment engine
Zusam
Private forums for friends, self-hosted and lightweight
ENiGMA½ BBS
Modern, nostalgic bulletin board for the 21st century
SimpleX Chat
Private messaging without identifiers
Formbricks
Open‑source, privacy‑first survey platform
Input
Self-hosted, no-code form builder for brandable surveys
