DEV Community

Cover image for Low-code Framework Concept for Node.js πŸ₯‘
Can Mingir for Nucleoid

Posted on • Updated on

Low-code Framework Concept for Node.js πŸ₯‘

We've launched a project that it can automate data and logic in Node.js, so that it can organically reduce code lines.

Nucleoid Low-code Framework works with underlying declarative runtime environment that re-renders very same JavaScript codes makes a connections in the graph and eventually save the JavaScript state so that it doesn't require external database.

Hello World

app.post("/test", () => {
  var a =  1
  var b = a + 2;
  var c = b + 3;
})

app.get("/test", () => {
    return b;
})
Enter fullscreen mode Exit fullscreen mode

This πŸ‘† will save and return variables without external database even if the program restarted.

The Nucleoid runtime environment tracks JavaScript state like variables, object, class, etc. that it can control all technical codes like pooling, connections, in meanwhile, developers can focus to build up business logic with vanilla JavaScript.

Example with actual objects:

class User {
  constructor(name) {
    this.name = name;
  }
}

app.post("/users", () => new User("Daphne"));

app.get("/users", () => {
  return User.filter((user) => user.name === "Daphne")
});
Enter fullscreen mode Exit fullscreen mode

Theory

Applying declarative programming at the runtime gives us ability to include data management in the same process.

In different words, the main objective of the project is to manage both of data and logic under the same runtime, at the same time, we can also stream/export data to external database like NoSQL.

How it works

nucleoid.run(() => {
  var a = 1;
  var b = a + 2;
  var c = b + 3;
});
Enter fullscreen mode Exit fullscreen mode

Once a variable is defined like var a = 1, the runtime does 3 major things. First, it places the var a in the graph and makes the connection between dependent variables.

Variable Graph

Second, updates state with new values in order get affect

State
var a 1
var b 3
var c 6

However, actual execution is different since variables are tracked in the graph.

state.a = 1;
state.b = state.a + 2;
state.c = state.b + 3;
Enter fullscreen mode Exit fullscreen mode

and finally stores statements in the runtime-managed fs.

IDE (OpenAPI Editor)

The framework works with Express.js, we also made small UI that builds up the very same codes with OpenAPI, package and run on CodeSandbox.

Go to Nucleoid IDE

Screenshot


This paradigm is still a part of the declarative programming, but applied at the runtime unlike Prolog or Haskell. As we are still discovering what we can do with this powerful programming model, please join us with any types of contribution!

Learn more at https://github.com/NucleoidJS/Nucleoid

Nucleoid Logo

Top comments (3)

Collapse
 
gulshanaggarwal profile image
Gulshan Aggarwal

Nice Can, looking to contribute very soon!

Collapse
 
joestomopolous profile image
joestomopolous • Edited

Good Job

Collapse
 
redcometvictory profile image
Jor-EL Sanchez

lookin like a cool project!