Architecture Overview
StreamVault uses a modern React component architecture built on React 18 with TypeScript, combining Radix UI primitives with custom components for a desktop media library experience.Core Technologies
React 18
Modern hooks-based components with concurrent features
Radix UI
Unstyled, accessible UI primitives (shadcn/ui pattern)
Framer Motion
Fluid animations and motion effects
Component Categories
Core Components
Foundational components that make up the main application structure:- MovieCard - Media item display with poster, progress, and context menu (
src/components/MovieCard.tsx:77) - EpisodeBrowser - TV episode grid and selection interface
- Sidebar - Main navigation and library sections
- StreamView - Primary content browsing view
Player Components
Video playback and streaming interfaces:- VideoPlayer - Built-in HTML5 video player with transcoding support (
src/components/VideoPlayer.tsx:20) - VideasyPlayer - Alternative player integration
- PlayerModal - Player container and controls wrapper
Social Components
Social features and watch together functionality:- FriendsPanel - Friends list and social sidebar (
src/components/Social/FriendsPanel.tsx) - ActivityFeed - Real-time friend activity stream
- WatchTogetherModal - Synchronized viewing sessions
- ChatWindow - In-app messaging system
AI Components
AI-powered features for content discovery:- AIChatView - AI assistant for media recommendations (
src/components/AI/AIChatView.tsx) - TmdbDeepProfileCard - Enhanced metadata with AI insights
Modal Components
Dialog and overlay interfaces:- SettingsModal - Application configuration (
src/components/SettingsModal.tsx) - ContentDetailsModal - Media metadata and details
- OnboardingModal - First-time user experience
- ResumeDialog - Playback resumption prompt
Design System
Monochrome Theme
StreamVault uses a pure monochrome dark theme focused on grayscale aesthetics:Typography
Custom Inter font stack with optimized rendering:State Management
Component State Patterns
- Local State - React
useStatefor component-specific data - Tauri State - Backend state via Tauri commands (
@tauri-apps/api) - Event-Driven - Tauri events for real-time updates
Example: Media Item State
Tauri API Integration
Components communicate with the Rust backend via Tauri commands:Event Listeners
Components subscribe to backend events:Performance Patterns
Memoization
Components useReact.memo with custom comparison functions:
Animation Optimization
Framer Motion with layout containment:File Organization
Context Menu Pattern
Components use Radix UI Context Menu for right-click actions:Styling Approach
Utility Classes
Tailwind CSS with custom utilities (src/index.css):
.glass- Glassmorphism effect.shadow-glow- Monochrome glow shadows.card-hover- Interactive card states.media-card- Premium media card styling
Class Composition
Usingcn() utility for conditional classes:
Best Practices
- Use Radix UI primitives - For accessible, unstyled base components
- Memoize expensive renders - Use
React.memowith custom comparisons - Keep animations smooth - Use Framer Motion for complex transitions
- Follow monochrome theme - Stick to grayscale design tokens
- Integrate with Tauri - Use
invoke()for backend communication - Handle errors gracefully - Always show user-friendly error states
Next Steps
UI Library
Explore Radix UI primitives and design tokens
Tauri Integration
Learn how components interact with the Rust backend