1. Use transformer to step down from 230rms to 5V rms and then u can send it to ADC after clamping the mean valuw of voltage to positive side. This will also provide isolation from line and use surge protection at transformer secondary to minimize hard to ADC and circuit. Transformer is best and mostly used solution.
2. Instead, u can go for triac, where u can switch on the triac, and the 230V from line is voltage divided by using power resistor. Use current sense circuit to detect current surges and switch off the triac. If u r rectifying i/p, u can use zener diode to protect against current surges. U can also use op-amp based voltage stabilizer to maintain the dynamic range of 0 to 5V.
3. U can capacitively couple the triac output, to protect against surges.
Code is pretty simple, just run the ADC at 1 ksps and u get minimum of 20 samples per cycle which will also preserve the sine wave shape pretty nicely.