How is the development model between frontend and server

We are looking at WN and ERPnetx the last few days. I'm wondering how WN and ERPnext is developed? In the forums I read
from time to time that calculations are done in JS in the frontend as well. Is this true or is the server always in charge of calculation
values and make transactions?

Further we would like to know which steps are required to build a module. Is there Server (PY) and Frontend (JS) coding required
or ist the Frontend driven by the Meta Model of the server?

Many thanks for advise,

Holger



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Holger,

1. Calculations in Sales / Purchase transactions are done both on the front-end and back-end. In the front-end so that the user gets fast feedback and in the back-end it is recalculated as the transaction can also be pushed via an API without any calculations. The code is not fully refactored but you can see 

https://github.com/webnotes/erpnext/blob/master/controllers/accounts_controller.py

https://github.com/webnotes/erpnext/blob/master/selling/doctype/sales_common/sales_common.js

2. Regarding creating new modules. You can create them from the front end and then only edit the controllers. To create a new table, create a new DocType. Set developer_mode = 1 so that the folders and controller stubs are automatically created.

DocTypes are automatically synced during deployment.

We are also pushing a new plugin architecture in our new release "wsgi" branch that will standardize how to manage plug-ins so that you do not have to touch the existing code base.

To create new desktop icons, use config.json.

Unfortunately there is not much documentation we have done recently. If you have specific questions, you can ask.

best,
Rushabh




On Sunday, October 20, 2013 11:35:29 PM UTC+5:30, Holger Winkelmann wrote:
We are looking at WN and ERPnetx the last few days. I'm wondering how WN and ERPnext is developed? In the forums I read
from time to time that calculations are done in JS in the frontend as well. Is this true or is the server always in charge of calculation
values and make transactions?

Further we would like to know which steps are required to build a module. Is there Server (PY) and Frontend (JS) coding required
or ist the Frontend driven by the Meta Model of the server?

Many thanks for advise,

Holger



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
HI Rushabh,

On Monday, 21 October 2013 14:32:52 UTC+2, rushabh wrote:
Holger,

1. Calculations in Sales / Purchase transactions are done both on the front-end and back-end. In the front-end so that the user gets fast feedback and in the back-end it is recalculated as the transaction can also be pushed via an API without any calculations. The code is not fully refactored but you can see

Do you really think thats a good idea to do so? It smell a bit like code duplication here. If. i.e. the JS code somehow compiled from the server Docs and Modules I would agree to this approach.
I could suggest a different approach where the communication back and forward to the client could be done arround websockets which is fast enough and will leave the transactional code on the server.
I totally agree that client side code can exists for prevalidation of form fields, helper functions for selectors, rendering of the raw data in a local or intended format etc. basically all function which make the UI fast,
but no functional calculations.

We i.e. using angular.js combined with
angular.ui which is bootstrap based to encapsulate the UI functions and widgets and communicate via JSON over websocket to the server. 
  



2. Regarding creating new modules. You can create them from the front end and then only edit the controllers. To create a new table, create a new DocType. Set developer_mode = 1 so that the folders and controller stubs are automatically created.

DocTypes are automatically synced during deployment.
 
This sounds good. 

We are also pushing a new plugin architecture in our new release "wsgi" branch that will standardize how to manage plug-ins so that you do not have to touch the existing code base.

To create new desktop icons, use config.json.

Unfortunately there is not much documentation we have done recently. If you have specific questions, you can ask.

We will come back with questions,

many thanks so far.

best,
Rushabh




On Sunday, October 20, 2013 11:35:29 PM UTC+5:30, Holger Winkelmann wrote:
We are looking at WN and ERPnetx the last few days. I'm wondering how WN and ERPnext is developed? In the forums I read
from time to time that calculations are done in JS in the frontend as well. Is this true or is the server always in charge of calculation
values and make transactions?

Further we would like to know which steps are required to build a module. Is there Server (PY) and Frontend (JS) coding required
or ist the Frontend driven by the Meta Model of the server?

Many thanks for advise,

Holger



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Holger,

You are right its not the ideal solution. We have not really explored web sockets yet and we are not fully on wsgi either. But its a big change. At the moment our priority is breaking up all those long js & py files in the controllers into more functional modules.

There are great suggestions in the Issues list and we its a matter of picking whats important first... or if we are able to get more developers in the project or we are able get enough revenues to employ more developers... I guess its a long process.




On Monday, October 21, 2013 10:10:34 PM UTC+5:30, Holger Winkelmann wrote:
HI Rushabh,

On Monday, 21 October 2013 14:32:52 UTC+2, rushabh wrote:
Holger,

1. Calculations in Sales / Purchase transactions are done both on the front-end and back-end. In the front-end so that the user gets fast feedback and in the back-end it is recalculated as the transaction can also be pushed via an API without any calculations. The code is not fully refactored but you can see

Do you really think thats a good idea to do so? It smell a bit like code duplication here. If. i.e. the JS code somehow compiled from the server Docs and Modules I would agree to this approach.
I could suggest a different approach where the communication back and forward to the client could be done arround websockets which is fast enough and will leave the transactional code on the server.
I totally agree that client side code can exists for prevalidation of form fields, helper functions for selectors, rendering of the raw data in a local or intended format etc. basically all function which make the UI fast,
but no functional calculations.

We i.e. using angular.js combined with
angular.ui which is bootstrap based to encapsulate the UI functions and widgets and communicate via JSON over websocket to the server. 
  



2. Regarding creating new modules. You can create them from the front end and then only edit the controllers. To create a new table, create a new DocType. Set developer_mode = 1 so that the folders and controller stubs are automatically created.

DocTypes are automatically synced during deployment.
 
This sounds good. 

We are also pushing a new plugin architecture in our new release "wsgi" branch that will standardize how to manage plug-ins so that you do not have to touch the existing code base.

To create new desktop icons, use config.json.

Unfortunately there is not much documentation we have done recently. If you have specific questions, you can ask.

We will come back with questions,

many thanks so far.

best,
Rushabh




On Sunday, October 20, 2013 11:35:29 PM UTC+5:30, Holger Winkelmann wrote:
We are looking at WN and ERPnetx the last few days. I'm wondering how WN and ERPnext is developed? In the forums I read
from time to time that calculations are done in JS in the frontend as well. Is this true or is the server always in charge of calculation
values and make transactions?

Further we would like to know which steps are required to build a module. Is there Server (PY) and Frontend (JS) coding required
or ist the Frontend driven by the Meta Model of the server?

Many thanks for advise,

Holger



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.