Preheat the oven to 180°C (350°F). Line the baking dish with parchment paper.
Peel and grate the apples, then set aside.
In a mixing bowl, whisk together the coconut sugar and eggs.
Add the coconut oil, lemon juice and vanilla, and mix until combined.
Add the flour and baking powder, and mix until smooth. The batter will be thin.
Let the batter rest for 5-10 minutes, so the flour has time to absorb the liquid.
Pour half the batter into the prepared baking dish.
Spread the grated apples evenly over the batter, then sprinkle the cinnamon on top.
Pour the remaining batter over the apples.
Sprinkle the blanched almonds on top, if using.
Bake for 30-45 minutes, until the top is firm and baked through. A toothpick should come out mostly clean, though the inside will stay soft from the apples.
Let the pie cool completely before slicing.