Add the tomato sauce (or spaghetti sauce) to the bottom of the casserole dish. (I use a dish that is about 11" oval)
Add the minced garlic and all the spices. Mix it in and spread the sauce to cover the bottom of the dish.
Start stacking the veggies and standing them on their edges leaning against the edge of the dish. Work your way around until you have a complete circle. Fill in the middle with stacks in any way you want until the dish is filled. If using fresh basil leaves, include them in the alternating stacks of veggies.
If using pesto, you can either dab it between some of the slices of veggies or spread it over the top of the filled casserole dish. It's good both ways, but a bit more work to add it in between the veggies.
Bake at 350 degrees, uncovered, for about 1 hour.
For faster baking, you can cover the dish for 30 minutes and uncover and continue baking for an additional 15 minutes.
The veggies should be soft and the onion transparent.
Scoop out a portion and serve it over pasta with additional pesto on top, if using.