For me, it depends on whether the project is for fun (just something I need) or a chance at a sustainable business.
If I want to test whether the project could turn into a sustainable business, I'll take a few days and create something minimal. This allows me to get the solution "out of my head" and ensure I actually want to work on it. In parallel, I'll start defining potential market segments and the problems the project could solve (C-P-S). This starts the process of customer development and trying to determine problem/solution fit. I'll then tailor the project based on actual metrics and user interviews.
I've found that the more I put off the coding in favor of designing and planning, the more I tend to spin my wheels. Bring it to reality, and then iterate over it. You'll never think of everything from the start, and if you do, it's likely wrong.