Giter Site home page Giter Site logo

reimagined / resolve Goto Github PK

View Code? Open in Web Editor NEW
769.0 769.0 89.0 39.16 MB

Full stack CQRS, DDD, Event Sourcing framework for Node.js

Home Page: https://reimagined.github.io/resolve/

License: MIT License

JavaScript 25.81% CSS 0.40% TypeScript 73.69% Vue 0.10%
cqrs ddd es6 event-sourcing nodejs react reactive redux

resolve's People

Contributors

adebisi-fa avatar alexandermoiseev avatar alexey-semikozov avatar artemjackson avatar const314 avatar devmanny avatar dmitrybogomolov avatar eugeniyburmistrov avatar freeslave avatar gustavopch avatar himura2la avatar ihostvlad avatar kilimondjaro avatar krutilin avatar lykoi18 avatar max-vasin avatar moshfeu avatar mrcheater avatar nuarat avatar pglushenkov avatar ralkov avatar resolve-bot avatar skudnoff avatar sokolov11 avatar superroma avatar tatyanaryzh avatar timbset avatar tspmpix avatar vadimkhoroshiltsev avatar xv2 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

resolve's Issues

Replace abstract SecurityContext to JWT

Now SecurityContext for command handler and query resolvers is implemented as custom free-form object provider, which should be filled and verified manually by end programmer.
It should be replaced by JWT, including verify tokens on server side out-of-the-box.

Memory driver throws exception if it is used in reSolve server config

The 'storage' field has to params - 'driver' and 'params'. All storage drivers has input as object of options excluding memory driver. It has events array. So if you pass object as params, they are interpriated as array of events and then tried to be used as array by the 'filter' function call. It leads to the error.

[resolve-scripts] Implement default values for `rootComponent` and `createReducer`

Now configuration fields rootComponent and createReducer should be manually specified in resolve.client.config.js and resolve.server.config.js, which caused by necessity of implementation custom routing and data loading flows on client and server side renderings.
It's useful in general case, but we should provide ability for default behaviour, in which rootComponent and createReducer will just be taken from pre-determinated files in appropriate folder, to provide ability for fast start for very simple application.

It is impossible to handle error if it is thrown in aggregate event handler

  1. Add aggregate command with event as result with type 'created'
  2. Add 'created' event handler to aggregate with error that is thrown inside
  3. Execute command with some aggregate id - handler is not executed because no one event is stored yet
  4. Execute it again with the same aggregate id - handler is executed once with stored event

Error throwed in handler is impossible to catch wrapping the 'executeCommand' function by try-catch construction

No necessary data in command if its execution is failed

I want to handle 3 steps of command execution in reducer. That's what I do:

export default (state = Immutable({}), action) => {
  switch (action.type) {
    case '@@resolve/SEND_COMMAND': {
      switch (action.command.type) {
        case 'createStory': {
          return action.status.error // or action.command.error
            ? // error handling
            : // command sending handling
        }
        default: {
          return state;
        }
      }
    }
  }
};

The first problem is that if error is thrown, action.command is excluded so I can't detect whether I handle the createStory command error or not.
The second problem is that if there is not error, action.status is not included to the action. So I need to have to checks - action.status and then action.status.error to put error.

Here is solutions as I see them:

  1. Do not exclude command first 'cause it contains important information
  2. Use action.command to put error not to add new fields that leads to extra conditions.

[resolve-scripts] Add JSON.parse for gqlVariables

Error: Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.
    at invariant (/home/mrcheater/hacker-news-demo/node_modules/graphql/jsutils/invariant.js:19:11)
    at assertValidExecutionArguments (/home/mrcheater/hacker-news-demo/node_modules/graphql/execution/execute.js:173:153)
    at executeImpl (/home/mrcheater/hacker-news-demo/node_modules/graphql/execution/execute.js:118:3)
    at execute (/home/mrcheater/hacker-news-demo/node_modules/graphql/execution/execute.js:113:150)
    at _callee3$ (/home/mrcheater/hacker-news-demo/node_modules/resolve-query/dist/index.js:188:57)
    at tryCatch (/home/mrcheater/hacker-news-demo/node_modules/regenerator-runtime/runtime.js:65:40)
    at Generator.invoke [as _invoke] (/home/mrcheater/hacker-news-demo/node_modules/regenerator-runtime/runtime.js:303:22)
    at Generator.prototype.(anonymous function) [as next] (/home/mrcheater/hacker-news-demo/node_modules/regenerator-runtime/runtime.js:117:21)
    at step (/home/mrcheater/hacker-news-demo/node_modules/resolve-query/dist/index.js:15:191)
    at /home/mrcheater/hacker-news-demo/node_modules/resolve-query/dist/index.js:15:361

