In the past I would have always gone with a good frame first because higher quality steel frames were usually lugged and handmade which made them stronger at a lighter weight than hi-ten frames. I stll prefer steel frames but TIG welded chromo frames are strong and fairly light in the world of steel bikes. My Surly Steamroller has gone tens of thousands of miles and is still as good as new and it is TIG welded. As far as components go, inexpensive derailleurs, brakes, shifters, bottom brackets and seatposts are marginally heavier but work very well. I've come to love cartridge bearing headsets and hubs because the ones i've had for 15 years work great without any problems.
I find bikes with wider, lower pressure tires are best for gravel, dirt and urban streets with potholes, broken pavement and other hazards, so mountain bikes with city tires are a pretty good choice for urban commuting. Older road bikes say from the 80s, current gravel bikes, mountain bikes and hybrids usually will take those tires. A sturdy 25 pound bike is light enough for me, and as bikes get lighter, they get progressively more expensive.