Urgent.News

What's breaking now, across thousands of outlets.

Tech

Stop Writing Boilerplate: Building a Metadata-Driven Node.js Framework from Scratch ๐Ÿš€

Letโ€™s be honest: setting up a new backend from scratch is tedious. Even with the rise of AI coding assistants, we often find ourselves generating the same repetitive boilerplate: Models, Controllers, Routes, and Database Migrations for every single entity in our application. As the project scales, this heavily AI-generated code can easily turn into an unmaintainable "spaghetti" mess. I wanted aโ€ฆ

Writing boilerplate code for backend projects is time-consuming and often repetitive. As applications grow, the AI-generated code can become hard to maintain. To address this, I created DD Framework, an open-source metadata-driven framework. Instead of manually writing code for each entity, developers can define the data structure in a simple JSON file.

The framework then automatically generates the necessary code. DD Framework uses Node.js, Fastify, PostgreSQL, and Knex.js as its core technologies. It revolves around the concept of Entities, where each entity is defined in a JSON file containing details like the table name, primary key type, and fields. For example, to create a Customer module, you would create a Customer.json file specifying the table name, primary key, and field details.

This approach streamlines the development process, making applications more predictable and maintainable.

Written by urgent.news from Dev.to's reporting โ€” not their text. Machine-written โ€” may contain errors; check the original before relying on it.

Read the original at dev.to โ†’

More in Tech

When an agent canโ€™t give the answer, what should it do next?

When someone asks an agent to make a consequential personal decision, a refusal can be correct and still leave them stranded. While designing an evaluation for a client, I worked through that tension.

  • When an agent can't answer a consequential decision, it must decide next steps.
  • Respecting user's limit, agent can't decide for them, leaving user with no options.
  • Useful response involves offering a feasible next step, allowing user to decide.

More from Tuesday 29 September โ†’