How xp-technologies-dev/p-stream works
Z-Stream is a streaming-media web app. Its main user journey is to find media, inspect metadata, choose a playback source, and watch while tracking progress and history. The repository also includes account/passkey flows, preferences, and integrations with Trakt and Simkl. The supplied excerpts show selected routing, authentication, metadata, and state-store relationships; several larger features are represented by their exact tree paths, but their internal wiring is not established here.
Main entry points: Player.tsx Player · useAuth.ts Authentication · discover Discover · tmdb.ts Media Metadata
Components 18
Application
- App and Routes
src/setup/App.tsx
Discovery and Metadata
- Discover
src/pages/discover - Curated Lists
src/pages/discover/AllMovieLists.tsx - Media Metadata
src/backend/metadata/tmdb.ts
Playback
- Player Page
src/pages/PlayerView.tsx - Player
src/components/player/Player.tsx - Source Selection
src/backend/providers - Player State
src/stores/player/store.ts
Accounts and State
- Progress State
src/stores/progress/index.ts - Watch History
src/stores/watchHistory/index.ts - Authentication
src/hooks/auth/useAuth.ts - Account API
src/backend/accounts - Auth State
src/stores/auth/index.ts - Preferences
src/stores/preferences/index.tsx
External Integrations
- Trakt Catalog API
src/backend/metadata/traktApi.ts - Trakt Integration
src/utils/services/trakt.ts - Simkl Integration
src/utils/services/simkl.ts
Other components
- Viewer
Connections 20
- Viewer → App and Routes: uses
- App and Routes → Media Metadata: quick-searches
src/setup/App.tsx - Viewer → Discover: browses
- Curated Lists → Trakt Catalog API: loads lists
src/pages/discover/AllMovieLists.tsx - Curated Lists → Media Metadata: loads details
src/pages/discover/AllMovieLists.tsx - Discover → Media Metadata: fetches media
src/pages/discover/hooks/useDiscoverMedia.ts - Discover → Trakt Catalog API: fetches catalog
src/pages/discover/hooks/useDiscoverMedia.ts - Viewer → Player Page: starts playback
- Player Page → Player: renders
- Player → Player State: updates state
- Player → Source Selection: selects source
- Player → Progress State: saves progress
- Progress State → Watch History: records completion
src/stores/progress/index.ts - Viewer → Authentication: signs in
- Authentication → Account API: calls account APIs
src/hooks/auth/useAuth.ts - Authentication → Auth State: updates session
src/hooks/auth/useAuth.ts - Authentication → Preferences: syncs settings
src/hooks/auth/useAuth.ts - Viewer → Preferences: configures
- Viewer → Trakt Integration: connects account
- Viewer → Simkl Integration: connects account