Anything works vs the Ai coz the Ai is retarded
Yes, but some things work better than others.
By the time someone else's first titan is produced, what should be the composition of your static defenses (starbases as well as gauss cannons/hangers/repair etc) and your fleet, and how much effort should you put into developing each to maintain a good balance?
The time it takes for titans to come out can vary greatly. But I'd say you shouldn't even have starbases at that point. The only exception might be if you have one choke point that covers all attack points one enemy might use against you in order to use most of your fleet to attack another player. Obviously its your choice on how to play, but many new players over invest in static defense because they do not feel confident in offensive action until late game when they are fully teched up. If this is the case, I'd encourage you to try and build starbases only when strictly necessary.
The most important defense structure is the repair bay, especially as TEC. 40 hull/sec restoration is huge, and can stack with the repair cruiser 20/sec. If you have a choke point under serious attack, you should have enough of both to keep your starbases and capitalships under that 60 hull repair at all times. A phase jump inhibitor is also a good idea to make sure you inflict a crippling blow once your opponent does attack. You may want one hanger for fighters and the flak guns to help thin out bombers or to chance down rogue siege firgates. You shouldn't build many Gauss turrets except early game to help clear out militia or if you don't have room for anything else.
Flak frigates, repair cruisers, and the Akkan battle cruiser (backed by LRF) are by far the best ships to have backing up your defenses. The first two have already been explained. The Akkan is amazing at extending the range of your Starbase so that only strikecraft can out range it. Any LRFs you have nearby will also have their range boosted so they can comfortable attack from behind defenses.
If your opponent decided to counter this with strikecraft, this can be one of the few cases where its really worth while to get a Kol with flak burst.
I've fought only one player who used the TEC loyalists for anything but early Novaliths. Basically, he rushed double starbases to take advantage of the TEC trade upgrade he put on them, which gives the TEC Loyalists theoretically the highest economic potential of any faction. He then planned to hit me from Novaliths from afar to ensure he'd win the war of attrition. However, this only worked because it was a random small map 1v1, with easy choke points and very long distances between players. I don't think he would have won because he avoided getting a titan, and Advent Rebels are extremely powerful fully teched up, so long games worked to my favor as well, but I'll let you be the judge.