Here's what we know, all credit to the vault as always
http://fallout.wikia.com/wiki/Rivet_City
Rivet City is located inside of an aircraft carrier that was docked at the Washington Navy Yard during the Great War, and left stranded when the water level in the Anacostia and Potomac rivers dropped. The community was founded by members of the pre-War Naval Research Center, who moved to the vessel to make use of its on board facilities and comparatively defensible position. Rivet City was founded in 2239, when Horace Pinkerton and a group of scientists came upon the ship, which was infested with Mirelurks. After clearing the ship, they found an intact hydroponics bay, which they used to set up a research lab. The rest of Rivet City grew up around the lab, and when Madison Li arrived at Rivet City in 2258 to start Project Purity, and co-opted Pinkerton's staff, he left for the bow, which by this point had broken off from the rest of the ship.
By 2277, Rivet City was the sole supplier of edible, non-irradiated food in the Capital Wasteland, trading it for essential raw materials with other communities.