Prepare the Cake Batter : Preheat your oven to 350°F (175°C). Grease and lightly flour two 9-inch round cake pans or a 9x13-inch baking dish. In a large mixing bowl, whisk together the applesauce (or oil), granulated sugar, and eggs until well combined and creamy. In a separate bowl, sift together the flour, baking soda, baking powder, salt, and cinnamon. Gradually add the dry ingredients to the wet mixture, stirring just until combined. Avoid overmixing. Gently fold in the grated carrots, shredded coconut, nuts (if using), vanilla extract, and crushed pineapple, including its juice. Mix until evenly distributed.
Bake the Cake : Pour the batter evenly into the prepared pans. Smooth the tops with a spatula. Bake for 30-35 minutes (round pans) or 40-45 minutes (9x13 pan), or until a toothpick inserted in the center comes out clean. Remove from the oven and let the cake cool in the pans for 10 minutes. Transfer to a wire rack to cool completely before frosting.
Make the Cream Cheese Frosting : In a large bowl, beat the softened butter and cream cheese together until smooth and creamy. Add the vanilla extract and gradually mix in the powdered sugar, beating on low speed until fully incorporated and fluffy.
Frost and Decorate the Cake : If using round pans, level the cake layers if necessary. Place one layer on a serving plate and spread a generous layer of frosting on top. Add the second cake layer and frost the top and sides evenly. For a 9x13 cake, simply frost the top. Sprinkle toasted pecans or coconut on top for added crunch and decoration.