Preheat oven to 350 degrees F.
Line 3 muffin cups with paper liners and coat a 9-inch cake pan with cooking spray. Set aside.
In a large bowl, whisk all-purpose flour, baking soda, salt, and baking powder.
In another medium bowl, using an electric mixer, beat together granulated sugar and coconut oil until light and creamy. Add eggs, one at a time, and beat on low speed, just until combined.
Add lemon zest and juice and beat on low-meedium speed until combined.
With the mixer on low, add the dry ingredients to the egg mixture, alternating with buttercream and finishing with the fliur mixture. Scrape the sides and bottom of the bowl as needed.
Transfer the mixture into the prepared muffin cups, filling them half way and also add the rest of the batter to the prepared cake pan.
Place the cake pan in the center rack in the oven and the cupcakes on a rack above it.
Bake until a toothpick inserted into the center comes out clean, about 20 minutes for the cupcakes and 30 minutes for the cake.
Let the cupcakes and cake layer cool in the pan for 5 minutes, then transfer to a rack to cool completely before frosting.