quickflows-io / eventstore

Event Store on PostgreSQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Event Store on PostgreSQL

The implementation of event sourced system that uses PostgreSQL as an event store. This repository should use as a template.

How to start

Start infras

./scripts/dev.sh up

Run migration(need to manual create database first)

./scripts/dev.sh migrate

Start service

./scripts/dev.sh start

Other commands

./scripts/dev.sh help

Testing

Place order

curl --location --request POST 'http://localhost:4012/order/place' \
--header 'Content-Type: application/json' \
--data-raw '{
    "customer_id": 123123,
    "price": 10.2
}'

Cancel order

curl --location --request POST 'http://localhost:4012/order/cancel' \
--header 'Content-Type: application/json' \
--data '{
    "order_id": "fe55e443-2426-437a-9656-f2daf01fa2f1"
}'

Get order

curl --location --request GET 'http://localhost:4012/order/fe55e443-2426-437a-9656-f2daf01fa2f1' \
--header 'Content-Type: application/json'

About

Event Store on PostgreSQL

License:MIT License


Languages

Language:Go 92.6%Language:Shell 3.8%Language:PLpgSQL 3.1%Language:Makefile 0.5%