Skip to content

ResearchGlobal/universal-react-gamepad

Repository files navigation

universal-react-gamepad

Purpose

Scaffold a react controller app that delivers gamepad input events over a websocket connection to any secure host on a local network.

gamepad libraries to consider

joystick: https://github.com/elmarti/react-joystick-component?tab=readme-ov-file buttons: vanilla jsx ? need lightest load possible. likely only need button tags with basic CSS, shouldn't need a full styled component library for this

infrastructure libraries

  • RxJS - handle event emissions ? is this needed ? vs pure WS
  • use RxJS to emit WS events asynchronously with thread safety
  • WebSocket - built in to JS env

NX for mono repo management

  • upstream libs:
    • Auth
    • WS event emission with Rx
    • Common Components - buttons, joysticks + presentation level event handlers + styling, other UX components
    • APIs for reading inputs, mapping them to controller actions, and sending them to the input event loop
  • features (controlled by routing)
    • login flows
    • controller configurations
    • connect to a game
  • app
    • handles main routing using routing framework

code management libraries

  • perfectionist for sorting keys and imports

Grok research

WebSocket vs WebRTC

  • use webrtc if you need peer to peer connection. use case for gamepad isn't this
  • gamepad should support multiple clients connected to a single server
  • once handshake is established, gamepad client sends data to server -> data flows in one direction (initial spec)
  • C# concurrency can be used to handle multiple websocket connections
  • for the gamepad usecase, WS may be the better choice

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published