{"id":13712076,"url":"https://github.com/NHadi/Pos","last_synced_at":"2025-05-06T21:33:30.031Z","repository":{"id":37550161,"uuid":"219121425","full_name":"NHadi/Pos","owner":"NHadi","description":"Sample Application DDD, Reactive Microservices, CQRS Event Sourcing Powered by DERMAYON LIBRARY","archived":false,"fork":false,"pushed_at":"2019-11-12T04:31:55.000Z","size":16541,"stargazers_count":310,"open_issues_count":3,"forks_count":138,"subscribers_count":44,"default_branch":"master","last_synced_at":"2024-08-03T23:24:04.381Z","etag":null,"topics":["cqrs","cqrs-es","ddd-architecture","event-driven","event-sourcing","generic-repository","kafka","microservices","microservices-architecture","netcore","reactive"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/NHadi.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}},"created_at":"2019-11-02T07:48:10.000Z","updated_at":"2024-07-26T14:49:32.000Z","dependencies_parsed_at":"2022-08-26T14:13:24.473Z","dependency_job_id":null,"html_url":"https://github.com/NHadi/Pos","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/NHadi%2FPos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NHadi%2FPos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NHadi%2FPos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NHadi%2FPos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NHadi","download_url":"https://codeload.github.com/NHadi/Pos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224535782,"owners_count":17327594,"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":["cqrs","cqrs-es","ddd-architecture","event-driven","event-sourcing","generic-repository","kafka","microservices","microservices-architecture","netcore","reactive"],"created_at":"2024-08-02T23:01:14.624Z","updated_at":"2025-05-06T21:33:29.986Z","avatar_url":"https://github.com/NHadi.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Sample \u0026 Reference Applications"],"sub_categories":[],"readme":"# POS - DDD, Reactive Microservices, CQRS Event Sourcing Powered by DERMAYON LIBRARY\nSample Application DDD Reactive Microservices with CQRS \u0026 Event Sourcing with [DERMAYON LIBRARY](https://github.com/NHadi/Dermayon). \n\n# Architectures\n![Image of Architecture](https://github.com/NHadi/Pos/blob/master/images/architecture.png)\n\n# Features\n1. Microservices \n2. CQRS (Command Query Responsibility Segregation)\n3. Event Sourcing\n4. Generic Repository \n5. UnitOfWork\n6. Domain Driven Design\n7. Api Gateway [Ocelot](https://ocelot.readthedocs.io/en/latest/introduction/gettingstarted.html)\n8. Multiple Databases type [MongoDb, SqlServer, etc]\n9. Message Broker [Kafka]\n\n# Information\n![Image of DDD](https://github.com/NHadi/Pos/blob/master/images/ddd.png)\n\n1. Domain Layer : Main of Application like Event, Repository, etc\n2. Infrastructure Layer : Databases, Files, etc\n3. Application Layer : WebApi, etc\n\n# Main Architecture\n![Image of mainarchitecture](https://github.com/NHadi/Pos/blob/master/images/mainarchitecture.png)\n\nMicroservices - also known as the microservice architecture - is an architectural style that structures an application as a collection of services that are\n\n1. Highly maintainable and testable\n2. Loosely coupled\n3. Independently deployable\n4. Organized around business capabilities\n5. Owned by a small team\n\nThe microservice architecture enables the rapid, frequent and reliable delivery of large, complex applications. It also enables an organization to evolve its technology stack. [reference](https://microservices.io/)\n\n\n# API Gateway\n![Image of gateway](https://github.com/NHadi/Pos/blob/master/images/gateway.jpg)\n\nThe API Gateway encapsulates the internal system architecture and provides an API that is tailored to each client. It might have other responsibilities such as authentication, monitoring, load balancing, caching,\n\n# CQRS Event Sourcing\n![Image of cqrss](https://github.com/NHadi/Pos/blob/master/images/cqrss.png)\n\nCQRS stands for Command Query Responsibility Segregation. It's a pattern that I first heard described by Greg Young. At its heart is the notion that you can use a different model to update information than the model you use to read information. For some situations, this separation can be valuable, but beware that for most systems CQRS adds risky complexity.\n\nBenefits when to use CQRS Event Sourcing\n![Image of cqrsmaterialized](https://github.com/NHadi/Pos/blob/master/images/cqrsmaterialized.png)\n\nimagine if the system is too complex and more than 1K user hit in server, how many related tables? and how long does it take to get data? with cqrs \u0026 event sourcing we can implement materialized views, or in other words denormalized tables into one data or flat\n\n# Reactive Services, Reactive Manifesto, and Microservices \n![Image of reactive](https://github.com/NHadi/Pos/blob/master/images/reactive.png)\n\nThe Reactive Manifesto outlines qualities of Reactive Systems based on four principles: Responsive, Resilient, Elastic and Message Driven. \n\n1. Responsiveness means the service should respond in a timely manner.\n2. Resilience goes in line with responsiveness, the system should respond even in the face of failure.\n3. Elasticity works with resilience. The ability to spin up new services and for downstream and upstream services and clients to find the new instances is vital to both the resilience of the system as well as the elasticity of the system.  \n4. Message Driven: Reactive Systems rely on asynchronous message passing. This established boundaries between services (in-proc and out of proc) which allows for loose coupling (publish/subscribe or async streams or async calls), isolation (one failure does not ripple through to upstream services and clients), and improved responsive error handling.\n\n## Get started\n\n**Clone the repository**\n\n**Run and Build the app**\n\n```sh\ncd Pos \ndocker-compose up\n```\nwait for completed\n![Image of step1](https://github.com/NHadi/Pos/blob/master/images/step1.png)\n\n**List Url:Port the app**\n```sh\ndocker container ls\n```\n\n![Image of step2](https://github.com/NHadi/Pos/blob/master/images/step2.png)\n\nFor sample we can navigate to PRODUCT SERVICES ::localhost:32771/swagger\n\n![Image of step3](https://github.com/NHadi/Pos/blob/master/images/step3.png)\n\n# Running in GATEWAY\n\nNavigate to postgateway for sample ::localhost:32768/[SERVICES]/[Action]\n\n![Image of step4](https://github.com/NHadi/Pos/blob/master/images/step4.png)\n\nSample Running in Gateway\nhttp://localhost:[PosGatewayPort]/api-product/productCategory/7a3fff4b-54ca-4c21-bf04-c11aea9b7673\n![Image of step5](https://github.com/NHadi/Pos/blob/master/images/step5.png)\n\n# List of Gateway Services\n\n1. Product Services = localhost[::]/api-product/[action]\n2. Customer Services = localhost[::]/api-customer/[action]\n3. Order Services = localhost[::]/api-order/[action]\n4. Report Services = localhost[::]/api-report/[action]\n\n# Check Healty All Services\n![Image of step6](https://github.com/NHadi/Pos/blob/master/images/step6.png)\n\n\nKeep Updates, I'will update for new best practices of technology \u0026 software design, architectural\n\n# Thanks\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNHadi%2FPos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNHadi%2FPos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNHadi%2FPos/lists"}