Heroes go first. Storages second. Then you go for army buildings. Then - research and new defenses. Don't upgrade Town Hall when defenses aren't yet maxed. You want to put into the queue Elixir and Gold upgrade at the same time. Otherwise, you'll have one type of resource piling up.
When upgrading defenses, focus on AoE defenses first with single target defenses second.