Skip to content
Plugdata.io core libraries
TypeScript JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
_docs
_scripts
core
data
web
.eslintrc.js
.gitignore
LICENSE
README.md
package.json

README.md

Pludata.io Framework

Plugdata.io

This repository contains all the main node modules used in Plugdata.io products and is aimed to be help anybody who wants to easily create robust and performant web applications.

Philosophy

  • Typescript: We like how Typescript has been evolving during the last years and it provide us with tools to create consistent and organized projects.

  • Low overhead: One of the few problems we see with the JS ecosystem is the high volume of libraries required even for the simplest things, so we try to minimize it by choosing libraries with the same philosophy and always trying to be as close to Node JS as possible

  • Consistent internal API: Another problem with nowadays projects is that every library usually has a different way of doing things: configuration, execution (callbacks, promises, etc) and not always has a good support for Typescript. We try our best to create a consistent API for all functionality, it being: logs, scheduled jobs, database, APIs, etc. This can be done thanks to our custom dependency injection (see more below), configuration interfaces and extensive usage of decorators.

  • Performance: This connects directly to our low overhead philosophy, in all our decisions we always take performance as a high priority point. We'll keep track of it by constantly updating and running benchmarks against other libraries and ourselves.

  • Versioning: As it is a common practice in npm packages we'll use a semantic versioning for all our packages, and all the packages will have the same version. This means if the current version is 2.0.1 and a new patch is released, then all the packages will upgrade to version 2.0.2. This also means that we'll have to coordinate all our projects when deciding to release a new minor o major version, so all of them take advantage of it.

  • Security: // TODO

Modules

Bellown is shown a list of all node modules with the real npm package, a little description and links to useful information.

@plugdata/core

Contains the main functionality that any Node JS might need, some of it would be:

  • Dependency injection: It's a custom implementation based on an decorator syntax, and it will be the cornerstone of all our modules and products. This section is related to our consistent API philosophy, since everything will be managed and configured by the container. It's influenced by typedi, but with extended functionality to meet our needs.

  • Configuration: There will be a main configuration file which will have everything needed for other packages configuration, custom implementations and future products. It's based on JSONs files, which will be able to reference environment variables and have different versions for different environments (productio, development, etc.).

  • Logs: For all our logging we'll use pino since it fits our philosophy and has a great connectivity with other products such as Elastic logs

  • Http/s Client: We have a lightweight http/s client that is a simple promisified wrapper of Nodejs Http/s client with easy methods to make REST JSON calls.

  • Events: It's an adaptation of EventEmitter3 to our dependency injection system. It has almost the same API than the Node JS events but with some additions like contexts, so it won't be necessary to call .bind(this), and some unnecessary methods removed for better performance.

  • Object validator: An integration with our dependency injection of AJV wich supports draft-07 of JSON Schema and is one of the fastest a better mantanind libraries for this porpuse

  • Utils: During our development of several projects we've been gathering some common usage utils, mostly for objects and promises manipulation, and other NodeJS wrappers for things like file system calls. We'll be updating these utils as development progresses.

  • Tests: It's a simple testing library that uses Node JS assert library for it's validation and is based on Typescript classes with an integration to our dependency injection system. It's not aimed to be a full featured testing library as the already existing ones, and we know it's a personal choice of every team, so we offer it just a possibility for simple tests, and we use it for all our internal testing, so it will also have integration with other packages such as data and web.

@plugdata/data

This package will contain all the functionality relative to data storage and query system. The amount of supported databases will increase depending on demand, but at the beginning it will cover the most used ones.

  • ORM: For our database manage we have a wrapper of TypeORM which is a fully featured ORM for the most used SQL databases and MongoDB, we plan to add further support as MongoDB transactions and new NoSQL databases. This is fully integrated with our configuration and dependency injection systems.

  • Impration/exportation: Uses TypeORMs utils to create JSONs for data import/export between different systems, being able to select which tables and with query support.

@plugdata/web

In this package we can find everything that is related to web connectivity

  • Web framework: For web servers management

  • OAS 3: We believe that a good documentation is needed for a good API, event if it's just for internal usage. This adds support for an easy creation of OAS 3 description files, being able to add little chunks of documentation for each operation created, so it's easily updated at the same time that the code changes, and being able to version it. We take care of the full document creation taking into account all the current configuration.

  • Login: Easy integration of basic login mechanisms like basic auth or JWT, but also easy to extend for custom login strategies, and new support will be added in the future.

You can’t perform that action at this time.