Server and Client on one instance of a game

What you can do is have two separate projects together, one is the server, one is the client, the server handles the logic and the client draws whatever’s supposed to be drawn. When you start a new singleplayer session on the client, start the server and connect to localhost:9001 (or whatever your port is). This way you can have a singleplayer session backed by the server.
The main advantage of such a session is that you can now allow other players on your LAN to connect to your computer and play locally.