Prep the pans and oven. Heat the oven to 350°F (175°C). Grease two 8-inch round cake pans and line the bottoms with parchment. Lightly dust with gluten-free flour, tapping out the excess.
Whisk the dry ingredients. In a large bowl, combine the gluten-free flour, baking powder, baking soda, cinnamon, nutmeg, and salt.
Whisk well to blend evenly.
Mix the wet ingredients. In another bowl, whisk the eggs, granulated sugar, brown sugar, oil, applesauce, and vanilla until smooth and slightly thickened, about 1 minute.
Combine wet and dry. Pour the wet mixture into the dry ingredients. Stir with a spatula until just combined. Avoid overmixing; a few small lumps are fine.
Fold in the add-ins. Gently fold in the grated carrots.
If using, add the pineapple (well-drained), nuts, and raisins. The batter will be thick but scoopable.
Divide and bake. Split the batter evenly between the pans. Smooth the tops.
Bake for 25–30 minutes, or until a toothpick comes out clean with a few moist crumbs.
Cool completely. Let the cakes rest in the pans for 10 minutes, then turn them out onto a wire rack. Peel off the parchment and cool fully before frosting.
Make the frosting. Beat cream cheese and butter together until creamy and fluffy, 2–3 minutes. Add vanilla and salt.
Gradually add powdered sugar until the frosting is smooth and spreadable.
Assemble the cake. Place one layer on a serving plate. Spread a generous layer of frosting on top. Add the second layer and frost the top and sides.
For a rustic look, leave the sides semi-naked.
Chill briefly, then serve. For cleaner slices, chill the cake for 20–30 minutes. Slice with a sharp knife, wiping the blade between cuts.