Preheat your oven to 350°F (175°C).
Grease a 9x13 inch baking pan with butter or cooking spray, then dust it with gluten-free flour or line it with parchment paper.
In a medium bowl, whisk together the gluten-free all-purpose flour, baking powder, baking soda, ground cinnamon, and salt.
In a large mixing bowl, cream the softened unsalted butter and granulated sugar together using an electric mixer for about 3-4 minutes until light and fluffy. Add the eggs one at a time, mixing well after each addition. Stir in the vanilla extract and unsweetened applesauce until well combined.
Gradually add the dry ingredients to the wet mixture and mix until just combined. Gently fold in the diced apples and chopped nuts (if using).
Pour the batter into the prepared baking pan and spread it evenly.
Bake for 35-40 minutes. Check for doneness by inserting a toothpick into the center; it should come out clean.
Allow the cake to cool in the pan for about 10 minutes, then transfer it to a wire rack to cool completely.