You are starting a new project, a web application. You are thinking on a REST API for the back end and a single page application for the front end. You choose, let’s say, Node and Express for the API and React for the SPA. Cool, now you create an empty folder and start boilerplating your back end, yada yada yada, you end up with an Express middleware to serve your SPA static files from a “public” folder.

Stop. Why is your API now serving static files? Remember your last job interview, when the interviewer asked about separation of concerns? Well, this is a good example of togetherness of concerns. I could now start writing about the problems that this approach brings but I will assume you are already convinced and start talking about an alternative approach.

We want a project structure that: