Skip to content

thanhfphan/eventstore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'