Preheat your oven to 180°C (350°F) and grease the tart pan lightly with butter.
In a mixing bowl, whisk together the melted butter, sugar, and eggs until well combined.
Add the coconut milk and vanilla extract to the mixture, whisking until smooth.
In another bowl, combine the shredded coconut, flour, baking powder, and salt. Gradually fold the dry ingredients into the wet mixture using a spatula until fully incorporated.
Pour the batter into the prepared tart pan and spread it evenly.
Bake in the preheated oven for 30–35 minutes, or until the top is golden and a toothpick inserted in the center comes out clean.
Allow the tart to rest for 10 minutes before removing it from the pan.
While the tart is cooling, prepare the apple compote by peeling and chopping 2 medium apples. In a saucepan over medium heat, combine the apples with 50 g of sugar, a splash of water, and a pinch of salt. Cook for about 10 minutes, or until the apples are soft and caramelized.
Serve slices of the coconut tart topped with warm apple compote and garnish with mint leaves or a dollop of whipped cream if desired.