Slice the zucchini, tomatoes, lemons and onion by hand into 4mm (2/8 inch) thickness.
Peel the potatoes and slice on the mandoline into the same thickness as the vegetables. For the garlic, peel and slice them as thin as possible.
In a bowl combine all the vegetables and season with salt, pepper and thyme sprigs. Finally toss them in olive oil.
To build the gratin, layer a stack of vegetables in your hand alternating between potatoes and the other vegetables. Place them standing up in the baking dish.
Continue until you have used up all the vegetables and filled up the baking dish. Stick the garlic slices randomly between layers.
Place the onions in the gap between the layers.
Sprinkle the gratin with parmesan and bake in a pre-heated oven at 180°C (350°F) for 55 minutes.
Check the doneness with a skewer. There should be no resistance when sticking it through a potato.
Serve on its own with a salad or as a side to your favourite main