Running the same logic and the same technology in the server and the client was mandatory for realtime multiplayer games since the 1990s. See this article from Valve [1] for a briew overview of how client side prediction works. You should also have the server process the data to avoid cheating by modificating the client app.
[1] https://developer.valvesoftware.com/wiki/Latency_Compensatin...