You can pop down a starbase and add a few defence modules where you expect the AI to attack. It will waste many ships trying to destroy the starbase, as long as you have decent repair tech the starbase will survive for a long time.
If the enemy fleet is always targetting a certain sector and has a tech advantage then place a few starbases there, add modules to increase ATT/DEF of your ships and fight the enemy only within that sector.
If the enemy is garrisoning key planets with capital ships and you can't attack effectively, then bring along a fleet of constructors and build a starbase in the enemy sector. Add ATT/DEF booster modules to increase your navy, clear out the defenders and assault the planets. Add repair modules to quickly restore your damaged ships to full hit points.
To counter enemy influence and exert influence on them, add influence modules. Once you get the Culture Palace tech this has a huge effect and can gain you hundreds of billions of new citizens. Terror Stars are IMHO over-priced and too slow, just build new Culture Palace bases instead.
If you have a sector with several good planets, build a couple of starbases and add the production-boosting modules. This will give *free* production boosts (as well as some paid-for production) on each planet in the sector. Add movement boosters to the starbases and you get a sector where you not only can build several capital ships per turn but also move them out with +10 movement - force projection at its best! Works nicely for anti-matter missiles as well