Better folder organization
Goals
I bielieve the current organization is a cool first step. What I'm targeting for the current folder base is:
- Easy publication: we should just use grunt to create public/ & have a very simple task that creates a zip from it and done!
- Scriptable: the base project should be easy to replicate using a node script to generate new projects from scratch
- Developer friendly: it should be easy to debug using the default browser tools in dev mode meaning we want to avoid minification & concatenation & stuff like that wherever possible (that implies to have a simple way to declare if yes or no we are developing or publishing the sources)
- Test friendly: it should be easy to write tests and to know were to put the files contaiing them
Issues
Right now I see the following issues with the current system as is:
- Bower publish files to public/ which means that useless files are going to be published (since everything bower deploys is not always necessary) if we go for a simple "zip the public folder" to publish
- Possible solution: Publish to a different folder (like the original bower_components) and use bower to publish files from it to public
- Server vs Client files: It is not clear right now how they will be separated. Nothing should ever be written in public directly. That is certain. But we want to publish server files and not the other ones because they are going to be processed & included in public/
- Needs a cool solution, right now I don't have a perfect proposition
- Mode dev/prod: how to easily go from dev to prod envs to make tests without breaking everything and doing too much specialized code
- We need to avoid specific code in the server code as much as possible. I believe that there we should only activate stacks & so on but nothing more
- There too, I'm not exactly sure of the best way right now but I'm sure it should rely a lot on grunt
- The info on the mode should not be in a versionned file to avoid getting it in the repository with different values every time. It should also not be the default express way using an environment variable because we will forget to set it properly, that's for sure
- Tip: we can export the proper env variable for express from the master cluster node to the children
- Tests: no idea where to put them. We also need to decide on the testing library