tonyx / SharpinoCounter3

Sample of using a context and various aggregates (single counters)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sharpino Counter

Example of a Counter with Sharpino, with Kafka.

Table of Contents

Prerequisites: dbmate, postgres, Apache Kafka

Installation

clone project

Run project using memory as event-store

then run the commands:

dbmate up

and run the following command:

dotnet run

Run project using postgres as event-store

Create a file named .env with content like this (substituting the postgresusername/postgrespassword with your own):

DATABASE_URL="postgres://postgresusername:postgrespassword@127.0.0.1:5432/es_counter?sslmode=disable"

then uncomment the following line in the Tests.fs: // ((fun () -> SharpinoCounterApi (pgStorage, doNothingBroker, counterContextStorageStateViewer, counterAggregateStorageStateViewer)), pgStorage) and optionally comment out the following line in the Tests.fs: // ((fun () -> SharpinoCounterApi (memoryStorage, doNothingBroker, counterContextStorageStateViewer, counterAggregateStorageStateViewer)), memoryStorage)

then run the commands:

dbmate up

and run the following command:

dotnet run

A 6 min reading article about this example can be found here

About

Sample of using a context and various aggregates (single counters)


Languages

Language:F# 62.6%Language:PLpgSQL 37.4%