I usualy build about 4 repair platforms on top of each other with a jump inhibitor, about 4 hangers and some turrets on point. All of these are arranged and packed together so they all overlap, and then I park a few carriers or LRM friggets inside the group. It makes an effective defense against the AI in most cases.
Not to be condescending, don't forget to invest in upgrades that can help track the enemy's fleet. -VERY IMPORTANT- The AI just loves to flank the hell out of you when your off attacking worlds. Very annoying indeed but it sure helps alot to keep tabs on them at a distance.
But with the defense I suggested, I managed to defend a world for 45 min from about 100 ships. My Capital ship with the long range support with 3 LRM friggates and 2 carriers managed it untill one of my main fleets could back them up.