Preheat the oven to 370℉/180℃. Line an 8" Square Tin.
If making your own, make the pastry first by combining the flour and butter in a food processor and blitz together (alternatively, rub together with fingertips until the mixture resembles breadcrumbs). Add cold water, 1 tbsp at a time until a dough forms.
Roll the dough out to about 1cm/¼ inch thick. Place into the lined tin, and trim the edges so it fits neatly into the base without going up the sides too much. Prick with a fork a few times and bake for about 10-12 minutes - until baked but not golden. Remove, and after a few minutes, spread the jam over the pastry in a thin, even layer.
In a large bowl, or the bowl of a stand mixer, combine the butter, sugar, flour, ground almonds, baking powder, almond extract and eggs until a smooth batter forms.
Pour the frangipane batter over the top of the jam layer. Spread evenly. Dot over some jam, sprinkle over the flaked almonds and bake for 40-45 minutes (until a knife comes out clean from the cake).
Let cool on a wire rack before cutting and serving.