Starfleet was formed thirty years prior to the Federation of Planets as part of the UESPA (United Earth Space Probe Agency) with the mandate to seek out new life and new civilizations to boldly go where no man has gone before. The Federation Charter states that starfleet Is the military peacekeeping and exploratory force of the united federation of planets member worlds. The interplanetary headquarters of the organization is located in San Francisco on Earth, though each associated planet has its own local headquarters.
Starfleet academy serves to train potential officers as well as enlisted personnel. It's run by Starfleet command a collection of admirals and captains that answers to the Federation President as well as the Federation council. Starfleet personnel follow the prime directive which states they are not to interfere in other cultures development.