Whisk together the whole wheat flour and salt in a bowl.
Add the cold unsalted butter pieces and egg. Use your hands to knead everything together into a smooth dough.
Wrap in plastic cling film and place in the refrigerator for 30 minutes.
Grease a 9-inch tart pan. Roll out the chilled dough into a circle. Transfer the dough circle to the greased tart pan and use your fingers to evenly crimp the edges.
Preheat the oven to 350 degrees F.
Clean the leeks thoroughly. Dirt accumulates near the stem. Chop into 1-inch pieces.
De-stem de-seed the red pepper. Dice into small cubes.
Core and slice the apple into quarters. Slice each quarter into thin wedges.
In a separate bowl, whisk together the milk, heavy cream, and grated gruyere cheese. Add the garlic powder and chili powder.
Season with salt, freshly ground pepper.