In a medium-size mug, melt the margarine in the microwave for 1 minute.
Using a fork, whisk the egg and vanilla into the melted margarine. Add sugar and beat until smooth. Add the almond flour and whisk until all the ingredients are combined. Add the cacao powder, baking powder and salt. Whisk again till you have a smooth dough.
Microwave the ingredients in one big mug or in 2 little mugs for 75 seconds. The cake is done when a knife inserted into the center comes out clean. If you wish to add icing to the mug cake, let it cool fully before decorating.
While the mug cake is cooking in the microwave, add the margarine and vanilla extract to a small bowl or ramekin and beat with a fork until it looks fluffy.
Add cocoa powder to the bowl and mix thoroughly, making sure to remove all lumps
Add icing sugar, 1 tablespoon at a time, and mix thoroughly into icing. When you lift the fork out, the icing should stand up in little peaks.
Ice the cake by spreading the icing on top, or transfer the icing to a piping bag and pipe it on to the cake.
The topping is measured to decorate one large cupcake. If you’re making two small ones, you should double the recipe.