THE UNITED FEDERATION OF PLANETS... an interstellar alliance of planetary governments and colonies united for mutual trade, exploratory, scientific, cultural, diplomatic and defensive endeavours.
It was founded in 2161, and consists of more than 150 member planets in 2373 and is spread out across 8,000 light-years.
Membership of the Federation is subject to certain conditions e.g. the existence of a unified planetary government and the lack of caste- or class-based discrimination.
The UFP is governed by the Federation Council , composed of representatives from each member of the UFP. The Federation Council meets in San Francisco, North America, on Earth, where the UFP and Starfleet have their headquarters. 

STARFLEET COMMAND... the operating authority for the interstellar scientific, exploratory and defensive agency of the UFP. Its headquarters is in San Francisco which oversees numerous command facilities located on starbases situated throughout Federation space.
Starfleet, as per its name, also mains an extensive fleet of starships together with auxiliary and support space vessels. 
Starfleet Command comprises many departments. One is the Starfleet Corps of Engineers, the special projects division. 

STARFLEET ACADEMY ... the first and foremost training facility for would-be Starfleet officers. Studiing there takes four years.. The buildings are located at the Presidio of San Francisco, North America, Earth, Alpha Quadrant. 
The Institute was established in 2161. The motto of the Academy is Ex astris, scientia (from the stars, knowledge).