Giter Site home page Giter Site logo

danielherrerohernando / event-sourcing-poc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from feliun/event-sourcing-poc

0.0 1.0 0.0 254 KB

An event sourcing/CQRS POC for microservices using systemic

Dockerfile 1.16% JavaScript 97.41% Shell 1.43%

event-sourcing-poc's Introduction

event-sourcing-poc

An event sourcing/CQRS POC using systemic

Architecture diagram

alt text

Usage

Start the service by doing

npm install
npm run docker
npm run start

You will need Docker running in your machine.

If you then go to http://localhost:4000/api-docs you should see a swagger UI showing the available endpoints.

Tests

You can test the two available APIs with the following HTTP requests:

Book API

Create a book

curl -X POST -H "Content-Type: application/json" -d '{"title":"Event sourcing & CQRS", "author": { "id": "1", "name": "Felipe Polo" }, "id": "1"}' http://localhost:4000/api/v1/books

Update a book multiple times

curl -X PUT -H "Content-Type: application/json" -d '{"title":"Event sourcing & CQRS", "author": { "id": "1", "name": "Felipe Polo" }, "id": "1"}' http://localhost:4000/api/v1/books/1

curl -X PUT -H "Content-Type: application/json" -d '{"title":"Event sourcing & CQRS", "author": { "id": "1", "name": "Felipe Polo" }, "location": "Madrid", "id": "1"}' http://localhost:4000/api/v1/books/1

curl -X PUT -H "Content-Type: application/json" -d '{"title":"Event sourcing & CQRS", "author": { "id": "1", "name": "Felipe Polo" }, "location": "Caceres", "id": "1"}' http://localhost:4000/api/v1/books/1

Reindex all book commands

curl -X POST http://localhost:4000/api/v1/books/reindex

Get a book

curl -X GET http://localhost:4000/api/v1/books/1

Paragraph API

Create a paragraph on a book

curl -X POST -H "Content-Type: application/json" -d '{"title":"My paragraph", "text": "bla bla bla"}' http://localhost:4000/api/v1/books/1/paragraphs

Author API

Get an author

curl -X GET http://localhost:4000/api/v1/authors/1

event-sourcing-poc's People

Contributors

feliun avatar danielherrerohernando avatar mattiasmak avatar

Watchers

James Cloos avatar

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.