So planets and spaceports can both build ships? But only planets can build colony ships ?
Yes - spaceports are required to build all ship types, less the types: construction, colony, and resupply ships - which are built at planets.
Also when looking at construction yards is there a way to tell what the ship is that is being built there? I see the name of a ship but don't see what kind of ship it is...
Click on one of the tiny icons by the construction yard's "building" list, and that will switch focus to the ship under construction, where you can see exactly what ship type it is.
For those in the queue (not currently under construction but waiting for a free construction yard component, open your construction screen (F10) and find the relevant port/planet. Ship type is listed on the right column for "ships waiting to be constructed" (bottom left).
And what exactly is the purpose of the construction yard when i can go to ship and base screen and see what ships are being built ( highlighted in orange I think) and it also states what kind of ship it is... Thanks...
I assume you mean the purpose of the construction yard screen (F10).
That screen is to see the details for that specific port - what cargo it has/needs, what's docked, etc. I use that screen to see what's holding up shipbuilding, if shipbuilding is held up for want of a resource (steel, polymer, etc) - and to juggle the queued ships (to push repairs or builds ahead of any queued civilian ships, for example).
If you use the ships screen to look for orange ships as you describe, that will only tell you what is under construction - not where. The importance of where is relative to the size of your empire. At the start of the game, all your military builds will likely to be done at your homeworld... but when you're spanning 20 systems, you might be building at multiple locations at the same time, to meet different threats/needs.
“That which can be asserted without evidence, can be dismissed without evidence.” ― Christopher Hitchens