Skip to content

Instantly share code, notes, and snippets.

@csanz
Created May 12, 2011 03:23
Show Gist options
  • Save csanz/967878 to your computer and use it in GitHub Desktop.
Save csanz/967878 to your computer and use it in GitHub Desktop.
The ExpressJS-MongooseJS.org initiative ;)
Trying to come up with a standard expressjs + mongoose mvc-like folder structure.
still keep it flexible, so anyone can do whatever they want,
but provide a structure for new people.
(borrowing a little form rails)
-/app
--/controller
---/user_controller.js
--/models
---/index.js
---/user.js
--/views
---/layout.js
---/index.js
---/user/
----/index.js
-/lib
--/site.js
--/helpers.js
-/public
--/javascript
--/stylesheets
index.js
Readme.md
History.md
package.json
Partials naming convention:
_<name>.js
@tj
Copy link

tj commented May 12, 2011

looks find to me, that's pretty similar to what I typically do

@csanz
Copy link
Author

csanz commented May 12, 2011

I just discovered this ;) https://github.com/visionmedia/ngen

@aheckmann
Copy link

ngen is closer to what i typically go with. the primary diff in this gist seems to be having /app and /lib separated. i usually just go with /lib.

@csanz
Copy link
Author

csanz commented May 14, 2011

thanks Aaron! I'll modify and send another draft. I get a lot of new people wanting to know at least what to start with. I've started to use

/lib
models.js
config.js
routes.js
helpers.js

Mainly because I use the CMD+T on Textmate and helps me find those files faster.

@aheckmann
Copy link

aheckmann commented May 14, 2011 via email

@csanz
Copy link
Author

csanz commented May 14, 2011

hahaha hey, i do vim too :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment