{"id":14976024,"url":"https://github.com/damikun/trouble-training","last_synced_at":"2025-04-05T16:07:37.985Z","repository":{"id":39782979,"uuid":"406648693","full_name":"damikun/trouble-training","owner":"damikun","description":"FullStack DDD/CQRS with GraphQL  workshop including distributed tracing and monitoring. This shows the configuration from React frontend to .Net backend.","archived":false,"fork":false,"pushed_at":"2022-04-25T10:28:34.000Z","size":39763,"stargazers_count":472,"open_issues_count":4,"forks_count":127,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-03-29T15:07:30.620Z","etag":null,"topics":["architecture-guidelines","bff","clean-architechture","clean-architecture","cqrs-graphql","ddd-cqrs","distributed-tracing","duende-identityserver","elasticapm","full-stack","graphql","graphql-api","graphql-cqrs","graphql-workshop","observability","opentelemetry","relay","webhooks-api","workshop","workshop-materials"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/damikun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-15T07:01:53.000Z","updated_at":"2025-02-18T15:13:54.000Z","dependencies_parsed_at":"2022-08-09T15:25:58.534Z","dependency_job_id":null,"html_url":"https://github.com/damikun/trouble-training","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/damikun%2Ftrouble-training","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damikun%2Ftrouble-training/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damikun%2Ftrouble-training/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damikun%2Ftrouble-training/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/damikun","download_url":"https://codeload.github.com/damikun/trouble-training/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361687,"owners_count":20926643,"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":["architecture-guidelines","bff","clean-architechture","clean-architecture","cqrs-graphql","ddd-cqrs","distributed-tracing","duende-identityserver","elasticapm","full-stack","graphql","graphql-api","graphql-cqrs","graphql-workshop","observability","opentelemetry","relay","webhooks-api","workshop","workshop-materials"],"created_at":"2024-09-24T13:53:09.831Z","updated_at":"2025-04-05T16:07:37.957Z","avatar_url":"https://github.com/damikun.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003ch2 align=\"center\"\u003eFull Stack Workshop (Frontend + Backend + Monitoring) \u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg  width=\"900\" src=\"Doc/Assets/stack_logos.png\" alt=\"Workshop stack tools logos\" \u003e\n\u003c/p\u003e\n\u003cp align=\"center\" \u003e The application contains a full frontend and backend implementation (\u003cb\u003eNet6.0\u003c/b\u003e🚀) with infrastructure and app monitoring. There are several patterns used such as. \u003cb\u003eMediator, BFF, Domain\u003c/b\u003e etc.. and everything is secured with \u003cb\u003eIdentity server\u003c/b\u003e fully supporting \u003cb\u003eOpenId Connect\u003c/b\u003e and \u003cb\u003eOAuth2.0\u003c/b\u003e\u003c/p\u003e\n\n\u003ch5 align=\"center\" \u003e\n\n  \u003ca href=\"https://github.com/damikun/trouble-training/blob/main/Doc/WebHookBackend.md\" \u003eWebHook backend setup\u003c/a\u003e\u003c/br\u003e\n  \u003ca href=\"https://github.com/damikun/trouble-training/blob/main/Doc/Logging.md\" \u003eConfigure Logging\u003c/a\u003e\u003c/br\u003e\n  \u003ca href=\"https://github.com/damikun/trouble-training/blob/main/Doc/OpenTelemetry.md\"\u003eConfigure Tracing\u003c/a\u003e\u003c/br\u003e\n  \u003ca href=\"https://github.com/damikun/trouble-training/blob/main/Doc/Identity.md\"\u003eConfigure Identity\u003c/a\u003e\u003c/br\u003e\n  \u003ca href=\"https://github.com/damikun/trouble-training/blob/main/Doc/ElasticSearch.md\"\u003eConfigure Monitoring\u003c/a\u003e\u003c/br\u003e\n  \u003ca href=\"https://github.com/damikun/trouble-training/blob/main/Doc/GraphQL%20-%20MutationErrors.md\"\u003eHandle GraphQL Errors\u003c/a\u003e\u003c/br\u003e\n  \u003ca href=\"https://github.com/damikun/trouble-training/blob/main/Doc/BuildSystem.md\"\u003eBuild Automation\u003c/a\u003e\u003c/br\u003e\n  \u003ca href=\"https://github.com/damikun/trouble-training/tree/main/Src/Tests/Postman\"\u003eAPI testing Postman/Newman\u003c/a\u003e\u003c/br\u003e\n\u003c/br\u003e\n\n![Backend-Frontend-Testing](https://github.com/damikun/trouble-training/actions/workflows/Backend-Frontend-Testing.yml/badge.svg)\n\u003c/h5\u003e\n\n\u003cp align=\"center\" \u003eDemo Application contains small UI, where you can manage your WebHooks\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"600\" src=\"Doc/Assets/WorkshopUI.gif\" alt=\"Workshop UI example\" \u003e\n\u003c/p\u003e\n\n## Stack\n\n - **Frontend**  - [React](https://reactjs.org/), [Relay](https://relay.dev/), [Typecsript](https://www.typescriptlang.org/), [ReactRouter](https://reactrouter.com/), [TailwindCSS](https://tailwindcss.com/)\n - **Backend** - [Netcore](https://dotnet.microsoft.com/), [Hotchocolate](https://chillicream.com), [IdentityServer](https://duendesoftware.com/products/identityserver), [ElasticSearch](https://www.elastic.co/), [Opentelemerty](https://opentelemetry.io/), [Serilog](https://serilog.net/), [MediatR](https://github.com/jbogard/MediatR), [Hangfire](https://www.hangfire.io/), [Automapper](https://automapper.org/), [Fluentvalidation](https://fluentvalidation.net/), [Docker](https://www.docker.com/), [Entity Framework](https://docs.microsoft.com/cs-cz/ef/)\n\n## Project structure\n\n- [APIServer](https://github.com/damikun/trouble-training/tree/main/Src/APIServer) - Is protected GraphQL API\n- [BFF](https://github.com/damikun/trouble-training/tree/main/Src/BFF) - Is Backend for Frontend pattern\n  - [Frontend React](https://github.com/damikun/trouble-training/tree/main/Src/BFF/API/ClientApp) - This also contains Frontend React app served using static files\n- [IdentityServer](https://github.com/damikun/trouble-training/tree/main/Src/IdentityServer) - Idetity server service for providing `OpenId Connect` and `OAuth2.0`\n- [Device](https://github.com/damikun/trouble-training/blob/main/Doc/Identity.md#authentication-machine-to-machine-using-client-credentials-flow) - Machine-to-machine comunucation using clinetcredentials for external apps/devices\n- [Tests](https://github.com/damikun/trouble-training/blob/main/Src/Tests) - Unit, Integration and API tests\n\n## Integration steps:\n\nPlease follow these steps if you want to understand it because of the connection between the parts:\n\n1) [WebHook backend](Doc/WebHookBackend.md) - I`ll show you how to create basic WebHook integration under .NetCore Backend for this demo.\n2) [Configure logging](Doc/Logging.md) - I`ll show you how to set up a proper distributed logging solution for .Net\n3) [Configure telemetry](Doc/OpenTelemetry.md) - I`ll show you how to properly set up Opentelemetry and Elastic APM.\n4) [Configure identity](Doc/Identity.md) - You`ll learn how to use the BFF pattern to secure your application.\n5) [Configure monitoring](Doc/ElasticSearch.md) - You will learn how to monitor the entire app stack (this depends on parts 1 and 2).\n6) [Handle GraphQL Mutation errors](https://github.com/damikun/trouble-training/blob/main/Doc/GraphQL%20-%20MutationErrors.md) - You will learn how to integrate *6a* pattern.\n7) [Build automation and workflows](Doc/BuildSystem.md) - You will learn how to setup build plan and generate workflows.\n8) [Automate GraphQL API Testing](https://github.com/damikun/trouble-training/tree/main/Src/Tests/Postman) - You will automate API testing using Postman/Newman from Github-Actions\n\n\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n\n\u003cimg src=\"Doc/Assets/workshop_architecture.png\" alt=\"Workshop architecture\" \u003e\n\n\u003cbr /\u003e\n\n\u003c/p\u003e\n\n**Frontend to Backend distributed tracing example**\n\nOn this monitoring graphical visualization, you can see entire request sended from Client Frontend (Creating a webhook)\n\n\u003cp align=\"center\"\u003e\n\n\u003cimg src=\"Doc/Assets/CreateWebHook_Output.png\" alt=\"Elastic Frontend to backend distributed tracing\" \u003e\n\nNet6.0 is 🚀 (Net5.0 vs Net6.0 measurement) \n\u003cimg src=\"Doc/Assets/net6_speed.png\" alt=\"Net performens\"  \u003e\n\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\n\n## Download docker\n\nBased on your system download and [install docker](https://docs.docker.com/engine/install/). This is required!\n\n\u003c/br\u003e\n\n## Restore all projects\n\nThere are two options:\n- Use prepared init script. Run `.\\build.cmd E2E_RunAs_Local` from project root. (This will take time since restore)\n- Manual instalation (Use in case script fails) follow the [manual instal readme](https://github.com/damikun/trouble-training/blob/main/Doc/Manual_Install.md)\n\u003e **NOTE** Restore scripts use `npm`. In case you wanna use `yarn` you need to use manual instalation process..\n\n\u003c/br\u003e\n\n## Run Frontend and Backend\n\nFrom root directory run `tye run`  \n\n(Make sure Docker is running before)\n\n\u003c/br\u003e\n\n## Compose elastic docker images\n\nSet this configurtaion settings (for localhost) from your `cmd`:\n\n```sh\n#For Linux\nsysctl -w vm.max_map_count=262144 \necho \"vm.max_map_count=262144\" \u003e\u003e /etc/sysctl.conf\n```\n\n```sh\n#For Windows WSL\nwsl -d docker-desktop\nsysctl -w vm.max_map_count=262144\n```\n\n**Continue with images:**\n\nIn the `/Docker` folder you will find prepared images for:\n- **Elasticsearch** - Elastic, Kibana, OtelCollector, APMserver, Logstash.\n  - Shell `cd` to `Docker/ElasticSearch` and run `docker-compose up`\n- **Beats** - (Optional)  FileBeat, HeartBeat, MetricBeat, PacketBeat (⚠️ Skip this in case you dont have enaught RAM !)\n  - Shell `cd` to `Docker/Beats` and run `docker-compose up`\n\nIn each folder you will find `docker-compose.yml` and you need to run the command `docker-compose up` in your terminal. The setup has been tested on WSL Docker Desktop.\n\n\u003e **Note:** Folder `/Docker` also contains other images for aditional lessons. (For this demo ignor it)\n\n\u003c/br\u003e\n\n## Run Elastic and Beats\n\nStart the elasticsearch container group and then beats. Please stick to this order to avoid exception logging due to a missing connection. You can also put everything into a Docker image and wait until the previous section is complete.\n\n\u003e **Note:** Running beats for demo is optional. This require additional RAM and CPU allocation..\n\nIn case you have problem to start elastic due to memory issues adjust `max_map_count`\n\n\n```sh\n#For Linux\nsysctl -w vm.max_map_count=262144 \necho \"vm.max_map_count=262144\" \u003e\u003e /etc/sysctl.conf\n```\n\n```sh\n#For Windows WSL\nwsl -d docker-desktop\nsysctl -w vm.max_map_count=262144\n```\n\nTo run all containers, please make sure you have enough RAM and a good computer - this is not for kids :P Have fun :)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamikun%2Ftrouble-training","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdamikun%2Ftrouble-training","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamikun%2Ftrouble-training/lists"}