A modern, media streaming platform inspired by Stremio, built on a powerful microservices architecture.
The system is composed of several independent services that communicate via REST APIs, a federated GraphQL gateway, and a Redis event bus. This design ensures separation of concerns, scalability, and resilience.
demo.1.mp4
- π€ Account & Profile Management: Secure account creation (email/password & social login - just google for now) with support for multiple, customizable user profiles.
- π Private Profiles: Protect profiles with a 4-digit PIN for privacy.
- π§© Extensive Addon System: Install, uninstall, and manage addons across single or all profiles.
- Official & Community Catalogs: Browse and discover addons from official and community sources.
- Install from URL: Directly install any compatible third-party Stremio addon.
- π Rich Content Discovery:
- Dynamic "Home" page aggregating content from all installed addons.
- Advanced "Discover" view with dynamic filtering by content type, provider, genre, and more.
- β‘ Real-time Search: Instantaneous, live search results aggregated from all installed addons simultaneously.
- π¬ Detailed Metadata View: A comprehensive metadata screen that aggregates information (posters, backgrounds, cast, episodes, etc.) from multiple addon sources for a unified view.
βΆοΈ Continue Watching: Keep track of your viewing progress and easily resume from where you left off.- ** torrent Streaming**: Robust backend powered by a custom torrent client daemon for efficient real-time streaming.
- π₯οΈ High-Performance Desktop Client: A native desktop experience using a C++ host that combines a modern WebView2 frontend with a powerful, embedded MPV player for high-quality playback.
- βοΈ Advanced Settings: In-depth configuration per profile, including player settings, streaming cache, and more. (In Progress)
- π Secure Authentication: JWT-based authentication with secure refresh token rotation handled by a dedicated
auth-service. - π Federated GraphQL API: A unified, scalable GraphQL API gateway that federates schemas from backend microservices.
Streamtario is not just a clone; it's a complete, ground-up re-imagining of a modern streaming application using a distributed, microservices-oriented architecture.
| Category | Technology |
|---|---|
| Frontend | TypeScript, React, Next.js, Tailwind CSS, Radix UI, TanStack Query |
| Desktop Shell | C++, Microsoft WebView2, MPV Player |
| API Gateway | Apollo Gateway, Express.js, GraphQL-WS |
| Backend Services | Python 3, FastAPI, Strawberry (GraphQL), Pydantic |
| Streaming Engine | Go (Torrent Daemon), TypeScript/Node.js (Streaming Controller) |
| Database & Cache | PostgreSQL (Primary DB), Redis (Caching, Pub/Sub Event Bus) |
| ORM & Migrations | SQLAlchemy 2.0 (Async), Alembic |
| DI Framework | dependency-injector (Python) |
-
api-gateway: The single entry point for the frontend. It uses Apollo Federation to combine the GraphQL schemas of theaccount-profile-serviceandaddon-controller-serviceinto one unified graph. It also proxies REST/WebSocket traffic to the appropriate downstream services (auth-service,streaming-service). -
account-profile-service(Python): Manages all user-related data.- Responsibilities: Account creation, profile management, addon installation records, playback history.
- Architecture: Implements a clean, layered architecture with a distinct separation between the domain, application (use cases), and infrastructure layers. It uses the Unit of Work and Repository patterns for transactional database operations with SQLAlchemy.
- Events: Publishes domain events (e.g.,
AddonInstalledEvent) to a Redis channel to notify other services of state changes.
-
addon-controller-service(Python): The brain of content aggregation.- Responsibilities: Fetches, parses, caches, and aggregates data from third-party Stremio addon
manifest.jsonfiles. It handles all content discovery, searching, and metadata fetching. - Caching: Utilizes multiple layers of caching (in-memory request cache, Redis for manifests, Redis for profile-specific addon lists) for high performance.
- Event-Driven: Subscribes to Redis events from the
account-profile-serviceto invalidate its profile addon cache in real-time.
- Responsibilities: Fetches, parses, caches, and aggregates data from third-party Stremio addon
-
auth-service(Python): A dedicated service for handling authentication logic.- Responsibilities: Manages email/password and Google social logins. It validates credentials by communicating with the
account-profile-serviceand issues JWT access and refresh tokens upon success.
- Responsibilities: Manages email/password and Google social logins. It validates credentials by communicating with the
-
streaming-service(TypeScript): The controller for the torrent engine.- Responsibilities: Provides a clean API for the frontend to start, stop, and monitor streams. It communicates with the
torrserver-daemonto manage torrents and proxies the video stream to the client. It also exposes a WebSocket for real-time streaming statistics.
- Responsibilities: Provides a clean API for the frontend to start, stop, and monitor streams. It communicates with the
-
torrserver-daemon(Go): A minimal, high-performance torrent client based on the Anacrolix torrent library.- Responsibilities: Manages the torrent session, downloads pieces on-demand for streaming, and provides file-level stats. It is designed to be a lightweight, headless engine controlled by the
streaming-service.
- Responsibilities: Manages the torrent session, downloads pieces on-demand for streaming, and provides file-level stats. It is designed to be a lightweight, headless engine controlled by the
-
webview2-host(C++): The native Windows desktop application.- Responsibilities: Hosts the Next.js frontend within a borderless WebView2 control. It embeds an MPV player instance, binding it to the main window handle. It facilitates a two-way communication protocol between the JavaScript frontend and the C++ backend to control playback, creating a seamless and highly performant native media player experience.
-
StreamtarioLib(Python): A python library of shared with all the microservies.- Responsibilities: holds the data layer definitions, and shared code for all the python projects.
This project is currently in a Beta stage. The core architecture is stable, and a wide range of features are fully implemented and functional. The focus is now on refining the user experience, adding more advanced features, and ensuring stability.
- Full user authentication and profile system.
- Complete addon management lifecycle.
- Content discovery, home page, and real-time search.
- Metadata aggregation and detailed views.
- Torrent streaming and high-quality playback via MPV.
- Continue watching and playback progress tracking.
- Advanced Player and User Settings: Integration of advanced MPV settings (shaders, custom configs) from the settings UI, Cache control and external Player support.
- Subtitle Support: (partially working) Full subtitle integration, including fetching from addons and user uploads.
- Cross-platform Support: Explore options for macOS and Linux desktop clients (e.g., using Tauri or a similar framework).
- UI/UX Polish: Continue to refine animations, transitions, and overall user interface responsiveness.
- Improved Error Handling: (Mostly handled but need refining edge cases) More granular error feedback throughout the application.
- Improved Cashing: (Patialy working) needs more refining to make sure we avoid rate liming on many providers.
- Comprehensive Testing: Implimenting test coverage across all services.
Getting Started (Local Development - Still needs configuration for clone and run, but here at is for anyone who wants to play around with it, ill create a build script at some point.)
-
Prerequisites:
- Python 3.10+
- Node.js 18+
- Go 1.18+
- PostgreSQL
- Redis
- C++ Build Tools (Visual Studio with C++ workload)
vcpkgfor C++ dependency management.
-
Initial Setup:
- Clone the repository.
- Create a root
.envfile by copying.env.exampleand fill in your PostgreSQL and Redis details. - Run
db_cli.py createto create the initial database. - Run
db_cli.py upgradeto apply all database migrations.
-
Backend Services (Python):
- Create a virtual environment:
python -m venv venvin the root of the project where requirement.txt lives. - Install dependencies:
pip install -r requirements.txt - Run the service using the provided debug runner or directly with
uvicorn.
- Create a virtual environment:
-
Frontend (Next.js):
- Navigate to
apps/frontend. - Install dependencies:
npm install - Run the development server:
npm run dev
- Navigate to
-
Desktop Client (C++):
- Open the
apps/webview2-hostdirectory in Visual Studio or VS Code with CMake tools. - Configure and build the project. The executable will be placed in the
builddirectory.
- Open the
This project is licensed under the MIT License. See the LICENSE file for details.
- The Stremio team for the inspiration and the open-source addon ecosystem.
- The developers of all the open-source libraries and frameworks that made this project possible.