Coder Social home page Coder Social logo

simplecqrs's Introduction

Simple CQRS(Mimic)

However, command and query services are coupled, only read and write queries are decoupled on the same service. Postgresql and Elasticsearch are being synced via Logstash.

Usage

docker-compose up

Migrate database(https://github.com/golang-migrate/migrate you will need to install this to be able to run migrate)

export PGURL="postgres://product:secret@localhost:5432/product?sslmode=disable"
migrate -database $PGURL -path business/data/migrations/ up

Insert a product

curl --location --request POST 'http://localhost:8000/v1/products' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Alarm paketi",
    "price": 5000000
}'

Delete a product(don't forget to change id)

curl --location --request DELETE 'http://localhost:8000/v1/products/37198ff6-bde2-47a7-8f8f-8c16a5cd0c11'

Search products

curl --location --request GET 'http://localhost:8000/v1/products?name=alarm'

Jaeger http://localhost:16686/search

simplecqrs's People

Contributors

halilylm avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.