{"id":19014933,"url":"https://github.com/ddd-by-examples/library-php","last_synced_at":"2025-04-06T07:11:17.767Z","repository":{"id":48131467,"uuid":"217682284","full_name":"ddd-by-examples/library-php","owner":"ddd-by-examples","description":"WIP: A comprehensive Domain-Driven Design example with problem space strategic analysis and various tactical patterns.","archived":false,"fork":false,"pushed_at":"2024-11-06T15:58:25.000Z","size":382,"stargazers_count":99,"open_issues_count":3,"forks_count":12,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-30T05:09:34.814Z","etag":null,"topics":["aggregates","book-library","cqrs","domain-driven-design","events","php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/ddd-by-examples.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-26T08:55:52.000Z","updated_at":"2024-11-22T11:20:39.000Z","dependencies_parsed_at":"2024-06-12T08:37:21.264Z","dependency_job_id":"09f51eb4-48dc-45d4-811b-37b1d10608fc","html_url":"https://github.com/ddd-by-examples/library-php","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/ddd-by-examples%2Flibrary-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddd-by-examples%2Flibrary-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddd-by-examples%2Flibrary-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddd-by-examples%2Flibrary-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ddd-by-examples","download_url":"https://codeload.github.com/ddd-by-examples/library-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445669,"owners_count":20939958,"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":["aggregates","book-library","cqrs","domain-driven-design","events","php"],"created_at":"2024-11-08T19:34:11.471Z","updated_at":"2025-04-06T07:11:17.722Z","avatar_url":"https://github.com/ddd-by-examples.png","language":"PHP","readme":"# Library (PHP)\n\n[![Minimum PHP Version](https://img.shields.io/badge/php-%5E8.3-8892BF.svg)](https://php.net/)\n[![ci](https://github.com/ddd-by-examples/library-php/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/ddd-by-examples/library-php/actions/workflows/ci.yml)\n![GitHub](https://img.shields.io/github/license/ddd-by-examples/library-php)\n\n**The project is currently under development. Some solutions are temporary and may change.**\nWhich doesn't mean you can't learn from it 😉.\n\nA comprehensive Domain-Driven Design example with problem space strategic analysis and various tactical patterns.\n\nReference: https://github.com/ddd-by-examples/library\n\n## About\n\nThis is a project of a library, driven by real [business requirements](#domain-description).\nWe use techniques strongly connected with Domain Driven Design, Behavior-Driven Development,\nEvent Storming, User Story Mapping. \n\n## Domain description\n\nA public library allows patrons to place books on hold at its various library branches.\nAvailable books can be placed on hold only by one patron at any given point in time.\nBooks are either circulating or restricted, and can have retrieval or usage fees.\nA restricted book can only be held by a researcher patron. A regular patron is limited\nto five holds at any given moment, while a researcher patron is allowed an unlimited number\nof holds. An open-ended book hold is active until the patron checks out the book, at which time it\nis completed. A closed-ended book hold that is not completed within a fixed number of \ndays after it was requested will expire. This check is done at the beginning of a day by \ntaking a look at daily sheet with expiring holds. Only a researcher patron can request\nan open-ended hold duration. Any patron with more than two overdue checkouts at a library\nbranch will get a rejection if trying a hold at that same library branch. A book can be\nchecked out for up to 60 days. Check for overdue checkouts is done by taking a look at\ndaily sheet with overdue checkouts. Patron interacts with his/her current holds, checkouts, etc.\nby taking a look at patron profile. Patron profile looks like a daily sheet, but the\ninformation there is limited to one patron and is not necessarily daily. Currently a\npatron can see current holds (not canceled nor expired) and current checkouts (including overdue).\nAlso, he/she is able to hold a book and cancel a hold.\n\nHow actually a patron knows which books are there to lend? Library has its catalogue of\nbooks where books are added together with their specific instances. A specific book\ninstance of a book can be added only if there is book with matching ISBN already in\nthe catalogue.  Book must have non-empty title and price. At the time of adding an instance\nwe decide whether it will be Circulating or Restricted. This enables\nus to have book with same ISBN as circulated and restricted at the same time (for instance,\nthere is a book signed by the author that we want to keep as Restricted)\n\n## How to build and run\n\nThe code below will boot the project, install all dependencies and run the build script (code style check, static analysis and all tests):\n\n```shell\nmake up\nmake ci\n```\n\n### Interactive shell\n\n```shell\nmake bash\n```\n\n\n## References\n\n1. [Introducing EventStorming](https://leanpub.com/introducing_eventstorming) by Alberto Brandolini\n2. [Domain Modelling Made Functional](https://pragprog.com/book/swdddf/domain-modeling-made-functional) by Scott Wlaschin\n3. [Software Architecture for Developers](https://softwarearchitecturefordevelopers.com) by Simon Brown\n4. [Clean Architecture](https://www.amazon.com/Clean-Architecture-Craftsmans-Software-Structure/dp/0134494164) by Robert C. Martin\n5. [Domain-Driven Design: Tackling Complexity in the Heart of Software](https://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215) by Eric Evans\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddd-by-examples%2Flibrary-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fddd-by-examples%2Flibrary-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddd-by-examples%2Flibrary-php/lists"}