Git Product home page Git Product logo

kotlin-event-sourcing-sample's Introduction

Event Sourcing with pure Kotlin example

The goal of this project is to show a sample of event sourcing implementation with pure Kotlin, with the minimum of frameworks.

Tech stack

Running

In order to get the project running, you need to:

  • Provide the following environment vars:
SERVER_PORT     7000
MONGO_HOST      localhost 
MONGO_PORT      27017
MONGO_USER      mongo
MONGO_PASS      password
MONGO_DATABASE  admin
  • Provide a running MongoDB instance that correspond to the configured vars. You can use Docker, for example:
$ docker container run 
                        -e MONGO_INITDB_ROOT_USERNAME=mongo \
                        -e MONGO_INITDB_ROOT_PASSWORD=mongo \
                        -e MONGO_INITDB_DATABASE=credit_limit \ 
                        -p 127.0.0.1:27017:27017 \
                        --name credit_limit \
                        -d mongo
  • Execute the application
$ gradle run

About the project

Features

In order to test some flows of event sourcing implementation, some features were implemented:

  • Create a user: You can create a new user by giving its username:

[POST] /users

{
  "username": "userNameTest"
}
  • Block a user: You can block and unblock a user by giving its block state:

[PATCH] /users

{
  "username": "userNameTest",
  "block": true
}

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.