I have very good friends who cannot eat either gluten or diary products. So when I invited them at home I had to find ways of cooking without these products.
Some other relatives found that avoiding gluten improves joints and reduces rheumatisms.
After a while I found a rather simple way to replace these products.
In pastries I mostly replace wheat flour by rice flour using the exact same weight in the recipes. I use that for cream puffs that flatten after cooking which is very nice.
I sometimes also use almond powder, chestnut or corn flour or a mix of them which soften the dough.
For butter I struggled a little until I found cocoa butter that I use with the exact same weight for butter that was in the original recipe. You just have to melt it a little before usage. Here is the one I use:
The good things is that Cocoa butter never gets rotten or rancid even if left outside.