{"id":13621519,"url":"https://github.com/ivanpaulovich/event-sourcing-jambo","last_synced_at":"2025-08-21T04:31:07.024Z","repository":{"id":79498827,"uuid":"72551597","full_name":"ivanpaulovich/event-sourcing-jambo","owner":"ivanpaulovich","description":"An Hexagonal Architecture with DDD + Aggregates + Event Sourcing using .NET Core, Kafka e MongoDB (Blog Engine)","archived":false,"fork":false,"pushed_at":"2018-03-23T22:10:46.000Z","size":80328,"stargazers_count":189,"open_issues_count":0,"forks_count":68,"subscribers_count":29,"default_branch":"master","last_synced_at":"2024-12-07T08:41:35.653Z","etag":null,"topics":["aggregate","bearer-authentication","cqrs","cqrs-es","ddd","ddd-architecture","domain-driven-design","dotnet-core","event-driven","event-sourcing","hexagonal-architecture","kafka","microservice","microservices","mongodb","optimistic-updates","service-bus","solid","solid-principles","webapi"],"latest_commit_sha":null,"homepage":"http://paulovich.net/jambo/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ivanpaulovich.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-11-01T15:51:47.000Z","updated_at":"2024-12-02T21:32:43.000Z","dependencies_parsed_at":"2023-04-07T04:33:46.184Z","dependency_job_id":null,"html_url":"https://github.com/ivanpaulovich/event-sourcing-jambo","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanpaulovich%2Fevent-sourcing-jambo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanpaulovich%2Fevent-sourcing-jambo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanpaulovich%2Fevent-sourcing-jambo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanpaulovich%2Fevent-sourcing-jambo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivanpaulovich","download_url":"https://codeload.github.com/ivanpaulovich/event-sourcing-jambo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230487844,"owners_count":18233865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aggregate","bearer-authentication","cqrs","cqrs-es","ddd","ddd-architecture","domain-driven-design","dotnet-core","event-driven","event-sourcing","hexagonal-architecture","kafka","microservice","microservices","mongodb","optimistic-updates","service-bus","solid","solid-principles","webapi"],"created_at":"2024-08-01T21:01:07.397Z","updated_at":"2024-12-19T19:08:57.912Z","avatar_url":"https://github.com/ivanpaulovich.png","language":"C#","funding_links":[],"categories":["C#","webapi"],"sub_categories":[],"readme":"A solution based on a Event-Driven architecture with DDD and CQRS. The solution contains the following applications.\n* A Producer Web API which receives Commands to produce Domain Events. This one also receives Queries and returns JSON. \n* A Consumer Console App that reads the Event Stream and do a projection to a MongoDB database.\n* A Web API for authentication and JWT generation.\n\n[Checkout the Source Code on GitHub](https://github.com/ivanpaulovich/jambo)\n\n#### Requirements\n* [Visual Studio 2017 + Update 3](https://www.visualstudio.com/en-us/news/releasenotes/vs2017-relnotes)\n* [.NET CORE SDK 2.0](https://www.microsoft.com/net/download/core)\n* [Docker](https://docs.docker.com/docker-for-windows/install/)\n\n#### Environment setup\n\n*If you already have valid connections for Kafka and MongoDB you could skip this step and go to Running the applications step.*\n\n* Run the `./up-kafka-mongodb.sh` bash script to run Kafka and MongoDB as Docker Containers. Please wait until the ~800mb download to be complete.\n\n```\n$ ./up-kafka-mongodb.sh\nPulling mongodb (mongo:latest)...\nlatest: Pulling from library/mongo\nDigest: sha256:2c55bcc870c269771aeade05fc3dd3657800540e0a48755876a1dc70db1e76d9\nStatus: Downloaded newer image for mongo:latest\nPulling kafka (spotify/kafka:latest)...\nlatest: Pulling from spotify/kafka\nDigest: sha256:cf8f8f760b48a07fb99df24fab8201ec8b647634751e842b67103a25a388981b\nStatus: Downloaded newer image for spotify/kafka:latest\nCreating setup_mongodb_1 ...\nCreating setup_kafka_1 ...\nCreating setup_mongodb_1\nCreating setup_mongodb_1 ... done\n```\n* Check if the data layer is ready with the following commands:\n\n```\n$ docker images\nREPOSITORY          TAG                 IMAGE ID            CREATED             SIZE\nmongo               latest              d22888af0ce0        17 hours ago        361MB\nspotify/kafka       latest              a9e0a5b8b15e        11 months ago       443MB\n```\n\n```\n$ docker ps\nCONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                                            NAMES\n32452776153f        spotify/kafka       \"supervisord -n\"         2 days ago          Up 2 days           0.0.0.0:2181-\u003e2181/tcp, 0.0.0.0:9092-\u003e9092/tcp   setup_kafka_1\nba28cf144478        mongo               \"docker-entrypoint...\"   2 days ago          Up 2 days           0.0.0.0:27017-\u003e27017/tcp                         setup_mongodb_1\n```\n\nIf Kafka is running well it will be working with the `10.0.75.1:9092` connection string.\nif MongoDB is running well it will be working at `mongodb://10.0.75.1:27017` connection string.\n\n## Running the applications\n\nYou have two options to run the applications, one is by opening with Visual Studio 2017 and the other is by running dotnet core commands.\n\n### Option 1 - Running with Visual Studio 2017\n\nOpen the three solutions on three Visual Studios them run the following projects.\n\n* `Jambo.Auth.UI`.\n* `Jambo.Consumer.UI`. \n* `Jambo.Producer.UI`.\n\n### Option 2 - Running with dotnet commands\n\n#### How to run the Bearer Authencation API\n\n1. Run the command `dotnet run` at `source\\Auth\\Jambo.Auth.UI` folder.\n```\n$ dotnet run\nUsing launch settings from C:\\git\\jambo\\source\\Auth\\Jambo.Auth.UI\\Properties\\launchSettings.json...\nHosting environment: Development\nContent root path: C:\\git\\jambo\\source\\Auth\\Jambo.Auth.UI\nNow listening on: http://localhost:16024\nApplication started. Press Ctrl+C to shut down.\n```\n2. Navigate to the Swagger UI at (eg. http://localhost:16024/swagger).\n3. Post the following credentials:\n```\n{\n  \"username\": \"ivanpaulovich\",\n  \"password\": \"mysecret\"\n}\n```\n4. __Store the Bearer Token__ because you will need the token value to log on Producer API.\n```\n{\n  \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhYzA4MmE3OS1lMWY3LTQ4MTktYmU1Mi1hOTQwMTBkM2VjZTciLCJzdWIiOiJzdHJpbmciLCJleHAiOjE1MTI0Nzg5ODgsImlzcyI6Imh0dHA6Ly9teWFjY291bnRhcGkiLCJhdWQiOiJodHRwOi8vbXlhY2NvdW50YXBpIn0.9YKGmKaptLBDcExHhPOQ3_j9TsdbkcRf8ZtvIkdq8Go\",\n  \"expiration\": \"2017-12-05T13:03:08Z\"\n}\n```\n#### How to run the Consumer API\n\n1. Run the command `dotnet run` at `source\\Consumer\\Jambo.Consumer.UI` folder \n\n```\n$ dotnet run\n11/5/2017 11:17:20 AM Waiting for events..\n11/5/2017 11:18:20 AM Waiting for events..\n11/5/2017 11:19:20 AM Waiting for events..\n11/5/2017 11:20:20 AM Waiting for events..\n11/5/2017 11:21:20 AM Waiting for events..\n11/5/2017 11:22:20 AM Waiting for events..\n```\n\n3. __Attention:__ keep the Console App running for events processing.\n\n#### How to run the Producer API\n\n![Authorization](https://github.com/ivanpaulovich/jambo/blob/master/Producer.png)\n\n1. Run the command `dotnet run` at the `source\\Producer\\Jambo.Producer.UI` folder.\n\n```\n$ dotnet run\nUsing launch settings from C:\\git\\jambo\\source\\Producer\\Jambo.Producer.UI\\Properties\\launchSettings.json...\nHosting environment: Development\nContent root path: C:\\git\\jambo\\source\\Producer\\Jambo.Producer.UI\nNow listening on: http://localhost:16959\nApplication started. Press Ctrl+C to shut down.\n```\n\n2. Navigate to the Swagger UI (eg. http://localhost:14398/swagger).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanpaulovich%2Fevent-sourcing-jambo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivanpaulovich%2Fevent-sourcing-jambo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanpaulovich%2Fevent-sourcing-jambo/lists"}