TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Is schema-driven UI worth it?

2 pointsby percyalto9 months ago
Hi HN, I&#x27;m looking for resources and advice on building a schema-driven user-interface.<p>I&#x27;m building a CRUD project management web app for construction (yes, I&#x27;m sure there&#x27;s existing apps out there, but they&#x27;re paying me to build a custom one). Currently, I&#x27;m using Django with DRF, React with MUI, and generating frontend OpenAPI endpoints using drf-spectacular.<p>When building the frontend, I originally designed it to be generated from the backend database structure because:<p>1) The database might change<p>2) I don&#x27;t have to hard code the database structure on the frontend<p>For example, the `Employee` entity has properties like `email`, `first_name`, `last_name`, etc. The entity data and metadata (e.g., max character length of `email`) are sent to frontend components which then generates forms to create new employees and a data grid with employee information.<p>The alternative approach I can think of is to hard code each forms&#x27; fields and data grid columns on the frontend instead of receiving this information from the backend and then generating the forms and data grid.<p>I&#x27;m wondering if building an application with this schema-driven architecture is common? Will this solution be performant if I&#x27;m making requests to the backend for this information? I&#x27;m finding I&#x27;m spending a lot of time updating the metadata API endpoint and making the frontend components generalizable for edge cases.

1 comment

austin-cheney9 months ago
You are going about this all wrong.<p>The front end should know nothing about the back end and the back end should know nothing about the front end. They are separate systems running independently on separate computers.<p>What you are doing is called tight coupling. <a href="https:&#x2F;&#x2F;cleancommit.io&#x2F;blog&#x2F;whats-the-difference-between-tight-and-loose-coupling&#x2F;" rel="nofollow">https:&#x2F;&#x2F;cleancommit.io&#x2F;blog&#x2F;whats-the-difference-between-tig...</a><p>You want the flexibility to do anything you want with your data and simultaneously do anything you want with your front end. That means you can generate any queries you want against any shape of data you want without making any changes to the front end. Likewise, you want the ability to make any changes to the content that is displayed to the user and the ability for the user to interact with that content no matter what is happening with the data.<p>I was laid off from a project with tight coupling, exactly as you envision, last year and it was horrible. Clearly, that tightly coupled project was intentionally designed with tight coupling in mind because the people making those decisions were supremely insecure in their ability to write logic for the front end. They had no idea what they were doing, everything was scary, and just wished the front end logic auto-magically reflected the database world where they found comfort. If that is you then its rough times ahead.