Peels and dice the vegetables as indicated, and layer the eggplant on paper towels then sprinkle with kosher salt. Let them sit at least 10 minutes.
Put two different frying pans on a medium heat and add a splash of olive oil to each.
Add the diced onions to one of the pans, with a pinch of salt. Sauté over a medium-low heat until they start to turn transparent, then cover the pan and allow them to poach (you don't want them to brown). Once fully cooked, reserve in a large bowl.
In the meantime, add the peppers to the other pan and sauté over a medium high heat until starting to brown. Lower to medium and cover for about 10 minutes. Once cooked through reserve along with the onions.
Rinse the salt off of the eggplant in a mesh strainer.
Follow the same steps as the peppers to cook the zucchini and eggplant (in separate pans). You want to start cooking them on medium high, and once starting to brown lower the heat and cover until tender (stirring a few times so they don't stick). Then reserve along with the other vegetables, mixing to make all the flavors combine.
Add all of the spices to the bowl of vegetables and mix well.
Next, add a bit more oil to one of the pans if necessary, and add the diced garlic (and the dried cayenne peppers if using). Sauté over medium heat until starting to fry. Then add the peeled and diced tomato to the pan. Cook over a medium low heat for about 20 minutes, stirring frequently, until you have tomato sauce. Add the sugar, and adjust for salt.
Now, in a large frying pan, mix the previously cooked veggies with the tomato sauce.
Mix everything well, and cook for 10 minutes over a medium heat. Adjust for salt and spices, and enjoy!