It really depends entirely on what the circuit is doing - as that method would leave it all entirely live.
A safer method would be to use a transformer, and power the circuit safely from that, taking a 'mains' feed from the output of the bridge rectifier but before a single rectifier feeding the reservoir capacitor. This gives you the option os detecting zero crossing as well, and is perfectly safe.
Obviously the emitter of the transistor would need connecting to the -ve of the electrolytic - but with only a 470ohm dropper resistor there's going to be an almighty BANG and clouds of smoke
The OP also hasn't addressed the problem of the entire circuit been live to the mains.
Just plug in a wall-wart (e.g. redundant phone charger) and use the micro to monitor its output. Cheap, and much safer than the transformerless method.
You would surely be safe with an isolated PSU. Non-isolated are only for such applications where the human could not reach the device without disconnecting power. Otherwise it could be FATAL.