How are those starbases built? Wouldn't that need a lot of resources and therefore ships to carry them in the first place?
Could be built by a mix of different vessels carrying construction materials, equipment and various supplies, both Starfleet and civilian. Even the Enterprise
-D was used to make a cargo run to Deep Space Nine to deliver the station's initial batch of runabouts.