Giter Club home page Giter Club logo

event-store-http-api's People

Contributors

basz avatar codeliner avatar prolic avatar

Stargazers

 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

event-store-http-api's Issues

Handle wrong usage of `head` as start

Actually, when using head as start value for a stream you get a Fatal error:

Request: http://localhost:8080/streams/Prooph%5CModel%5CUser/head

Fatal:

TypeError: Argument 2 passed to Prooph\EventStore\Adapter\PDO\PDOStreamIterator::buildStatement() must be of the type integer, float given, called in /var/www/vendor/prooph/event-store-pdo-adapter/src/PDOStreamIterator.php on line 142 and defined in /var/www/vendor/prooph/event-store-pdo-adapter/src/PDOStreamIterator.php:196

head only works together with direction backward
Request: http://localhost:8080/streams/Prooph%5CModel%5CUser/head/backward

So the service should return a 400 bad request with an appropriate message

RFC event source JavaScript API

Bas Kamer @basz Jan 19 23:36
Anyone worked with the event source JavaScript API Sounds like a really simple alternative to webstomp

Alexander Miertsch @codeliner Jan 20 11:07
@basz indeed! But I've only planed to use it. You need a backend that manages the event source clients. So far rabbit + webstomp was easier, but there is a SSE server available built on top of reactPHP. This combined with a projection would be a nice alternative compared to rabbit + webstomp

Bas Kamer @bweston92 z Jan 20 15:57
I would say its more efficiënt compared to our https://github.com/prooph/event-store-http-api package. But yes you would need something that makes sure a client only gets relevant events. Then you would be able to reconsitute the Same AR on the client. Http://bla.com/stream-of-AR-events/uuid ?
This works with a ‘php -S 0.0.0.0:8080’ https://github.com/html5rocks/www.html5rocks.com/tree/master/content/tutorials/eventsource/basics/static/demo
I like it

Bas Kamer @basz Jan 20 16:02
No extra Apache mods, didnt test with nigx but i think it should work. All browsers (edge with a polyfill)

You need a backend that manages the event source clients.

I'm interested to hear what would be needed to manage event sourced clients. http://bla.com/stream-of-AR-events/uuid would work if the client already knows the uuid of the aggregate. Also I'm wondering if this repo would be the place to add such a feature...

[RFC] Split into PSR-15 middleware and stand-alone app

I'd like to split the package. The API middlewares should be moved to a library package so that you can composer install them in your own PSR-7/PSR-15 driven application and mix them with auth middleware and so on.

This package can be turned into a skeleton that uses the lib and provides a ready-to-use expressive app as it is now.

The lib can be called event-store-http-middleware or we integrate it in the http-middleware package.

Thoughts @prolic @sandrokeil @oqq @basz

Use zend strategility + FastRoute only

We're working on new PHP based microservices in our current project and it points out that zend-strategility is enough for API-only microservices. zend-expressive is small, but already adds boilerplate that you don't need if you don't want to change the router implementation every 3 month or have to orchestrate a lot of middleware (which would result in the next monolith).

Here is an example of what we're doing: https://gist.github.com/codeliner/42b92174652af6c984170a8a1f9adb14

Only the public/index.php and config/router.php are different than prooph-do. config/autoload + zend-servicemanager set up are the same and also the Http-Action-Middlewares, except that they don't have the third parameter $next in the signature because they are responsible for handling the http requests.

Thoughts?

Allow filtering by metadata

How do we want to design the filter capabilities?

We can load and loadReverse with an optional MetadataMatcher but how do we expose those filters in the http-api?

Two options:

  1. Using query params in the format: ?meta_1_field=_aggregate_id&meta_1_operator=eq&meta_1_value=abcd-efgt-ijklmnop&meta_2_field=_aggregate_version&meta_2_operator=gte&meta_2_value=10

We could also shorten the params so that meta_1_field becomes m_1_f for examle
And meta_<no>_operator could be optional and default to eq
This would save a lot of characters because the length of an URI is somewhat limited.

  1. Use POST and send filters as JSON in the request body.

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.