By the time you have figured out the board logic and layout, it should cost you very little time to do it in LiveView as you don’t have to worry about designing payloads, serialising & deserialising messages etc, so you don’t really have much to lose giving it a try.
Turn based games can be implemented without issue in most of the web frameworks - can be done in LiveView too.
I have used chex | Hex for backend logic for a chess game. Difficult part will be how the game is going to be rendered in LiveView:
- use pure liveview page for rendering the game using svgs, css, etc
Is this going to be learning project or a real world project ?
Would it be possible to optimistically move a chess piece using JS then have the liveview either not need to update or pull the piece back if the server disagrees? I’m not sure if liveview would be unhappy/break if the DOM has been altered by JS.
Managing the same part of the DOM with both LiveView and JS doesn’t really work. Unless you are on a really slow link (high latency - bandwidth is less of a concern), you should find DOM updates for moves via the server will be perceptually fast enough.
BTW - you might get some inspiration from GitHub - chrismccord/todo_trek - it uses SortableJS for drag n drop while still using LiveView rendering.