It depends on how cheap (vs labor) you want to get and what your digestive system, and daily schedule, can handle.
If you want to go bare bones labor vs cost, grow peppers and tomatoes and buy dried beans. That is very boring and I wouldn't want that meal more than twice a week, but some portions can be made into different meals.
Yes legumes. Every time you want them. The diet will fail if you end up disgusted that you are eating them when you want something else.
Spices are a great way to mitigate salt and fat in a diet, but on a budget, things get trickier because there are few healthy things cheaper than salt or fat, and you do need fat in a healthy diet. Don't fall victim to diet crazes that suggest otherwise. Fat can be cheap vegetable oil if that fits into what you're cooking.
Whole grains, absolutely. It depends on your finding recipes that you want to eat. One thing that I found to be fortunate was that I can eat Just About Anything if I put my homemade hot sauce on it, but that doesn't mean that I would be happy doing so.
The two meals that I find easiest to make that incorporate those ingredients are soup or burritos. I do eat a lot of both.