Great game but not sure how I could've stopped that assault.
The first time you run into it? Probably not set up to handle it, no, unless you've done a bit of reading.
My suggestion is to:
1) Pick your territory such that you have easily defended chokepoints between "the outside world" (which can include some of your territory) and your homeworld. It doesn't have to be just one chokepoint though obviously that helps.
2) Preferably, if you can have secondary chokepoints either 3+ hops out or 3+ hops in from those primary chokepoints, that helps a lot.
3) On both primary and secondary chokepoints, plant your Spire cities, covering the wormhole through which the enemies will need to go to get closer to your homeworld; place normal ff-generators over the actual wormholes to provide the actual blocking mechanism (spire city shields don't stop movement, but don't apply the 75% damage reduction to outgoing friendly fire, either).
4) Build up the chokepoint cities as strong as you can; those higher level defense modules (particularly from the capitol) can really help. Backing them up with normal turrets can be a good idea too. And of course, your normal fleet and Spire fleet (which should be built to cap if at all possible, obviously); don't forget that all this stuff can be munitions-boosted to at least some degree.
5) The enemy will likely smash through your primary chokepoints but it almost certainly won't have an easy time of getting through all those multilayer shields to the actual ff(s) covering the wormhole, and the sheer firepower of all that stuff is causing them great losses. And then they have to deal with your secondary points, if you managed to include those, etc. It's quite likely that they just won't be able to make it to your homeworld in time to stop their impending doom
6) If you need to, you can hit them with EMPs or even Nukes as they pass through a system without a chokepoint, just to slow them down and/or separate the immune-to-emp/nuke ships from the others. Gratuitous use of lightning warheads may also be helpful.
I'd also add that since this is largely a delaying action, grav turrets and logistics command stations wouldn't be a bad idea if you can manage them; the way the waves work is a bit strange with respect to speed modifiers, but if you cover an entire enemy battlegroup with a speed dampener like that it should work fine.
Also remember that the special attack waves spawn from an AI structure that has the Warp Gate (Wave) or Warp Gate (Full) ability; this is generally just the warp gates, AI Eyes, etc. Anyway, you can take your Spire fleet and glass out a significant "no man's land" before hitting the "Declare Independence" (or, rather, build-transceiver) button just to increase the distance the attack battlegroups have to travel and thus decrease the amount of time you need to actually fight them. Nothing's stopping you from filling that no-mans-land with logistics command stations to slow stuff down, though
There's tons of other things you can do to help, it just kinda depends on which specific toys you've gotten from the ARS's, etc (awesomebombs and doomshrooms; er, autobombs and nanoswarms, could possibly be hilariously effective, for instance).