Building a strong base is vital for success, unfortunately there is no one way to build the perfect base that is capable of completely stopping other players intent on raiding it for your hard earned resourses. Building your base will basically be a case of trial and error as you try to come up with a design that is able to withstand most of the enemy attacks.
The best tactic is to focus on protecting your Mines rather than the Throne Room because even if you do lose the battle you will still get to keep your resources. A good tactic is to place the Throne Room close to the entries so the enemy automatically go to it and destroy it before they get to the mines.
We have questions and answers related to this topic which may also help you: