Example project directory, the root folders are pretty consistent, the sub directories (on lib
, etc) are just examples of what might be in there.
.
├── lib
│ ├── db
│ ├── handlers
│ └── routes
├── node_modules
├── public
│ ├── assets
│ ├── css
│ ├── images
│ └── js
├── tests
└── views
└── _partials
.
root – config files: .jshintrc, .gitignore, Procfile, package.json, README.md, etclib
– server side application code root (often includes subdirectories)node_modules
– dependenciespublic
– public facing client code: .html files, directories: js, css, images, fonts, etcviews
- server side templatestests
- test directories that mirrorlib
with (ideally)<script>.test.js
mirrored filename
bin
– if there's CLI tools includeddocs
– though if you're able to put this in a wiki, it might make more sensecoverage
– output of test coverage (this would be nice in all projects)
Having run through a few drafts of boilerplate myself, I found Sail.js pretty comforting (even if I turn off many of the features). I also kind of liked some of the structure from LoopBack. Not a sales pitch but I have been trying to look at larger frameworks for inspiration vs slowly evolving on my own. I typically add convention & abstraction little by little (e.g. adding separate config space for DBs, etc); I feel like I keep getting asymptotically closer to reinventing the wheel.