Our great sponsors
-
I would highly recommend checking out https://boardgame.io/ - its a JS library for turn based games, the documentation describes some of these concepts. It uses websockets. I have tried it out myself with my own game prototype, and it is very quick to get up and running with a multiplayer game that you can play from multiple devices in the browser, which sounds exactly like what you want. You use the library with a "game" object which is run server side and contains the game logic, and a "board" which is the game view that the clients see. Since it is a JS library, you should be able to slot in your p5.js board with absolute ease (some of the examples use Three.js).
-
With a backend, you should prefer websockets for normal in-game communication and REST API for other communication like authorizing the players, etc. socket.io is a really popular library for implementing websockets.
-
Appwrite
Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!
-
Without backend, you can choose WebRTC for all communication b/w players. peerjs is a good library for that. However, I would still suggest not to take this approach as it can be overwhelming.