[resolve-scripts] Add support for subdirectory

I need support for subdirectories for deploying multiple applications on a single domain


/static/ -> /${subdirectory}/static
/api/commands/ -> /${subdirectory}/api/commands
/api/:queryName/ -> /${subdirectory}/api/:queryName
ws:/// -> ws://${subdirectory}/
html-markup-template <script src="/bundle.js"> -> <script src="/${subdirectory}/bundle.js">

resolve.config.js

module.exports = {
   //...
   subdirectory: "some-app-name"
}

Cross read-model GraphQl queries

Now every GraphQL schema and appropriate resolvers are bound to each read-model separately, so, even custom resolver can't reach access to current state of another read-model.
Such behaviour should be refactored - graphql schema and resolvers should work around all read-models in current resolve-query instance.
After refactoring behaviour of on-demand read-models should stay.

Ability for configure output config

Now configuration in output-stats-config.js prevents all output from webpack.
In case of error in application's source code, there no ability to find error.
MUST be configured by environment variable or command line flag

Resolve-storage is redundant

It's possible to pass storage driver to event store without creation resolve-storage. At fact, resolve storage is the same as his drivers only with additional function onEventSaved that used only in tests.
Also, need to think about removing resolve-bus for consistency. In this case, resolve-es will accept only bus and storage drivers.

Lerna & socket.io issue

  1. Lerna does not perform correct bootstrapping for dependent modules, so when launching examples from it's appropriate directories, node_modules will not installed, so webpack/babel plugins can't be found
  2. Socket.io server part library perform including dependent library in run-time, which is incompatible with bundling mechanism. Should be researched, how to fix it in general case, and socket.io, in particular.

Impossible to handle response that does not trigger event

In sendCommandMiddleware from resolve-redux there is an error handing. This error is thrown if there is no connection. Other case is when server response with error. The fetch interpriates this as success and put all info to the response. So command execution is failed but request is executed successfully. In this case I can't handle error (e.g. sending info from form being unauthorized).

Investigate server bundling

Now create-resolve-app perform bundling for server and client code by isomorphic webpack configs.
Such schema allows easily attach React plugins, like CSS stylizers, both for client and server-side rendering. If server side will not be bundled by webpack, it will cause some issues, including absence for some CSS plugins for Babel, and thus impossibility of server-side rendering.
But bundling server-side code also affects other issues, like problems with npm-packages, which perform loading code in runtime, for example, socket.io. In case of socket.io there is known solution (https://stackoverflow.com/questions/46098113/socket-io-and-server-side-webpack-bundling#comment79160961_46098113 ), but issue with server-side bundling should be investigate for common case.

Implement raw event saver

Implement raw event saver in event store to provide ability for saving event with custom timestamp. It's necessary when using import scripts.

Investigate "Socket connected"

Now resolve-script has debug output with information about connecting new sockets.io clients, i.e. new browser session. But this message appears also when one non-closing tab in browser existed, so maybe performed reconnection are caused some bugs in code.
More than, after investigation debug output should be removed

Docs improvements

  • Prepare image that shows how packages interact each with other and describes CQRS in our definitions. For example:
    Example
  • Describe each package in more details (for example params for resolve-bus-rabbitmq, resolve-bus-zmq drivers)
  • Change setTrigger name to subscribe

Adding custom css looks weird

const bundleCssSource =
    process.env.NODE_ENV === 'production'
        ? `${BASEDIR}/static/bundle.css`
        : 'http://localhost:3001/bundle.css';


<div className="app">
    <Helmet>
        <link rel="stylesheet" type="text/css" href={bundleCssSource} />
    </Helmet>

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.