# Project Directory Structure?

**URL:** <https://community.volumio.com/t/project-directory-structure/2066>\
**Category:** Developer's Corner\
**Created:** [December 9, 2014, 8:20pm UTC](https://community.volumio.com/t/project-directory-structure/2066 "2014-12-09T20:20:02Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![ning-yu](https://community.volumio.com/user_avatar/community.volumio.com/ning-yu/32/110_2.png) [@ning-yu](https://community.volumio.com/u/ning-yu)\
**Post date:** [December 9, 2014, 8:20pm UTC](https://community.volumio.com/t/project-directory-structure/2066/1 "2014-12-09T20:20:02Z")

</div>

I’m out of town this week and have limited access to internet, but I can see lots of good things are happening!

Looking at the new repo for WebUI-NODE, I’m having some trouble understanding the motivation behind the file naming scheme and directory structure. Could you please explain?

Also, I think its a good idea to leave the node\_modules folder out of our repo.

---

<div class="post-metadata">

**Author:** ![jotak](https://community.volumio.com/user_avatar/community.volumio.com/jotak/32/66_2.png) [@jotak](https://community.volumio.com/u/jotak)\
**Post date:** [December 9, 2014, 9:39pm UTC](https://community.volumio.com/t/project-directory-structure/2066/2 "2014-12-09T21:39:08Z")

</div>

> [@ning-yu](#):
>
> Also, I think its a good idea to leave the node\_modules folder out of our repo.

(and same for “bin”, I think it’s generated files, no?)

---

<div class="post-metadata">

**Author:** ![Meryn](https://community.volumio.com/user_avatar/community.volumio.com/meryn/32/112_2.png) [@Meryn](https://community.volumio.com/u/Meryn)\
**Post date:** [December 9, 2014, 9:49pm UTC](https://community.volumio.com/t/project-directory-structure/2066/3 "2014-12-09T21:49:40Z")

</div>

> [@jotak](#):
>
> (and same for “bin”, I think it’s generated files, no?)

If we move the start-file (bin/www) then I think yes.

---

<div class="post-metadata">

**Author:** ![Hooch](https://community.volumio.com/user_avatar/community.volumio.com/hooch/32/145_2.png) [@Hooch](https://community.volumio.com/u/Hooch)\
**Post date:** [December 9, 2014, 9:55pm UTC](https://community.volumio.com/t/project-directory-structure/2066/4 "2014-12-09T21:55:28Z")

</div>

The bin/www in it’s a generated file from NodeEclipse Express plugin, I keep it because it serve as single entry point: instead of lunching every Node module you can just run nodejs bin/www and all the node module are started. Plus all the ports used and the “most” of the require are centralized there. I think this is a good thing, but if there is same good practice that I’m missing we can set up the thing.

The philosophy behind the current project foldering is to give it some structure:

- view: is supposed to keep GUI files
- controllers: is supposed to keep server side module
- public/scripts: should contains script that must be imported in the view files
- routes: is for express routes modules

that’s all. Hoping this could make the project more understandable.

Any advice will be very appreciated.

Edit:

> [@ning-yu](#):
>
> Also, I think its a good idea to leave the node\_modules folder out of our repo.

Yup, node\_modules does not need to stand in the repo.

> [@jotak](#):
>
> (and same for “bin”, I think it’s generated files, no?)

I think we can keep the bin/www (we can rename it) in the repo 'cause it can be used as single entry point.

Edit:  
@ning-yu for the naming we are still discussing in the volumio 1.6 discussion thread

---

<div class="post-metadata">

**Author:** ![volumio](https://community.volumio.com/user_avatar/community.volumio.com/volumio/32/3_2.png) [@volumio](https://community.volumio.com/u/volumio)\
**Post date:** [December 9, 2014, 10:07pm UTC](https://community.volumio.com/t/project-directory-structure/2066/5 "2014-12-09T22:07:27Z")

</div>

> [@ning-yu](#):
>
> Also, I think its a good idea to leave the node\_modules folder out of our repo.

Yup, node\_modules does not need to stand in the repo.

> [@jotak](#):
>
> (and same for “bin”, I think it’s generated files, no?)

I think we can keep the bin/www (we can rename it) in the repo 'cause it can be used as single entry point.  
[/quote]  
Yep, think we can keep bin in the repo, as for the modules. I’ll remove them and add to gitignore…

---

<div class="post-metadata">

**Author:** ![jotak](https://community.volumio.com/user_avatar/community.volumio.com/jotak/32/66_2.png) [@jotak](https://community.volumio.com/u/jotak)\
**Post date:** [December 10, 2014, 7:14am UTC](https://community.volumio.com/t/project-directory-structure/2066/6 "2014-12-10T07:14:12Z")

</div>

Ok, I didn’t know node-eclipse generates this file, I’m a bit surprised to see source files in a “bin” folder, that’s not common.

---

<div class="post-metadata">

**Author:** ![Hooch](https://community.volumio.com/user_avatar/community.volumio.com/hooch/32/145_2.png) [@Hooch](https://community.volumio.com/u/Hooch)\
**Post date:** [December 10, 2014, 12:19pm UTC](https://community.volumio.com/t/project-directory-structure/2066/7 "2014-12-10T12:19:17Z")

</div>

That’s odd, we can move it without problems, but i like the idea to have one entry point only.

---

<div class="post-metadata">

**Author:** ![volumio](https://community.volumio.com/user_avatar/community.volumio.com/volumio/32/3_2.png) [@volumio](https://community.volumio.com/u/volumio)\
**Post date:** [December 10, 2014, 10:06pm UTC](https://community.volumio.com/t/project-directory-structure/2066/8 "2014-12-10T22:06:12Z")

</div>

The WebUi files are supposed to go in view folder. Any suggestion on that?

---

<div class="post-metadata">

**Author:** ![ning-yu](https://community.volumio.com/user_avatar/community.volumio.com/ning-yu/32/110_2.png) [@ning-yu](https://community.volumio.com/u/ning-yu)\
**Post date:** [February 1, 2015, 4:01pm UTC](https://community.volumio.com/t/project-directory-structure/2066/9 "2015-02-01T16:01:14Z")

</div>

The “node\_modules” folder has been removed from the repo. When you next do a pull, it should delete the folder from your working tree.

To reinstall the needed Node modules, just navigate to your root directory “WebUI-NODE” and run “npm install”.

---

<div class="post-metadata">

**Author:** ![volumio](https://community.volumio.com/user_avatar/community.volumio.com/volumio/32/3_2.png) [@volumio](https://community.volumio.com/u/volumio)\
**Post date:** [February 1, 2015, 9:54pm UTC](https://community.volumio.com/t/project-directory-structure/2066/10 "2015-02-01T21:54:22Z")

</div>

I think we should keep the node\_modules (at least when we have them for Armv6). From my experience having them compiled, and stable among releases, avoids lots of problems.  
If a module gets updated, and receives a new bug, we may have troubles identifying where the issue is.  
Plus, if a module is not released as a binary, we need to compile it each time, installing tons of junk along with gcc and make…  
What do you think?

---

<div class="post-metadata">

**Author:** ![volumio](https://community.volumio.com/user_avatar/community.volumio.com/volumio/32/3_2.png) [@volumio](https://community.volumio.com/u/volumio)\
**Post date:** [February 2, 2015, 12:35am UTC](https://community.volumio.com/t/project-directory-structure/2066/11 "2015-02-02T00:35:16Z")

</div>

Good news BTW,  
I tried the WebUi on the new System built with script:  
[github.com/volumio/Build](https://github.com/volumio/Build)

And it works like a charm… See it coming together! 😉

---

<div class="post-metadata">

**Author:** ![ning-yu](https://community.volumio.com/user_avatar/community.volumio.com/ning-yu/32/110_2.png) [@ning-yu](https://community.volumio.com/u/ning-yu)\
**Post date:** [February 2, 2015, 1:17am UTC](https://community.volumio.com/t/project-directory-structure/2066/12 "2015-02-02T01:17:01Z")

</div>

> [@michelangelo](#):
>
> Good news BTW,  
> I tried the WebUi on the new System built with script:  
> [github.com/volumio/Build](https://github.com/volumio/Build)
> 
> And it works like a charm… See it coming together! 😉

That’s very cool!

I’m okay with leaving node\_modules in the repo if it helps with compatibility. Do you think there’s an alternative way, though, like listing specific module versions in ‘package.json’ so they don’t change?

---

<div class="post-metadata">

**Author:** ![volumio](https://community.volumio.com/user_avatar/community.volumio.com/volumio/32/3_2.png) [@volumio](https://community.volumio.com/u/volumio)\
**Post date:** [February 2, 2015, 8:29pm UTC](https://community.volumio.com/t/project-directory-structure/2066/13 "2015-02-02T20:29:18Z")

</div>

Yes, that could be an idea!  
I’ll paste soon a working image so we can work on the pi for it! And see real world performances (very good indeed, really better than php5-fpm!)

---

<div class="post-metadata">

**Author:** ![ning-yu](https://community.volumio.com/user_avatar/community.volumio.com/ning-yu/32/110_2.png) [@ning-yu](https://community.volumio.com/u/ning-yu)\
**Post date:** [February 5, 2015, 7:06am UTC](https://community.volumio.com/t/project-directory-structure/2066/14 "2015-02-05T07:06:35Z")

</div>

Is [npm shrinkwrap](https://docs.npmjs.com/cli/shrinkwrap) what we’re looking for?

---

<div class="post-metadata">

**Author:** ![volumio](https://community.volumio.com/user_avatar/community.volumio.com/volumio/32/3_2.png) [@volumio](https://community.volumio.com/u/volumio)\
**Post date:** [June 12, 2015, 2:32pm UTC](https://community.volumio.com/t/project-directory-structure/2066/15 "2015-06-12T14:32:11Z")

</div>

Great idea!

---

<div class="post-metadata">

**Author:** ![chsims1](https://community.volumio.com/user_avatar/community.volumio.com/chsims1/32/87_2.png) [@chsims1](https://community.volumio.com/u/chsims1)\
**Post date:** [May 30, 2020, 7:24pm UTC](https://community.volumio.com/t/project-directory-structure/2066/16 "2020-05-30T19:24:32Z")

</div>

Archived on May 30, 2020, 7:24pm UTC


