Somebody just asked me now at Quora.com why we’re using frameworks as we create software. My answer of course was that frameworks solves recurring problems, making it faster to create our end product.
Validation of data is one of those recurring problems, and in fact if you think about it, 98% of all validators ever written, can easily be componentized into generic solutions, allowing us to reuse the same validator objects, over and over again.
My reasons for writing this article, is because I have just now added validators to Magic, which of course allows us to validate data on the server side, inside of our Web APIs, resulting in better data quality in our database. This validation logic of course is happening on the server side’s backend, and as such makes it simpler to create a frontend for your API.
In the video below I am demonstrating this by creating a JWT authentication and authorisation server, that will reject new users unless their usernames is an email address.