Preheat your oven to 175°C (350°F) and grease your cake pans, lining them with parchment paper for easy removal
In a large bowl, whisk together flour, baking powder, baking soda, salt, cinnamon, nutmeg, and ginger until evenly combined
In another bowl, mix sugar, brown sugar, and vegetable oil until well blended
Add eggs one at a time, beating well after each addition to create a smooth mixture
Stir in vanilla extract to enhance the flavor profile
Gradually add the dry ingredients into the wet mixture, mixing gently until just combined
Fold in grated carrots, ensuring they are evenly distributed throughout the batter
Add the crushed pineapple and mix gently; this adds moisture and sweetness to the cake
Fold in shredded coconut and nuts if using, being careful not to overmix
Divide the batter evenly between prepared cake pans and smooth the tops
Tap the pans lightly on the counter to remove air bubbles
Bake for 30 to 40 minutes or until a toothpick inserted into the center comes out clean
Allow cakes to cool in the pans for 10 to 15 minutes before transferring to a cooling rack
Let cakes cool completely before frosting to prevent melting
For frosting, beat cream cheese and butter together until smooth and creamy
Gradually add powdered sugar while mixing on low speed to avoid lumps
Add vanilla extract and pineapple juice, then beat until light and fluffy
Place one cake layer on a serving plate and spread a generous layer of frosting
Add the second layer and apply a thin crumb coat
Chill for 15 minutes to set the crumb coat
Apply the final layer of frosting evenly across the cake
Decorate with shredded coconut, pineapple chunks, or carrot shavings if desired
Slice and serve once frosting is set