How bemusic/bemuse works
• Main Game Application (Client)
• Frontend/UI Layer: This consists primarily of the React/Redux code found under bemuse/src/app and the extensive “ui” subdirectories. It handles user interactions, the display of game scenes (title, music selection, gameplay, options, etc.), and routing.
• Game Engine: Within bemuse/src/game, you have low-level game logic modules (audio, display, input, scene management, and the timing system) that drive rendering (with PixiJS), audio playback, and game state.
• Asset and Resource Management: Components such as skins, public assets, and multimedia files (images, fonts, music files) in directories like bemuse/public and public/skins.
• Auxiliary Modules: Additional features like auto-synchro, online ranking, custom song loading (e.g., in bemuse/src/custom-song-loader, bemuse/src/online) and analytics (in bemuse/src/app/analytics.js).
• Sub-Projects / Libraries (Packages)
• Parsing and File Handling Modules: Binary music sequence support is provided by packages such as “bms” and “bmson” that parse BMS and BMSON file formats.
• Utility and Tooling Packages: “bemuse-tools”, “bemuse-indexer”, and “bemuse-notechart” provide supporting functions including file packaging, indexing, and notechart loading.
• Types and Linting/Configuration: There are packages such as “bemuse-types” and “eslint-config-bemuse” that ensure consistency across the project.
• Build, Testing, and CI/CD Infrastructure:
• Build Tools: The repository shows configuration files for Rush (rush.json), gulp tasks, webpack configs, and various tsconfig files to compile and bundle the project.
• Testing and Quality: There are dedicated folders for tests within bemuse (Karma, Jest specs, e2e with Playwright) and continuous integration configurations under .github/workflows and .circleci.
• Development Environment: Also note the use of devcontainer, Gitpod, and common scripts for initializing the development environment.
• Website and Documentation:
• Website Project: The “website” folder contains the content and code (likely using a static site generator or Docusaurus) for the public-facing documentation, guides, blog posts, and demos.
Out the relationships and interactions
• A separation between the Client (Frontend/UI) and the underlying Game Engine that processes real-time game state, multimedia, and inputs.
• How the game engine interacts with resource loaders (custom-song-loader, keysound-cache, etc.) and how the asset pipeline manages skins, fonts, and multimedia files.
• Finally, include the website/documentation component that sits somewhat orthogonally, providing guides, demos, and external resources for users and developers.
Architectural patterns and design principles
• Monorepo and Modular Design: Emphasize the division into independent, reusable modules (sub-projects) managed under packages and the main “bemuse” application.
• Separation of Concerns: Illustrate clearly how the UI, game logic, resource management, and external services are each isolated into their own components.
• Client-Side Rendering and Event-Driven Programming: Note the use of React/Redux for state management and PixiJS for game rendering.
• Continuous Integration/Deployment Pipeline: Represent the integration of tools such as Rush, CircleCI, GitHub Actions, and various configuration files that support a robust development workflow.