Add the pesto and grated mozzarella to a plate. Mix through with your fingers. It might clump slightly but use a fluttering motion with your fingers to break them apart. Set aside in the fridge.
Remove the seeds and white membrane in the red pepper. Chop the peppers, zucchini and aubergine into approx 2cm cubes.
Grate the tomatoes and discard the skins that get left behind. Set aside the juice and pulp.
Heat the olive oil in a large heavy-bottomed pot. Add the onions, garlic and red peppers and sauté over a medium heat until the onions brown slightly, about 5-7 mins.
Add the zucchini and aubergine and cook for 5 mins. Add the tomato purée, chilli flakes, oregano, pepper, and salt. Stir through, then cover and cook on low for 25-30 mins.
You want the vegetables to have cooked through and softened, but with a bite to them. The sauce will also have reduced by this time. Check a few times in between to make sure nothing catches at the bottom. Add a touch of water if necessary if it appears too dry. Check and adjust seasoning.
Assemble: I did two layers. Tip half the vegetables into an oven-proof dish. Top with half the pesto cheese. Repeat once more with the remaining vegetables and the final layer of cheese.
Bake in a preheated 180 C oven for 7-10 mins or until the cheese is melted through. Serve hot with crusty bread and with/without fried eggs alongside.