Cessna 150 pilot reported the loss of electrical power and returned to the departure airport.
Synopsis
Cessna 150 pilot reported the loss of electrical power and returned to the departure airport.
Narrative
After takeoff and when I started turning into the right base of Runway XX as directed. The transponder started blinking. I troubleshooted the transponder by turning on and off but the blinking didn't go away. When I was abeam with the Tower to make ZZZ Departure; very bad static started when I was trying to communicate with the Tower and all communications and transponder completely failed. I tried to troubleshoot by turning avionics on and off and Master/Alternator off and on; but I couldn't get communication or transponder back to work. I turned left to avoid ZZZ's airspace and tried to find a way to contact ZZZ1 Tower to get authorization to land. However; I couldn't find any direct line to communicated even with my phone and realized that I was losing all the interior and exterior lights as well. Then; I decided that it would be safer to land and communicate with ZZZ1 Tower afterward before I lose all electricity. Gladly; the flaps worked; and I had a separate ADS-B IN connected to my Foreflight app and could land safely by checking my surrounding traffic. After safely landing and taxing back to FBO ramp; I talked to the Airport Manager to get a phone number for the Tower crew and was able to talk about what happened and why I had to make a [priority] landing.
Source: NASA Aviation Safety Reporting System (public domain). Reports are voluntary submissions and are not verified by NASA.