Mains on a perfboard is not a good idea. There might not be sufficient creepage distance between the mains and DC sides.
To expand on that: You want at least 4mm distance with no copper pads between any part of the mains circuits and the low voltage circuits Strip copper pads off totally to get it. On 0.1" strip or matrix board, stripping two adjacent tracks or pads gets you 5mm clearance. If you are using expensive double sided FR4 matrix board, beware of copper left in plated through holes!
*DON'T* try to use cheap EBAY matrix board - the pads are too fragile and drop off if you look at them wrong - not a good thing if it is holding a component lead with mains voltage on it.
Personally, I'd bite the bullet and buy a screw terminal solid state relay rated for motor loads. It provides all the safety isolation you need and avoids mains on perfboard. Its not going to be cheap, as a 3HP motor in 230V countries has a running current of nearly 10A, and a locked rotor current of typically ten times that, so will pull a 100A surge at startup.
If you do try to 'home-brew' the SSR, you'll need a TRIAC that can handle that 100A surge, and you'll need to heatsink it as even 1V drop at 10A is 10W, a lot of dissipation. That gets into a whole other world of problems maintaining safe creepage distances between the TRIAC pins and a grounded heatsink.
The alternative you have already rejected is a motor control contactor with a 12V or 24V DC rated coil. Yes they are big, clunky and power hungry and not particularly cheap, but they'll do the job reliably for tens of thousands of operation cycles, with negligible risk of failing shorted ON. If its got auxiliary contacts, you can use them to latch on the coil power to make the contactor self-latching. Then you've only got the issue of controlling the 12V or 24V contactor coil with 3.3V or 5V logic signals, which at least doesn't have the safety issues of directly controlling mains. Don't forget to suppress the back-EMF spike from the contactor coil with an anti-parallel diode across it so it doesn't kill your logic interface circuit. As you need it to release quickly, put a resistor approx. equal to the DC coil resistance directly in series with the diode. That will limit the spike to approx double the supply voltage.