Live data from Hacker News

NodeJS Starter – Simple project setup using best practices and modules

github.com

1–10 of 10 posts

Re: NodeJS Starter – Simple project setup using best practices and modules

#2
The directory structure seems rather arbitrary and the use of components on the server seems weird. Also why are you using a Makefile instead of the npm scripts and grunt? Also there is no explanation of why this is an example of the best practices in the industry

Re: NodeJS Starter – Simple project setup using best practices and modules

#3
post #2

The directory structure seems rather arbitrary and the use of components on the server seems weird. Also why are you using a Makefile instead of the npm scripts and grunt? Also there is no explanation of why this is an example of the best practices in the industry

No need of Grunt at all. There is no need of npm scripts either, besides maybe for testing.

Tests and explanation comming soon. I appreciate your feedback!

Re: NodeJS Starter – Simple project setup using best practices and modules

#5
post #2

The directory structure seems rather arbitrary and the use of components on the server seems weird. Also why are you using a Makefile instead of the npm scripts and grunt? Also there is no explanation of why this is an example of the best practices in the industry

Looks like the directory structure (in lib/...) is related to the use of component.io? [for app components].

I typically build node apps with application "modules" in an apps/{name} structure and then require them all in server.coffee.

Component.io is new to me, it claims to provide an entire "bundle" of client & server side pieces, this is nice. I'll have to look into that today ...

Definitely, an explanation of these "best practices" would be nice.

Re: NodeJS Starter – Simple project setup using best practices and modules

#6
post #3
post #2

The directory structure seems rather arbitrary and the use of components on the server seems weird. Also why are you using a Makefile instead of the npm scripts and grunt? Also there is no explanation of why this is an example of the best practices in the industry

No need of Grunt at all. There is no need of npm scripts either, besides maybe for testing. Tests and explanation comming soon. I appreciate your feedback!

I feel like Grunt and npm scripts are the standard way people expect the build tools in node to work. You're already sort of using them by having npm test fork off to your Makefile

Re: NodeJS Starter – Simple project setup using best practices and modules

#7
post #5
post #2

The directory structure seems rather arbitrary and the use of components on the server seems weird. Also why are you using a Makefile instead of the npm scripts and grunt? Also there is no explanation of why this is an example of the best practices in the industry

Looks like the directory structure (in lib/...) is related to the use of component.io? [for app components]. I typically build node apps with application "modules" in an apps/{name} structure and then require them all in server.coffee. Component.io is new to me, it claims to provide an entire "bundle" of client & server side pieces, this is nice. I'll have to look into that today ... Definitely, an explanation of the…

I know that most people tend to organize their code with assets for client side assets, lib for code, test for all of their testing code and index.js as the root of the application. Including the node binaries in bin is also a nice touch. I just have never seen the component usage before and definitely need to look it up as well.

EDIT: The component todo example seems to use components on the client side but not the server side https://github.com/component/todo

Re: NodeJS Starter – Simple project setup using best practices and modules

#9
post #2

The directory structure seems rather arbitrary and the use of components on the server seems weird. Also why are you using a Makefile instead of the npm scripts and grunt? Also there is no explanation of why this is an example of the best practices in the industry

`./lib` is for modules and components. There is no difference for us. You can share to client simple modules by adding a component.json file to that directory. And vice-versa by just exposing an index.js file. You can require('regexps') for example, from both server and client and work with same definitions without repeating code. So, `./lib` turns into a nice and sharable space. This is a construction from practices we've found on the way... component.io website is one of them.

Re: NodeJS Starter – Simple project setup using best practices and modules

#10
post #7
post #5

Earlier quoted context omitted.

Looks like the directory structure (in lib/...) is related to the use of component.io? [for app components]. I typically build node apps with application "modules" in an apps/{name} structure and then require them all in server.coffee. Component.io is new to me, it claims to provide an entire "bundle" of client & server side pieces, this is nice. I'll have to look into that today ... Definitely, an explanation of the…

I know that most people tend to organize their code with assets for client side assets, lib for code, test for all of their testing code and index.js as the root of the application. Including the node binaries in bin is also a nice touch. I just have never seen the component usage before and definitely need to look it up as well. EDIT: The component todo example seems to use components on the client side but not the…

Take a look at the branches it has. Also look at component.io website code. ;)