Project Structure
Understanding the Playcast Apps monorepo organization and architecture
Overview
Playcast Apps is organized as an Nx monorepo, providing a scalable and maintainable structure for a complex cloud gaming platform. The repository includes multiple applications, shared libraries, and supporting tools all working together to deliver high-performance gaming experiences.
🏗️ Nx Workspace Benefits
- Unified Development: All applications and libraries in one repository
- Dependency Management: Automatic dependency graph analysis and optimization
- Build Caching: Intelligent caching reduces build times significantly
- Code Sharing: Easy sharing of code between different applications
- Task Orchestration: Coordinated testing, linting, and building across projects
Monorepo Layout
The repository follows a standard Nx workspace structure with clear separation between applications and libraries:
Applications
The apps/ directory contains 16 independent applications that can be built and deployed separately:
Host Application
apps/host/The main desktop application built with Electron and React. Provides the gaming interface and manages streaming sessions.
Structure:
host-electron/- Electron main processhost-frontend/- React frontend application
Playjector
apps/playjector/High-performance C++ application for game capture, encoding, and streaming. Handles DirectX game capture with minimal latency.
Key Components:
- ShadowCam - Screen capture system
- PlaycastService - Core streaming service
- Watchdog - Process monitoring
Orchestrator
apps/orchestrator/Node.js backend service managing game sessions, user authentication, and coordination between system components.
Features:
- Session management
- User authentication
- Load balancing
- Health monitoring
Realtime API
apps/realtime-api/Java-based service handling real-time communication and WebRTC signaling for optimal streaming performance.
Capabilities:
- WebRTC signaling
- Real-time messaging
- Connection management
- Quality monitoring
Marketing Site
apps/marketing/Public-facing website for user onboarding, product information, and marketing content.
Features:
- Landing pages
- User registration
- Product showcase
- Blog content
Utility Applications
apps/utility-*/Collection of specialized utility applications for development, testing, and operational tasks.
Utilities Include:
admin-dashboard- Administrative interfacedebugTools- Development debugging toolsmetrics- Performance metrics collectionutility-metrics- System monitoringutility-playtester- Game testing automationutility-webrtc- WebRTC diagnosticsbots- Automated testing botsnode-service- General Node.js serviceplaycast-installer- Application installervpn-security- Security monitoring
Shared Libraries
The libs/ directory contains 27 shared libraries that provide reusable functionality across all applications:
🏗️ Core Libraries
CoreTypes
Central TypeScript type definitions and interfaces used across the platform.
GlobalConfig
Application configuration management and environment-specific settings.
CreateId
Unique identifier generation utilities for sessions, users, and resources.
💬 Communication & Streaming
Messaging
Real-time messaging system for communication between components.
Peer
WebRTC peer connection management and signaling.
MessageCaptureClient
Client-side message capturing and logging functionality.
🎨 UI Components
Footer
Reusable footer components for web applications.
OAuthButtons
Authentication UI components for various OAuth providers.
MobileGamepad
Virtual gamepad interface for mobile devices.
ImageFactory
Image processing and optimization utilities.
🔧 Utilities & Integrations
Analytics
Analytics collection and reporting with BigQuery integration.
ApiUtil
HTTP client utilities and API communication helpers.
Cookie
Cookie management and session storage utilities.
DebugKit
Development debugging tools and utilities.
InputCapture
Input handling and capture for gaming controls.
PerformanceTests
Performance testing and benchmarking utilities.
📚 Content & Data
ArticleContent
Content management system for articles and documentation.
PlaylistTypes
Type definitions and utilities for game playlists.
PolicyContent
Legal policy and terms of service content management.
SEO
Search engine optimization utilities and meta tag management.
Configuration Files
Key configuration files that define the workspace behavior and project settings:
nx.json
Nx workspace configuration defining build targets, caching strategies, and task dependencies.
Key Settings:
- Build target defaults and caching
- Task runner configuration (parallel: 4)
- Plugin configuration for Webpack, Vite, and ESLint
- Named inputs for production builds
package.json
Root package configuration with dependencies and workspace scripts.
Key Features:
- Node.js ≥20 requirement
- Comprehensive development scripts
- 200+ dependencies for full-stack development
- Platform-specific post-install hooks
tsconfig.base.json
Base TypeScript configuration with path mappings for all libraries.
Features:
- Path mappings for @playcastdotio/* imports
- Strict TypeScript configuration
- ES2020 target with modern features
- Decorator support for frameworks
Build Configuration
Specialized build configurations for different application types.
Includes:
- Webpack configs for Electron apps
- Vite configs for modern web apps
- Jest configs for testing
- ESLint configs for code quality
Summary
🎯 Next Steps
Now that you understand the project structure, explore: