Huh, if you don’t have an ingredient, I guess you can recursively check if you have a recipe to make it, and see if you meet it’s requirements. That falls down with quantity, because if you need 5 of something, we don’t have a way to check whether you have enough raw materials to make that many, just that you can make at least one of them.
Ideally, if you had the capacity to make all the components for something, you could just kick it off and automatically make them, then make the thing itself. That’s a lot of infrastructure though, and the crafting code is already pretty hairy.