0

I have a fairly large javascript application mostly using jquery and knockout. Essentially I make one major separation in my folder structure app has all the code I have written and is further divided into constants, views, models, and viewmodels. Then I have vendor which is code I did not write like jquery, knockout, plugins, etc. The problem I am having is where do I put the stuff that falls in between. I Have written some custom bindings for knockout and extended some functionality of some jquery plugins and they are just sitting in the root of my app dir. What is a best practice or naming convention for this.

+app
 -- constants
 -- models
 -- viewmodels
 -- views
 jquery-plugin-extras.js
 knockout-bindings.js
 etc
+vendor
 jquery.min.js
 knockout.min.js
 jquery-plugin.min.js
Jehof
  • 34,674
  • 10
  • 123
  • 155
BillPull
  • 6,853
  • 15
  • 60
  • 99
  • A typical practice is to create a "System" or "Core" directory for all your system or core functionalities. You can also create a folder called "Plugins" to put all your plugins for jquery or knockout .etc. I would also change the name of your folder "vendor" to "lib" which is where most of the libraries live! – Sujesh Arukil Mar 21 '13 at 13:07
  • could you write out a folder structure like above in an answer so I can accept it. – BillPull Mar 21 '13 at 15:55

1 Answers1

0
+app
 -- system (or core) //contains core or system related generics
 -- config // single place to store your configurations, if you have just one, put it at the root
 -- plugins // all plugins or ko bindings here
 -- constants
 -- models
 -- viewmodels
 -- views
 -- main.js // any bootstrapping, initial configurations and such go in to this file.
+lib
 --jquery.min.js
 --knockout.min.js
 --jquery-plugin.min.js
Sujesh Arukil
  • 2,469
  • 16
  • 37