Pre-heat the oven to 350°F.
Line the bottom with parchment paper and then grease an 8-inch round cake pan.
Combine the first six ingredients in a medium size mixing bowl.
Combine the grated carrots, vegetable oil, egg, and vanilla extract in a separate bow, mixing well.
Add the wet ingredients to the dry ingredients and beat on medium speed until just combined.
Add in the raisins and the pecans, stir gently to combine.
Pour into the prepared 8-inch cake pan, the batter will be thick. Spread it into an even layer. Bake for 20 minutes or until a tester inserted in the center comes out clean.
Cool the cake for 5 minutes then remove to the serving platter to cool completely before frosting.
While the cake remove the cream cheese and butter from the refrigerator to soften.
If using the coconut flakes, add them to a dry skillet and toast them on medium-low heat until lightly browned, stirring and keeping an eye on them so they don't burn. Once toasted remove them to a small bowl to cool.