Most electronic projects operate on low voltage direct current. This is often provided by a USB connection or a battery. There are several possibilities to power a project from the 120 Vac power line. A common way is to use a wall adapter (wall wart) and feed low voltage direct current to your project through a power connector. A good feature of this approach is that the project enclosure is smaller because it does not need to house a power supply.
If you have a project that controls line power, like a Wi-Fi controlled receptacle, it is more convenient to incorporate the power supply in the project enclosure so that you do not need to connect to both the power line and a wall adapter. The solution is to include the guts of a wall adapter into the project enclosure.
Rather than taking apart a wall adapter, you can buy a phone charger kit from eBay vendors. Try searching for “diy training phone charger kit”.
According to the eBay listings, the specification is 5 Vdc at 350 mA to 500 mA with an input of 100-220 V 50//60Hz 0.3 A. This would be adequate for many Arduino and ESP8266 projects, sadly, the supply can barely meet 170 mA.
Next step is to modify the circuit to see if the output can be raised. Short out R7 and play around with R2, R3, and C2.