{"id":19408858,"url":"https://github.com/4lessandrodev/ddd-app","last_synced_at":"2025-04-24T10:30:48.160Z","repository":{"id":56188222,"uuid":"523209885","full_name":"4lessandrodev/ddd-app","owner":"4lessandrodev","description":"sample app for types-ddd v3","archived":false,"fork":false,"pushed_at":"2024-04-14T03:57:24.000Z","size":692,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-28T07:22:27.096Z","etag":null,"topics":["app-example","domain-driven-design","sample"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/4lessandrodev.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":"2022-08-10T05:15:14.000Z","updated_at":"2024-05-02T04:52:31.471Z","dependencies_parsed_at":"2024-05-02T04:52:15.933Z","dependency_job_id":"aefdcca7-7a9a-474b-b576-aaa5e25554fd","html_url":"https://github.com/4lessandrodev/ddd-app","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fddd-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fddd-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fddd-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fddd-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4lessandrodev","download_url":"https://codeload.github.com/4lessandrodev/ddd-app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223948574,"owners_count":17230132,"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":["app-example","domain-driven-design","sample"],"created_at":"2024-11-10T12:08:21.735Z","updated_at":"2024-11-10T12:08:22.334Z","avatar_url":"https://github.com/4lessandrodev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DDD APP\n\n## Simple App\n\nApp built using `types-ddd` v3 [Link Here](https://www.npmjs.com/package/types-ddd)\n\nA minimum project to test the domain driven design lib\n\n![](docs/tests-result.png)\n\n### How to run this app\n\n- Install deps\n\n```sh\n\n$ yarn install\n\n```\n\n- Run the tests\n\n```sh\n\n$ yarn test\n\n```\n\n- Run the app\n\n```sh\n\n$ yarn dev\n\n```\n\n- Run integration tests\n\n```sh\n\n$ yarn test:e2e\n\n```\n\n- On your terminal run commands or copy curl to execute in postman*\n\n```sh\n\n# List products \n\n$ curl http://localhost:3000/products | jq '.'\n\n```\n\n```sh\n\n# Create Product\n\n$ curl -X POST -H \"Content-Type: application/json\" \\\n-d '{ \"name\": \"valid\", \"price\": 21.00 }' \\\nhttp://localhost:3000/products | jq '.'\n\n```\n\n```sh\n\n# Update Product\n\n$ curl -X PUT -H \"Content-Type: application/json\" \\\n-d '{ \"name\": \"items\", \"price\": 42.00 }' \\\nhttp://localhost:3000/products/:id | jq '.'\n\n\n```\n\n```sh\n\n# List Invoices\n\n$ curl http://localhost:3000/invoices | jq '.'\n\n```\n\n\n## Business Rules\n\nWhen a product (Product Context) is created, an event is dispatched to the Invoice Context domain. The domain generates an invoice aggregate and validates business rules, then dispatches another event to its own context in the infrastructure to build and save the invoice.\n\n```mermaid\ngraph LR\n    A[Create Product] --\u003e|Event| B[Invoice]\n    B --\u003e|Processing| C[Print Invoice]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4lessandrodev%2Fddd-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4lessandrodev%2Fddd-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4lessandrodev%2Fddd-app/lists"}