Skip to content

NucleoidJS/Nucleoid

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
June 9, 2023 13:33
November 19, 2021 23:36
October 7, 2023 05:55
May 19, 2023 12:56
June 10, 2023 15:20
December 5, 2023 04:52
November 24, 2023 04:17

Nucleoid

License NPM Discord

Banner

AI-managed Low-code Framework for Node.js


Nucleoid uses symbolic (logic-based) AI in the runtime that tracks given statements in JavaScript and creates relationships between variables, objects, and functions etc. in the graph. So, as writing just like any other codes in Node.js, the runtime translates your business logic to fully working application by managing the JS state as well as storing in the built-in data store, so that your application doesn't require external database or anything else.

Graph Animation

How it works

I. Write your business logic in JavaScript (TypeScript support coming soon)

II. Nucleoid runtime renders your codes

III. Creates APIs with the built-in datastore


Hello World ⚑

> npm i nucleoidjs

Once installed, you can simply run with Express.js

const nucleoid = require("nucleoidjs");
const app = nucleoid();

class Item {
  constructor(name, barcode) {
    this.name = name;
    this.barcode = barcode;
  }
}
nucleoid.register(Item);

// πŸ‘ Only needed a business logic and πŸ’–
// "Create an item with given name and barcode,
// but the barcode must be unique"
app.post("/items", (req) => {
  const name = req.body.name;
  const barcode = req.body.barcode;

  const check = Item.find((i) => i.barcode === barcode);

  if (check) {
    throw "DUPLICATE_BARCODE";
  }

  return new Item(name, barcode);
});

app.listen(3000);

πŸ’‘ This is pretty much it, thanks to Nucleoid runtime, only with this πŸ‘†, you run your business logic and successfully persisted your object without external database.

Learn more at nucleoid.com/docs/get-started


Under the hood: Declarative Runtime Environment

Nucleoid is an implementation of symbolic AI for declarative (logic) programming at the runtime. As mentioned, the declarative runtime environment manages JavaScript state and stores each transaction in the built-in data store by declaratively rerendering JavaScript statements and building the knowledge graph (base) as well as an execution plan.

Nucleoid's Taxonomy

The declarative runtime isolates a behavior definition of a program from its technical instructions and executes declarative statements, which represent logical intention without carrying any technical detail. In this paradigm, there is no segregation regarding what data is or not, instead approaches how data (declarative statement) is related with others so that any type of data including business rules can be added without requiring any additional actions such as compiling, configuring, restarting as a result of plasticity. This approach also opens possibilities of storing data in the same box with the programming runtime.

Logical Diagram 1 Logical Diagram 2

In short, the main objective of the project is to manage both of data and logic under the same runtime. The declarative programming paradigm used by Nucleoid allows developers to focus on the business logic of the application, while the runtime manages the technical details.This allows for faster development and reduces the amount of code that needs to be written. Additionally, the sharding feature can help to distribute the load across multiple instances, which can further improve the performance of the system.


OpenAPI Integration with Nucleoid IDE

Nucleoid IDE is a web interface that helps to run very same npm package with OpenAPI.

Go to Nucleoid IDE

Nucleoid IDE Screenshot 1 Nucleoid IDE Screenshot 2


Benchmark

This is the comparation our sample order app in Nucleoid IDE against MySQL and Postgres with using Express.js and Sequelize libraries.

https://nucleoid.com/ide/sample

Benchmark

Performance benchmark happened in t2.micro of AWS EC2 instance and both databases had dedicated servers with no indexes and default configurations.

https://github.com/NucleoidJS/benchmark

This does not necessary mean Nucleoid runtime is faster than MySQL or Postgres, instead databases require constant maintenance by DBA teams with indexing, caching, purging etc. however, Nucleoid tries to solve this problem with managing logic and data internally. As seen in the chart, for applications with average complexity, Nucleoid's performance is close to linear because of on-chain data store, in-memory computing model as well as limiting the IO process.


Project Status πŸ₯‘

Track at Trello

  • Beta is out
  • ES6 support
  • ES2018 support
  • ES2020 support
  • TypeScript
  • IDE (WiP)
  • Production-ready

Please report an issue or ask a question at Discussions

Learn more at nucleoid.com



⭐️ Star us on GitHub for the support

Thanks to declarative programming, we have a brand-new approach to data and logic. As we are still discovering what we can do with this powerful programming model, please join us with any types of contribution!

Nobel


Contributors

User NucBot
NucBot
User canmingir
canmingir
User 322332
322332
User dependabot[bot]
dependabot[bot]
User francisco-giancarelli-crombie
francisco-giancarelli-crombie
User Gulshanaggarwal
Gulshanaggarwal
User CanPacis
CanPacis
User durulkoca
durulkoca
User halilcengel
halilcengel
User EnesKeremAYDIN
EnesKeremAYDIN
User russle-smith
russle-smith
User russellgray
russellgray

Generated by NucBot