For many versions of Cosmoteer, this is how ships were repaired:
Crew Member: Captain! We lost half of our ship during the fight!
Captain: Pour money on where the parts used to be.
Crew Member: ...What?
Captain: Do it.
This is probably how it'll still be for a while, though. But, In the future, when docking is added, there can be a simple solution: Massive Stations, their Parts connected with Docking Ports. On each Station, there is a massive Repair Bay, Where even the Largest of (Non Modded) Player-Built ships can fit. (Say 150 X 130 in size.) On each side of the Dock there are Explosive walls that Explode to let you in, then repair once you're inside, and the same goes for the exit.
Once inside, the station will extend a boarding corridor. From there, the Station's crew will bring Parts aboard. Also on this station, you can buy fuel, get quests, simply indulge in the lore, and hire new crew members.
When docked, as an optional feature, you could control your captain to interact with the Crew Onboard the Station. This would also assist in Worldbuilding. (Actually, with that, there could be Boarding quests where you can actually control a squad of crew to search dead ships and whatnot... As for PVP Boarding, there could be a training room where you assign where you want your boarders to attack with AI instead.)
Back to the stations, I created a smaller proof of concept station. Given, this should not be an exact example...

It includes Spare Parts, Security Doors, a Docking Corridor, an academy for New Crew, A Chat Room, a Black Market, and Some Escape pods, as well as a stabilizing engine room. There are even scanners onboard the dock to scan a ship while it's inside.
(This station was made to be the sort you'd find on more backwater worlds, colonized but not civilized.)_____________________________________________________________________________________________________________________
What's your opinion on the matter?