What is a proper baby diet to avoid constipation?

Balanced diet. A baby eating 3 meals and 2 snacks should have a lot of fluid too. Water , milk juice can be balanced with a good balanced diet including fruits and veges.
Hydration. For any age including infants the key to avoiding constipation is good hydration. Infant's diet is predominantly liquid formula. Extra fluids in the form of water or fruit juices will help avoid constipation. This would several extra ounces of each a day in addition to the nornal formula.