As the Empire, I will build almost entirely defensive structures; my typical front line planet will have:
A Magnapulse Cannon
A Hypervelocity Gun,
and factories to provide garrison units.
As the Rebels, I generally focus only on space defence; the credits I save allow me to heavily defend the space around my worlds. If they can't break through my space defence, they can't invade the planet.
On hard to defend worlds I will place several factories to produce garrison units. The only planet I defend heavily on both land and space is my Capitol (where I keep Mon Mothma). This planet will have a large defence fleet (large enough to serve as an invasion fleet), and a level 5 Space Station.
On the surface of my Capitol I will have:
An Ion Cannon
The rest of the build slots will contain factories to produce garrison units.