I am a structures mechanic. Anything that is part of the airframe is what I (we) work on. As aerospace machinists our job is to fit and assemble commercial jet airliners, freighters and tankers (for the military). So far I have been part of the manufacture of the Boeing 777 (wings and fuselage), 777X (fuselage), and the 767 freighter and its derivative the KC-46 tanker (fuselage).
The airplanes are assembled in huge jigs, we call them “the tool”. The 777 wing assembly jig is huge, 4 stories tall, with a footprint larger than an American football field. 4 pairs of wings are assembled simultaneously. So the machinists are working “in the tool”.
The wing spars are also assembled in a tool, about 60 feet wide and 120 feet long.
The 767, 747 body sections are assembled into larger sub assemblies in large 4 story high tools, similar to the wing assembly tools. The legacy 777 (metal wings) was assembled in a similar tool, which was removed and replaced by crawlers for a “moving” assembly line to also build the 777X.
After the wings and fuselage sections are complete they get joined at wing/body join, then final body join.
At each step the various pieces are loaded into the tooling, positioned using indexes and checked with lasers to the nearest 0.001”.
Still, when an airplane is complete, due to manufacturing tolerances, each one is different in length.
I’ve read that a 747 can vary in length by as much as 18”.
So I suppose that none of them are perfectly straight, but all modern airplanes have provisions to trim, or adjust the airplane for straight and level flight.
The engines are manufactured elsewhere, and installed on the airplane by engine technicians who specialize in the hookup and installation of the engines.