Right now the middle-game is too difficult on difficulty 7-7.6 because you don't have the time between various waves to rebuild and attempt a hit on the AI.
I try to rely on automated defenses as much as I can to prevent this one. I need
large turret numbers, but with military command center mk. 2 or higher, dealing with AI random attacks becomes a lot easier. Teleport delays any small ships while your turrets target down bigger ones that don't get teleported.
Also, with golems or spirecraft, depending on your settings, you can leave the AOE dmg ones sitting inside your CS force field (that sits on the wormhole leading deeper into your territory). If I play more defensively I may unlock some extra turrets and/or fortresses.
I'm not an Ai War veteran, but you get the idea: if you are in a highly hostile galaxy you need to have defenses that can deal with them. I for one have learned that I can not just ignore static defenses and rely 100% on a fully mobile fleet. Ofc I need to bring the fleet in when big punchers come at me (carriers, large enemy fleets or golems, hybrid hive swarms, beachheads, bomber fleets, etc.), but most of the time I have time to clear out new planets if I want to.
If your static defenses get crushed for whatever reason, you can always EMP the enemy fleet so that your main fleet can return from the assault mission. A couple of progress points is a small price to pay for not dying.
---
*edit* Also, I haven't tested this myself, but apparently you can use the space/time manipulator turret things to make a "speed highway" for your fleet. It would help with the "not enough time" -problem.