Giter Site home page Giter Site logo

Work in progress...

radarsu logo
Simplicity is the ultimate sophistication.

Node.js server-side TypeScript framework with one thing in mind - removing code is easier than writing it.
Auto-generated Swagger docs, REST, GraphQL, WebSockets and others - have it all, delete what you don't need.

Inspired by: sails.js, feathers.

npm license stars social twitter

Description

When you choose your perfect stack quite often you realize that setting things up, well-configured and working takes a lot of time. Everything is far from perfect and you need to write tons of code to make all the awesome features work your way according to your needs.

Maybe you have tried meteor, loopback, sails.js and nothing suits your needs. Lack of WebSocket integration? No auto-generated swagger docs, CRUD, issues with GraphQL subscriptions? Overcomplicated structure with many concepts you do not really want to implement? Simple solution comes here.

Built on top of nestjs, flexible, ready-to-go.

Installation

npm i radarsu

Features

  • Integrated REST, GraphQL and WebSocket API.
  • Automatic validation of incoming requests.
  • Pretty logging to console and files with a well-configured Winston.

radarsu logo

  • Auto-generated swagger docs and GraphQL panel.
  • Auto-generated CRUD client for all the models powered by Angular and Primeng.
  • CLI for generating various components based on templates that you can easiely modify.
  • RadarsuSocket Client and Server library allowing easy WebSocket communication between Client and Server:
// client side
const result = await ws.emit({
	action: `user/login`,
	args: [{
		login: `test`,
		password: `test`,
	}],
});
console.log(result); // 'NOT YET IMPLEMENTED';
// requests goes to the server through validation and other middleware
interface ILoginRequest {
	login: string;
	password: string;
}

@RadarsuController
@RadarsuMiddleware(exampleMiddleware, exampleGuard)
export class UserController {

	// body parameters are automatically validated based on ILoginRequest interface
    public login(@Body() body: ILoginRequest, rs: RadarsuSocket) {
	    return 'NOT YET IMPLEMENTED';
    }
}
  • Simple approach leaves everything as simple as possible, no coding redundancy, simple file structure:
  • src
    • 1-helpers - utility functions you like, your own little libraries.
    • 2-interfaces - types and interfaces.
    • 3-config - configuration of application and various libraries.
    • 4-entities - database models powered by sequelize-typescript.
    • 5-services - additional logics and storing data in server memory.
    • 6-middleware - filters, guards, interceptors, whatever you like as a middleware.
    • 7-controllers - routing and application entry point for all the REST, GraphQL and WebSocket Requests.
    • import - barrel import of every library and object you may need.
    • index.ts - application entry point (bootstrap).
  • data - place for logs and some server assets (like a favicon).
  • templates - place for templates that you can modify accodring to your needs, used to auto-generate components. Powered by ejs.

Drawbacks

In order to provide you with a well-configured setup of various libraries perfectly working together radarsu framework does not yet have adapters for other popular libraries. If you wish to switch from Winston to Bunyan or from Sequelize to other database, you need to rewrite initLogger, initDb, (...), methods.

import {
    Radarsu, config, radarsuLogger,
} from './import';

const log = radarsuLogger(__filename);

(async () => {
    config.app = new Radarsu();
    config.app.initLogger((options) => {
        // you are on your own here to return other logger you like
        return {};
    });
    await config.app.launch(config);
})();

Artur Kurowski's Projects

countries-by-iso2 icon countries-by-iso2

Map of countries by iso2 codes. Includes native translation, time zones, phone codes, states and currency.

demand icon demand

Lighweight and blazingly fast framework that uses latest browser features with an aproach "use the platform" to provide you the greatest setup. No magic included.

kill-process-on-port icon kill-process-on-port

Not responding process killer. Kill process on port you wanna use (if you accept terminal inquirer question) ๐Ÿ™ˆ๐Ÿ™‰๐Ÿ™Š

me icon me

Highly personal and opinionated AWESOME stuff for Typescript, JavaScript and Node.js full-stack developers along with my own best practices and setups ๐Ÿ™ˆ๐Ÿ™‰๐Ÿ™Š

options-defaults icon options-defaults

TypeScript Options / Defaults / Overrides Pattern implementation better than Object.assign, destructing or lodash _.merge.

polish-word-variations icon polish-word-variations

Utility library to define and obtain word variations for polish words - singular and plural forms (dependant on count) for various polish cases.

prisma-nestjs-graphql icon prisma-nestjs-graphql

Generate object types, inputs, args, etc. from prisma schema file for usage with @nestjs/graphql module

prosty-system-rpg icon prosty-system-rpg

Prosty system RPG, stanowiฤ…cy prostฤ… alternatywฤ™ dla systemu DnD 5e.

r0ten-circular-json icon r0ten-circular-json

Improved version of https://github.com/WebReflection/circular-json, 3x better performance, typescript and additional options.

radarsu icon radarsu

Node.js server-side TypeScript framework with one thing in mind - removing code is easier than writing it. Auto-generated Swagger docs, REST, GraphQL, WebSockets and others - have it all, delete what you don't need ๐Ÿ™ˆ๐Ÿ™‰๐Ÿ™Š

rpc-websocket-client icon rpc-websocket-client

Fast and simple JSON-RPC 2.0 WebSocket Client implementation in TypeScript. Allows bi-directional communication with async await Promises ๐Ÿผ

ts-import icon ts-import

Importing TypeScript files dynamically into JavaScript requires additional compilation step, which is troublesome to write for many. Popular typescript-require package seems to be obsolete and doesn't allow much customization.

types-package-json icon types-package-json

A handful set of package.json types and interfaces to improve working with dynamically imported package.json files.

validate-polish icon validate-polish

Utility library for validation of PESEL, NIP, REGON, identity card etc. Aimed mostly at Polish enviroment. [Polish] Walidacja numerรณw pesel, nip, regon, dowodu osobistego.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.