Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
But you can implement the same idea without the (base) source of truth being a TS interface. You could write or generate a schema in a format that can be used by both frontend and backend, and derive as much as you can (including the TS interface) from that. Heck if the input for a Mongoose schema is as basic as it looks in your example, you might even be able to use that (it looks like Mongoose might have TS inference for schemas soon).
Wow, after researching this for an hour, it looks like it's actually possible! Check this out.