Where to place the front-end javascript files?
<p>I am developing an <a href="http://expressjs.com/" rel="nofollow noreferrer">express</a> based web application and I started following the  application skeleton built by <a href="https://expressjs.com/en/starter/generator.html" rel="nofollow noreferrer">express-generator</a>.</p>

<p>Next, I added to my project <a href="https://webpack.github.io/" rel="nofollow noreferrer">webpack</a> to bundle the client side assets. </p>

<p>Now I am not sure where to place the front-end javascript files, if in a <code>/src</code>  or <code>/app</code> folder?</p>

<p>In truth, I am in a dilemma between, <code>app.js</code>, <code>/lib</code>, <code>/src</code> and <code>/app</code> folders.</p>

<ol>
<li><p>According to <a href="https://expressjs.com/en/starter/generator.html" rel="nofollow noreferrer">express-generator</a>, it creates an <code>app.js</code> file as the main entry and thus it looks a little bit strange to have an <code>app</code> folder with same name of the entry point <code>app.js</code>.</p></li>
<li><p><a href="https://webpack.github.io/docs/usage.html" rel="nofollow noreferrer">webpack usage manual</a> suggests a <code>/src</code> folder to place javascript files. But I think <code>/src</code> should not be exclusively for front-end javascripts and on the other hand, I would not like to mix both server and front-end javascript files in same folder.</p></li>
<li><p>Moreover, the Accepted Answer to the question <a href="https://stackoverflow.com/a/5193206/1140754">Folder structure for a Node.js project</a>, contradicts the previous point because it states:</p></li>
</ol>

<blockquote>
  <p>/src contains all your server-side specific CoffeeScript files</p>
</blockquote>

<p>So, I think that maybe <code>/src</code> is not the better option to place front-end javscript files and according to the Accepted answer to the question <a href="https://stackoverflow.com/a/20885809/1140754">Node.js project naming conventions for files &amp; folders</a> I would follow the proposed structure:</p>

<pre><code>  /app - front-end javascript files
  /bin - helper scripts
  /lib - back-end express files
</code></pre>

<p>But is it ok to have a folder <code>/app</code> and a file <code>app.js</code> with same name? Furthermore, <code>/app</code> is related with front-end and <code>app.js</code> with back-end.</p>