0.7.0 • Published 7 months ago

@symbux/turbo v0.7.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
7 months ago

GitHub Workflow Status GitHub issues NPM npm (scoped) npm

The Turbo engine is a command-based framework for building API (and web) based applications using either built-in plugins or community/custom ones.

Package is in alpha, use at own risk.

We have created a boilerplate/starter project with a frontend and backend pre-configured and ready to use, including a docker-compose file for a single node clustered MongoDB instance for development, available here: https://github.com/Symbux/Turbo-Starter


Installation

With Yarn:

yarn add @symbux/turbo

With NPM:

npm install --save @symbux/turbo

Getting Started

You can find the documentation here.

import { Engine, HttpPlugin, WsPlugin } from '@symbux/turbo';

// Initialise engine instance.
const engine = new Engine({
	autowire: true,
});

// Use the http plugin.
engine.use(new HttpPlugin({
	port: 8080,
}));

engine.use(new WsPlugin());

// Start engine.
engine.start().catch((err) => {
	console.error(err);
});

Features & Plugins

Turbo comes with tons of great features and core plugins out of the box including Http and WebSocket plugins for running servers for both.

Features

A list of available features:

FeatureDescription
ControllersControllers are used to handle requests from a service, with the ability to use the same controller to serve many services.
MiddlewareMiddleware can be applied to controllers for authentication and authorization validation, like managing CORS, or IP blacklisting, alongside checking a token/login status for a user.
AutowireThe engine offers built-in autowiring for framework modules, like plugins, controllers, fibres, providers, tasks, and more.
PluginsPlugins are used to extend the engine with new functionality, like adding new services (i.e. Discord bots), or more generic functionality.
TasksTasks are used to run tasks based on a cron-style syntax, these can be used to run tasks on a schedule, or to run tasks as needed.
FibresFibres are classes, that proxy exposed methods into a thread, allowing them to run in parallel but also freeing up your main thread for running intensive operations.
AuthenticationBuilt in authentication decorators can be applied to a controller method to do checks against middleware set authentication data.
RegistryThe engine provides a registry for storing data, this can be used to store data in memory, alongside the registry stores all modules that have been loaded into the engine.
ORMWe have opted for using an existing ORM, specifically we have decided to use Prisma, which has extremely good TypeScript support, the Turbo engine will initialise any prisma schema available, see the Turbo Starter project for a handy getting started guide.
ServicesServices are classes that provide a service which can call controllers, and methods to run business logic, for example the HttpPlugin comes with a HttpService that sets up and manages an Express application, usually we suggest setting services up as plugins, see the source code src/plugin/http as an example.
Translations (i18n)This feature allows you to support the default Accept-Language header to support manual and auto-translation of your content.

Plugins

PluginDescriptionType
HTTP PluginThe built-in HTTP plugin is based off of Express.built-in
WS PluginThe built-in WS plugin is based off of Express-WS, will initialise an express server if the HttpPlugin is not initialised.built-in
Turbo DiscordA discord plugin, that offers SSO (single sign on) to discord with built-in bot support using the new slash commands functionality with various helpers and full controller structure support.external
Turbo ViteA vite plugin for Turbo that supports server-side rendering (SSR) and full support for the Vite dev server including HMR.external

Future Development

  • Turbo CLI - A command line interface for Turbo, to install plugins, boilerplate plugin projects and automate building and deploying Turbo applications.
  • UiPlugin - A pre-built Vue based SSR framework for writing user interfaces for the framework (allowing other plugins to extend it).
  • AuctionPlugin - A plugin to support auction systems, using commission, timed, and live bidding (Extends UI Plugin).
0.6.16

10 months ago

0.7.0

7 months ago

0.6.15

1 year ago

0.6.14

2 years ago

0.6.13

2 years ago

0.6.9

2 years ago

0.6.10

2 years ago

0.6.12

2 years ago

0.6.11

2 years ago

0.6.7

2 years ago

0.6.8

2 years ago

0.6.6

2 years ago

0.6.3

2 years ago

0.6.5

2 years ago

0.6.4

2 years ago

0.2.22

2 years ago

0.2.21

2 years ago

0.2.20

2 years ago

0.2.19

2 years ago

0.2.18

2 years ago

0.2.17

2 years ago

0.2.16

2 years ago

0.2.15

2 years ago

0.2.14

2 years ago

0.2.12

2 years ago

0.3.0

2 years ago

0.3.6

2 years ago

0.6.2

2 years ago

0.3.5

2 years ago

0.3.7

2 years ago

0.5.0

2 years ago

0.4.1

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.3.3

2 years ago

0.2.11

2 years ago

0.2.10

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago