Architecture question forms/wix-data

A couple of questions I hope somebody can answer:

  1. when you define some restrictions on an input field in a Wix form (like required, a regex, etc), the field border goes red when the check fails. How is this check performed: do you make a call per field to the backend to retrieve restrictions and test or is this check done entirely at the front end in html/javascript?
  2. when using wix-data (insert) in the backend to save a new row, wix-data is agnostic about any such front end restrictions, right? So, when you use wix-data to do so, you would have to write your own verification, at least at the backend, either before you .insert or on the .beforeInsert Hook. Is that right?
    Thanks for any insight you could provide.

Indeed, you can perform validation both on client and on server. You can read about it here: Velo: About Validating User Input with Code | Help Center |

A smart approach would be, as you wrote, not to rely solely on client validation but perform additional validations on the server side.

Hi Ohad, long time no see. Thanks for your answer. I am aware of that article. Maybe I did not make myself clear enough, so I will give some more info.
After a year of using Wix Code I tend to shy away more and more from using the wix-dataset. It´s powerful indeed, but it makes it too easy to write code on the front end side that should not be there at all when you want secure, bulletproof applications. So input validation, database actions (queries, inserts, updates) and sensitive logic (secret keys), I want to put more and more on the backend and let the front end just do interface related stuff only. But doing so is not as easy as working with datasets.
This means I am thinking of building an application framework/code generator based on my (long time) desire: a repository.
this repository would govern validation on both front- and backend, would create collections, nifty front and backend code, especialy for a handfull of problems that I ran into and solved, handle languages and currency and puts info in 1 single place. Also, a repository would allow a developer, if he, for example, wants to have a different regex for a certain field type (like email) to change this in the repository ONLY and ALL his apps, both frontend and backend, would automatically work with that new regex.
This would be ideal for those type of apps that are licensed: you would normally make a copy of the code to a new licensee, but if you make a change, you have to change n occurrences in m licenses, a tough job.

My former question was basically a question of how much I can reuse existing wix logic. I fear the answer is: nada, zip, rien du tout. I did not get a clear answer on the first part (all in html or calls), soI will just have to assume it´s all inside HTML and thus not reusable.

So here comes the next question (it has been asked before): if you want to something like I described, you would need to be able to create collection schema and generate accompanying wix pages containing all wix interface elements. Do you have any plans of ever giving us access to this (I put it in as a feature request long ago)? And how about creating apps based on Wix Code? This has also been asked before and I would desperately need it too (e.g. like building a Gallery-like function to upload a picture, instead of the standard file browser that now opens up when a user wants to upload a picture). I am referring to this question:

If we have these possibilities, you would open up a secondary market for all kinds of Wix Code apps and solutions you would never be able to come up with, let alone code them, all on your own.

Sorry for the long text, but I thought I needed to clarify my object.