Validation and Auth Examples using Server HTML + Ajax Forms, jQuery, TypeScript, Vuetify, Sharp Pages and Razor Pages.
This app showcases ServiceStack's API First Development model where its pure APIs are unopinionated as to which UI or client are consuming them yet is able to support multiple UI rendering strategies including server HTML Rendered and Ajax Client forms, multiple View Engines, multiple layouts - all utilizing the same Service and declarative Fluent Validation. With no additional effort the same APIs are automatically available to Mobile and Desktop Apps.
Contacts Service is demonstrative of a typical Auth-enabled App, with Login and Registration forms, protected pages and Services and Simple UI's for entering personal contacts for Authenticated users. All Source Code is available in the Validation GitHub project.
All Auth Configuration is encapsulated within a "no-touch" IConfigureAppHost plugin that's run once on Startup:
All Services and Validators used in this App. Extension methods are used to DRY reusable code and a Custom Auto Mapping handles conversion between the Contact Data Model and Contact DTO:
The dynamic App data used within ServiceStack Sharp Pages and Razor pages are maintained within Custom ContactScripts and RazorHelpers:
Typed Request/Response Service Contracts including Data and DTO models that utilizes Enum's: