The best thing to do from my experience is to use boilerplates.
Everything is architected, most libraries are pre-installed, you don't have to deal with webpack (OMG, tell me about configuring webpack), they also have a lot of documentation and most importantly sample code.
Boilerplates are fine as long as things are working. Suddenly you come across a library you want to add to your project, and the boilerplate is not working, you go in there to figure what's going on, you are now even more frustrated, there you were trying to get something done, but now you are trying to understand something you didn't even want to understand at all.
The best solution I have come up with is, to use boilerplate, but to understand what's going on before I use it in my project. By understand, I mean at-least run through the code at-least once, understand what makes up your boilerplate. Doing this has saved me tons of time in situations where I might have got stuck for hours.
Everything is architected, most libraries are pre-installed, you don't have to deal with webpack (OMG, tell me about configuring webpack), they also have a lot of documentation and most importantly sample code.
If you're using react, I found this boilerplate to be inferior to none: https://github.com/react-boilerplate/react-boilerplate