Yes its a practicable project. You will need to take suitable precautions as its switching mains electricity. However the code should be very straightforward. An arduino will do the job very nicely, I'd choose an arduino micro as they are inexpensive and well supported. If you put the built unit in a box you canincorporate a "wall wart" USB adaptor topower the arduino.
I have a strt of a design or something similar here