DEV Community

Mohamed Hamed
Mohamed Hamed

Posted on

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 better way. I wanted predictability over guesswork. That's why I built DD Framework.

💡 What is DD Framework?

DD Framework is an open-source, metadata-driven framework designed to help developers build robust applications through a low-code approach.

Instead of writing hundreds of lines of imperative code to define a Customer or an Invoice, you simply declare your data structure in a clean JSON file. The framework's core engine takes that JSON and automatically handles the rest.

🛠️ The Tech Stack

  • Backend Runtime: Node.js (ES Modules)
  • Server: Fastify (for blazing-fast routing)
  • Database: PostgreSQL
  • Query Builder: Knex.js
  • Frontend (In Progress): Vue.js + Vite

🪄 How It Works (The Magic)

In DD Framework, everything revolves around Entities. Let's say you want to create a Customer module. Instead of writing migration scripts and API controllers, you just create Customer.json:

{
  "name": "Customer",
  "tableName": "tabCustomer",
  "pk_type": "uuid",
  "fields": [
    {
      "fieldname": "full_name",
      "fieldtype": "Data",
      "reqd": 1,
      "unique": 1
    },
    {
      "fieldname": "email",
      "fieldtype": "Data",
      "reqd": 1
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

Once this file is saved, the DD Framework Engine instantly provides:

  • Schema Syncing: Hit a single endpoint (POST /api/meta/Customer/sync), and the framework dynamically generates the PostgreSQL table (tabCustomer) with the exact columns and constraints.
  • Instant REST APIs: You automatically get fully functional CRUD endpoints (POST /api/resource/Customer) without writing a single controller.
  • Built-in Validation: The engine automatically rejects bad payloads based on your JSON rules (e.g., missing required fields).

No boilerplate. No messy controllers. Just pure, predictable business logic.

🚀 Why This Matters

  • Zero Boilerplate: Focus entirely on your business requirements, not plumbing.
  • Standardization: Because the API and DB operations are handled by central "Engines", your entire application behaves consistently.
  • Future-Proof UI: The frontend (@client_ui, built with Vue.js) fetches this exact metadata to dynamically render forms and data tables on the fly.

🤝 Calling All Open-Source Contributors!

DD Framework is in its early, most exciting stages! The core backend engines (Database, Metadata caching, Schema syncing, and Document CRUD) are functional, but there is so much room to grow.

I am actively looking for developers of all skill levels to join me in building this. Whether you are passionate about Node.js architecture, PostgreSQL optimization, or Vue.js dynamic interfaces, there is a place for you here.

Here is what we are working on next:

  • 🏗️ Schema Engine Upgrades: Adding ALTER TABLE support for existing entities.
  • 🛡️ Advanced Validation: Type-checking and relational data links (Foreign Keys).
  • 🎨 Dynamic Vue.js UI: Building the auto-rendering form engines for the frontend.

Let's build something awesome together!

Check out the repository, drop a ⭐ if you like the concept, and let's start coding:

🔗 GitHub Repository: DD-Framework

Top comments (0)