Giter Site home page Giter Site logo

puristajs / purista Goto Github PK

View Code? Open in Web Editor NEW
59.0 59.0 5.0 87.75 MB

A typescript framework for building backend services and api in modern, modular and scalable way with event-driven patterns

Home Page: https://purista.dev

License: Apache License 2.0

JavaScript 1.26% TypeScript 93.67% Shell 0.07% CSS 2.68% Handlebars 2.04% Vue 0.29%
backend backend-api backend-server backend-service cqrs cqrs-framework ddd-architecture event-driven event-driven-architecture event-sourcing eventbus eventsourcing framework javascript message-driven openapi rabbitmq swagger typescript typescript-library

purista's People

Contributors

github-actions[bot] avatar sebastianwessel avatar yslinear avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

purista's Issues

[BUG] Fix logger

The logger types and logger function input are not correct.
They should match Pino, Bunyan and so on

update to vuepress 2

As current stable vuepress version is based on vue 2 and the dep. packages are outdated with security warnings up to high risk:
Update vuepress version to next (vue 3) and within this update use some different theme with more options

[BUG] routing issues: wrong 404 handling

Currently the flow for handling handlers & middleware are logical invalid, when there is no matching route found.

At the moment, all onBefore and all onAfter handlers are executed - no matter if a route is found.
This results in most cases in 500 error response, instead of 404.

The expectation is, that if there is no matching route, only 404 handlers are executed.

feat: Allow multiple auth methods

In openApi documentation you can add multiple auth methods.
Provide a way to define which auth methods are the default ones and so on.

ex.

/public needs none

/assets -> needs API-Key

/authenticate -> needs API-Key and Basic Auth

/restricted -> needs API-Key and Bearer

[BUG] not working under windows os

The server is starting correctly but calling one of the endpoints is always returning 500 error.

console log:

2022-05-01 14:53:26.956  ERROR [httpServerService   HttpServerService.routerHandler] all handlers done, but no response send - now throwing to jump into error handlers
2022-05-01 14:53:26.957  ERROR [httpServerService   HttpServerService.routerHandler] route handler error
 Error  No response send to client
details:
{
  errorCode: 500,
  data: undefined
}
error stack:
• HttpServerService.impl.ts:221 routerHandler
    node_modules\@purista\core\src\http-server\HttpServerService.impl.ts:221:15

Looks like there is an issue with routing on windows environments and the 500 is related to issue #16
The service command function seems to not being called.
Maybe because on windows \ is used, but on linux/macOS / for path names.

Needs to be reproduced and fixed on windows environment.

[TASK] Add config getter for service

Describe the things which needs to be done

To be able to create automated deploy config, a getter for service definitions (functions & subscriptions) is needed

[FEATURE-REQUEST] Add hooks

Add hooks:

  • beforeInvokeRequest
  • beforeInvokeResponse
  • beforeInputValidation
  • afterInputValidation
  • beforeOutputValidation
  • afterOutputValidation

Reason:
to be able to transform payload before validation for example because of migrations or to be able to add a permission layer.

Also bug tracking, additional tracking etc will be possible here

[FEATURE-REQUEST] Subscriptions should be able to return values and emit events

As of now, subscriptions can listen for events/messages and do some computation.
Currently, they are not able to return results and emitting of custom events needs to be done programmatically.

But it might make sense to add the possibility, that subscriptions can return values.
If they return values, they should be able to automatically emit the output as custom event.

Here, subscriptions should have:

  • optional output validation and type
  • event name definition

[FEATURE-REQUEST] Add input transformer functions to subscriptions

Currently, command functions are able to have transform functions for in and output.
Subscriptions also consume the same input as command functions in many cases. Because of this, they also may need to transform the input before executing the actual subscription function

[TASK] allow custom event/message types

Currently only the required set of message types is implemented.
Something like CommandRequest or CommandResponse

To be able to support proper event souring it is necessary to add custom message types.

This means it must be possible to return the custom event type in command functions and subscriptions must be able to subscribe on custom events.

[TASK] make subscription id reproducible

Describe the things which needs to be done

Currently subscription id is a unique, random id but it should be some fixed reproducible id.

Otherwise multiple instance can't subscribe to same queue

[FEATURE-REQUEST] Timed out invoke should send a info message

Currently, timeouts are done in calling sender Service.
If a invocation timed out the invoke promise is rejected with UnhandledError Gateway Timeout.

This is fine for the service itself, but nobody outside this service get informed about it.
So it's not possible to track via observer-subscriptions.

There, a info-error message should be send

feat: AMQP bridge allow subscription on custom topics

Provide a option to register subscriptions as kind of an adapter for queues, other than the ones PURISTA is using, to provide the possibility to integrate it with other systems.
Also, a option to send messages which are not matching the PURISTA message schema are making sense here.

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.