I've done something similar, but for an off-site backup machine that I just power up periodically to pull backups from my main server. I avoided WOL due to prior experience of flakiness. (Plus I'd need some other always-on device on that LAN to send the command, which hasn't always been possible in my setup).
So the variant I use is:
- the backup server is powered via a shelly style relay socket
- server bios configured to automatically boot itself when mains power is restored to it.
The relay socket monitors the power draw through the socket, and if it drops below 5W for 10secs it powers off the relay. It is running my own esphome FW so I have flexible control over what conditions make it power on, and i can access it remotely over IP, but a Loxone Socket Air would work as well if there's going to be a mini server local to it.
This way, power down is just:
1 send the soft shutown command to the server
2 optionally, wait a few minutes then send a backstop "power off" to the relay, in case it hasn't already done so.
Power on is just send the command to the relay to turn it on, and the PC will boot itself back up.
A 10s ping polling loop can run continuously, independent of the above procedures, to monitor the server current status.
I also have a networked kvm on the machine, and if it ever hard crashes i can use the relay socket to remotely force a power cycle of the whole lot.
HTH