There are different approaches. You can upgrade your walls and most of your weapons gradually.

Items are marked with their current and their maximum level. Wooden walls, for example, will eventually become stone walls. The positioning of walls and weapons, however, is crucial as well.

To win as many battles as possible, you should reinforce your castle as often as possible and upgrade your weapons as much as you can!
wall upgradeshield upgrade all

To do this, press the "Build" button. Now you see the number of available and already in use construction sites.
build enbuilding places