Starting from scratch, origin from baking as to start from raw ingredients. Most often used in the context of pizzas and software.
The resident expert was out so I used first principles to understand why the website was down. I had to look at the code to do so.