Preheat your oven to 350°F (175°C). Grease and flour a 9-inch round cake pan or a 9x9-inch square pan.
In a medium bowl, whisk together the flour, baking powder, baking soda, and salt. Set aside.
In a large bowl, cream together the softened butter and granulated sugar until fluffy, about 2-3 minutes.
Add the eggs one at a time, mixing well after each addition, then stir in the vanilla extract.
Gradually add the dry ingredients to the wet mixture, alternating with the sour cream, starting and ending with the flour mixture. Mix until just combined; do not overmix.
Gently fold in the fresh cranberries and chopped pecans if using.
Pour the batter into the prepared cake pan and smooth the top with a spatula.
In a small bowl, mix together the cinnamon and brown sugar for the topping. Sprinkle evenly over the batter.
Bake in the preheated oven for 35-40 minutes, or until a toothpick inserted in the center comes out clean.
Allow the cake to cool in the pan for 10 minutes, then transfer to a wire rack to cool completely.
Notes
Once cooled, dust the top with powdered sugar and serve with fresh cranberries on the side for a festive touch.