A couple weeks ago, my iPhone 7 started having issues charging. I'd have to twist the charging cord or position it "just right" to get it to charge. It quickly got worse to the point where it was almost impossible to get it to charge properly.
A local shop would fix it for $85, but I just couldn't do that.
I bought the part on Amazon for $15 with all the tools needed, and a replacement battery for another $15 for good measure (I sure didn't want to have to open it up twice and the battery was a bit worn out after two and a half years).
I followed this guide:
https://www.ifixit.com/Guide/iPhone+7+Lightning+Connector+Assembly+Replacement/78122#s158643It's a giant pain in the ass, and took about three and a half hours start to finish, but it's back together and working great now. The most hair-raising part was probably blasting it with a hair dryer and starting to pry it open.
I would recommend it to a friend as long as you have a clear work area (do NOT drop those tiny screws, and keep them organized as you work) and some patience.