Most multiplayer tutorials on here jump straight to websockets, and for a real-time shooter that is the right call. For a turn-based game it is usually more machinery than the problem needs, so here is the plain HTTP version for anyone who has been putting multiplayer off.
The Three Problems A Turn-Based Game Actually Has
Every turn-based multiplayer game needs the same three things: players have to find each other, friends have to be able to play on purpose, and every player has to see every move in the same order. None of those three require a persistent connection. A queue can be polled, a join code is a lookup, and move ordering is what a database does for a living.
The usual reason people reach for websockets is push. In a turn-based game the push is worth very little, because a human is going to take several seconds to decide anyway. A two second poll while it is the opponent's turn feels identical to the player and costs you nothing operationally.
What The Server Should Not Know
The design decision that saves the most work is keeping game rules out of the server. Treat a move as an action with a type and a few opaque data fields, and let your clients decide what the fields mean. Chess notation, a card play, a dice roll, a word submission, a chat line, a surrender flag, they are all the same shape to the server.
Once the server holds no rules, one deployment serves every game you write. You do not stand up new infrastructure for each project, and a rules change never means a server deploy.
A Working Reference
If you want to read a small implementation rather than a diagram, AbraTabia Game Server is one PHP application with a single SQLite file, five HTTPS endpoints, MIT licensed. Queue entries and finished matches expire on their own, and an admin view shows the live queue, active matches, and the full action log for each match.
It runs on shared hosting, a VPS, a container, or a laptop during development, which is the real point: for turn-based games the infrastructure bill for multiplayer can be zero.
Where This Stops Working
Be honest about the boundary. Anything with continuous state, physics, or sub-second reaction time wants a real-time transport and probably an authoritative simulation. The polling model covers turn-based, asynchronous, and most board and card game designs, and it stops being a good idea the moment your game has a frame rate that both players share.