{"id":20725719,"url":"https://github.com/exponentially/extreme_system_example","last_synced_at":"2025-09-21T23:39:43.906Z","repository":{"id":99073375,"uuid":"93385767","full_name":"exponentially/extreme_system_example","owner":"exponentially","description":"Example umbrella project that demonstrates how Extreme.System should be used","archived":false,"fork":false,"pushed_at":"2018-09-07T13:15:16.000Z","size":96,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-17T23:31:04.923Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/exponentially.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-05T09:07:36.000Z","updated_at":"2023-10-22T05:03:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"ac2011ba-73f9-4112-97f1-5c350c3d29cb","html_url":"https://github.com/exponentially/extreme_system_example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exponentially%2Fextreme_system_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exponentially%2Fextreme_system_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exponentially%2Fextreme_system_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exponentially%2Fextreme_system_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exponentially","download_url":"https://codeload.github.com/exponentially/extreme_system_example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243004103,"owners_count":20220236,"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":[],"created_at":"2024-11-17T04:20:17.990Z","updated_at":"2025-09-21T23:39:38.858Z","avatar_url":"https://github.com/exponentially.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExtremeSystem.Example\n\nThis is example project for using Extreme.System. It is set of building block usefull for CQRS+ES systems.\n\n\n## Dependencies\n\n### EventStore\n\n\n## Running system\n\n### Get the example\n\n    $ git clone https://github.com/exponentially/extreme_system_example.git\n    $ cd extreme_system_example\n    $ mix deps.get\n\n### Run local event store\n\nFirst time pull docker image:\n\n    $ docker run --name eventstore4.1 -it -p 2113:2113 -p 1113:1113 -e EVENTSTORE_RUN_PROJECTIONS=all -e EVENTSTORE_START_STANDARD_PROJECTIONS=true eventstore/eventstore\n\nDocker container can be stopped as follows\n\n    $ docker stop eventstore4.1\n\nNext time you want to start it, just start container:\n\n    $ docker start eventstore4.1\n\n### Run beam nodes (api and users)\n\n- From new terminal go to api folder and run it:\n\n    $ cd apps/api\n    $ ./run.sh\n\n  You should have opened iex with something like:\n\n```\nErlang/OTP 21 [erts-10.0.5] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]\n\n2018-09-07 14:24:16.278 [info] pid=\u003c0.295.0\u003e Starting ExtremeSystem.Example.Api in :normal mode\n2018-09-07 14:24:16.282 [info] pid=\u003c0.295.0\u003e Trying to connect node :example_api@mystique to: [\"ExSysApi\", \"ExSysUsers\"]\n2018-09-07 14:24:16.285 [error] pid=\u003c0.58.0\u003e\n** Cannot get connection id for node :example_api@mystique\n\n2018-09-07 14:24:16.353 [info] pid=\u003c0.312.0\u003e Running ExtremeSystem.Example.Api.Endpoint with Cowboy using http://0.0.0.0:4000\nInteractive Elixir (1.7.3) - press Ctrl+C to exit (type h() ENTER for help)\niex(example_api@mystique)1\u003e 2018-09-07 14:24:17.305 [info] pid=\u003c0.300.0\u003e Connected nodes: []\n```\n\n- From the other terminal, go to users folder and run it:\n\n    $ cd apps/users\n    $ ./run.sh\n\nNodes should connect to cluster as you may see in iex:\n\n```\nErlang/OTP 21 [erts-10.0.5] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]\n\n2018-09-07 14:25:43.259 [info] pid=\u003c0.266.0\u003e Starting ExtremeSystem.Example.Users in :normal mode\n2018-09-07 14:25:43.262 [info] pid=\u003c0.266.0\u003e Trying to connect node :es_users@mystique to: [\"ExSysApi\", \"ExSysUsers\"]\n2018-09-07 14:25:43.282 [error] pid=\u003c0.58.0\u003e\n** Cannot get connection id for node :es_users@mystique\n\n2018-09-07 14:25:43.315 [info] pid=\u003c0.286.0\u003e Connecting Extreme to 127.0.0.1:1113\n2018-09-07 14:25:43.316 [info] pid=\u003c0.286.0\u003e Successfully connected to EventStore using protocol version 3\nInteractive Elixir (1.7.3) - press Ctrl+C to exit (type h() ENTER for help)\niex(es_users@mystique)1\u003e 2018-09-07 14:25:44.283 [info] pid=\u003c0.272.0\u003e Connected nodes: [:example_api@mystique]\n```\n\n### Calling API\n\nThere is Postman collection in `apps/api/doc/ExtremeSystem.Example.postman_collection.json`\n\nYou can try it using curl as well:\n\n- Register new user:\n\n```\ncurl -X POST \\\n  http://localhost:4000/users \\\n  -v \\\n  -H 'Accept: application/json' \\\n  -H 'Cache-Control: no-cache' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"email\": \"user.1@example.com\",\n    \"name\": \"Milan\"\n}'\n```\n\nLast line of output should be:\n\n```\n{\"id\":\"05c03d0c-b29a-11e8-aff9-acbc32d4fe0b\"}\n```\n\nIf so, that is ID of your new User. You can confirm that in EventStore as well @ http://localhost:2113/web/index.html#/streams/ex_users-05c03d0c-b29a-11e8-aff9-acbc32d4fe0b\n\n- Once you have registered user, you can change it's name:\n\n```\ncurl -X PUT \\\n  http://localhost:4000/users/05c03d0c-b29a-11e8-aff9-acbc32d4fe0b \\\n  -v \\\n  -H 'Accept: application/json' \\\n  -H 'Cache-Control: no-cache' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n  \"version\": 2,\n    \"name\": \"Milan II\"\n}'\n```\n\nYou should get 204 back and new aggregate version in header:\n\n```\n\u003c x-aggregate-version: 2\n```\n\nYou should also notice new event in that users stream.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexponentially%2Fextreme_system_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexponentially%2Fextreme_system_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexponentially%2Fextreme_system_example/lists"}