Skip to content

Conversation

@farzanshibu
Copy link

This pull request introduces significant updates to the BeatSync application, including a new Docker setup, enhanced client functionality, and support for YouTube integration. The most important changes include adding a comprehensive Docker setup guide, updating the client to support YouTube playback and library management, and improving the overall developer experience with updated dependencies and configurations.

Docker Setup and Documentation

  • Added a detailed DOCKER.md file outlining the setup process for local development and production, including MinIO configuration, environment variables, and troubleshooting steps.
  • Introduced a Dockerfile for the client application to streamline containerized builds and deployments.
  • Added a .dockerignore file to exclude unnecessary files and directories from the Docker build context.

YouTube Integration

  • Enhanced the Left, Main, and Right dashboard components to support a new YouTube mode, allowing users to search, queue, and play YouTube videos synchronized across devices. [1] [2] [3]
  • Updated the next.config.ts file to allow loading images from YouTube (i.ytimg.com) for better integration.

Client Enhancements

  • Replaced custom button elements with the reusable Button component in the Queue and Left components for better consistency and maintainability. [1] [2]
  • Substituted the Player component with a new UnifiedPlayer component in the Bottom dashboard section.

Dependency Updates

  • Updated multiple dependencies in the package.json file, including @radix-ui, axios, react, and next, ensuring compatibility and access to the latest features.
  • Added new dependencies like react-youtube and @types/youtube to support YouTube integration.

Minor Improvements

  • Enhanced the Toaster component in layout.tsx to use richColors for improved visuals.
  • Refactored the Queue component to include the Button component and improve UI consistency.

freeman-jiang and others added 23 commits July 7, 2025 00:45
- Updated Queue component to use `selectedAudioUrl` instead of `selectedAudioId` for better clarity and consistency.
- Replaced `LocalAudioSource` with `AudioSourceType` to align with new data structure.
- Enhanced audio duration retrieval using `getAudioDuration` method.
- Removed unused TrackSelector and UploadHistory components to streamline the codebase.
- Adjusted WebSocketManager to handle new audio source events and updated related types in the shared library.

This refactor improves the overall structure and maintainability of the audio handling logic across the application.
- Eliminated the spatialConfig variable from the UserGrid component as it was no longer needed.
- Updated the useEffect dependency array to reflect this change, improving performance and clarity.

This cleanup enhances the component's efficiency by reducing unnecessary dependencies.
- Bump bun version from 1.2.2 to 1.2.18
- Update @aws-sdk/s3-request-presigner from 3.828.0 to 3.842.0
- Upgrade turbo from 2.4.4 to 2.5.4
- Added YouTubeSource interface to localTypes for managing YouTube video data.
- Implemented youtube.ts to handle YouTube API interactions, including video search and details retrieval.
- Enhanced global state management in global.ts to support YouTube sources, player readiness, and playback controls.
- Updated websocketHandlers.ts to handle YouTube play, pause, and seek actions.
- Introduced new WebSocket request and broadcast types for YouTube actions in WSRequest.ts and WSBroadcast.ts.
- Added mock data for YouTube search results for development purposes.
- Included necessary dependencies for YouTube integration in bun.lock.
- Introduced the `async-mutex` package to manage concurrent audio initialization in the global store.
- Replaced the existing `initializeAudio` function with `initializeAudioExclusively`, ensuring that only one initialization process can run at a time.
- Added logging to inform when initialization is skipped due to an ongoing process.

This change enhances the stability of audio handling by preventing race conditions during initialization.
- Removed the legacy RoomManager implementation and replaced it with a new GlobalManager that handles all active rooms.
- Introduced a new RoomManager class for individual room operations, encapsulating client and audio source management.
- Updated all relevant routes and WebSocket handlers to utilize the GlobalManager for room access and manipulation.
- Enhanced cleanup and stats routes to reflect the new room management structure.

This refactor improves code organization and scalability by centralizing room management, making it easier to maintain and extend functionality in the future.
- Added build script to package.json for Bun.
- Introduced new test scripts for S3 operations and cleanup.
- Removed obsolete r2-test.ts file.
- Implemented S3 configuration validation on startup in r2.ts.
- Enhanced error handling and logging in S3 operations.
- Added timeout for room cleanup operations in roomManager.ts.
- Updated HTTP request types to remove unused default audio fetch response.
- Created comprehensive Docker setup documentation.
- Added Docker support for client and server with appropriate Dockerfiles and .dockerignore files.
- Implemented automated MinIO bucket creation in docker-compose files.
- Developed scripts for easy Docker setup and management.
- Added StateManager to handle state restoration and backup during server startup and shutdown.
- Implemented graceful shutdown logic to manage server termination and state backup, preventing multiple shutdown executions.
- Introduced methods for uploading and downloading JSON data to/from R2, enhancing data management capabilities.
- Added functionality to retrieve the latest file with a given prefix and delete objects from R2.

These changes improve server reliability and data persistence, ensuring a smoother shutdown process and better state management.
- Updated SIGINT handling to allow for a force exit on multiple Ctrl+C inputs, improving shutdown behavior.
- Introduced Zod schemas for validating backup data structure in StateManager, ensuring data integrity during restoration.
- Added tests for backup data validation to confirm schema compliance.

These changes enhance server reliability during shutdown and improve data validation processes, ensuring a more robust state management system.
- Added audio system status management to global state, including readiness and playback synchronization.
- Implemented pending playback sync and room state management for audio and YouTube selections.
- Created tests for room state synchronization and YouTube source removal.
- Updated RoomManager to handle selected audio and YouTube IDs, along with playback state.
- Enhanced WebSocket handlers to broadcast selected audio, YouTube video, and playback state to newly joined clients.
- Introduced new WebSocket message types for removing YouTube sources and playback state updates.
@vercel
Copy link

vercel bot commented Jul 16, 2025

@farzanshibu is attempting to deploy a commit to the freemanjiang's projects Team on Vercel.

A member of the Team first needs to authorize it.

…ckerfile for client and server, and update docker-compose configuration for improved service management and environment variable handling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants