Similar to mine I built some time back, I used a 2.1a USB charger and broke it out of its case to fit.
I included a AC Dimmer on one of the circuits (The board on its side up top).
I bought a bunch of the Sonoff devices now due to the price, I am not able to make ^ for the same cost as a Sonoff, I run custom MQTT firmware on the Sonoff.