npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@uprtcl/cortex

v0.1.3

Published

A new way to build web-applications, by recognizing the patterns that generic objects implement

Downloads

59

Readme

@uprtcl/cortex

The Cortex framework: a new way to build web-applications.

At its core, Cortex does what brains do: recognize patterns. Its main building block is a pattern: a kind of object that implements certain behaviour.

Consider this example in a project management app:

  • Events have their specific information and a date.
  • Tasks have their own specific information and also a date.

Both types of entity implement a date pattern.

This makes it possible to render both types of objects in a calendar element. Or maybe a Kanban board, in which some entities implement a status pattern. Or maybe they can be transformed to similar objects in different apps.

This is all possible provided that we can recognize which patterns each object implements, in its own way.

That's what Cortex does, in a generic, modular and pluggable way.

Cortex enables:

  • Connections from the front-end to different backends, and interoperability between them
  • Pattern recognition: fetch generic JSON objects and add specific behaviour to them
  • Interoperability of data between applications
  • Reinterpretation and transformation of applications data

Cortex is specially tuned for:

  • Applications that use content-addressable objects in its data storage layer
  • Web3 and decentralized applications
  • Microservice architecture in centralized servers

Vision

In its infancy, the web had the HTML document as its basic unit of storing information, it was designed as a documentation archive. It used links to navigate between those documents. Links address documents by location, and gives all the power of changing them to the external server owner, which stores private data from all its users.

Nowadays, the web follows a very different pattern. The basic unit of information are rows of object information stored in databases. HTML documents are just a way of displaying mostly dynamic information.

If we can build a way to develop generic applications that only assume relationships between content addressable content, lots of very different modules can be composed to form complex relationships of information and then...

...we can envision a world in which the users choose which micro modules to install in their own personalized applications to interpret and store their own data.

These are the transitions that Cortex wants to support in the web:

  • "Location addressing" to "content addressing"
  • "Computer files" to "generic JSON objects"
  • "The server controls the data" to "data can be transformed and stored in any platform you choose"
  • "Every application has to reimplement the wheel" to "building applications by reusing frontend+backend modules already implemented"

Documentation

Visit our documentation site.

Install

npm install @uprtcl/cortex

Usage

Load CortexModule

CortexModule is a MicroModule that registers the PatternRecognizer and sets the application up to be able to register Patterns and Behaviours.

import { MicroOrchestrator } from '@uprtcl/micro-orchestrator';
import { ApolloClientModule } from '@uprtcl/graphql';
import { CortexModule } from '@uprtcl/cortex';

const orchestrator = new MicroOrchestrator();

await orchestrator.loadModules([new ApolloClientModule(), new CortexModule()]);

Learn more about MicroModules here.

Register Patterns with PatternsModule

To register new Patterns and bind Behaviours to them, instantiate and load the PatternsModule:

import { PatternsModule } from '@uprtcl/cortex';
import { TextPattern, TextActions, TextContent } from './text-pattern';

const patternsModule = new PatternsModule([new TextPattern([TextActions, TextContent])]);

await orchestrator.loadModule(patternsModule);

Learn more about how to develop Patterns here.