{"id":13462356,"url":"https://github.com/vloth/ports-and-adapters","last_synced_at":"2025-03-25T01:32:09.047Z","repository":{"id":40812258,"uuid":"281793155","full_name":"vloth/ports-and-adapters","owner":"vloth","description":"A type safe functional implementation of the hexagonal architecture in typescript ","archived":false,"fork":false,"pushed_at":"2023-03-05T07:21:59.000Z","size":6612,"stargazers_count":16,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-10-29T11:11:13.671Z","etag":null,"topics":["architecture","ports-and-adapters","typescript"],"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/vloth.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":"2020-07-22T22:11:14.000Z","updated_at":"2024-03-21T17:39:03.000Z","dependencies_parsed_at":"2024-07-31T12:17:24.415Z","dependency_job_id":null,"html_url":"https://github.com/vloth/ports-and-adapters","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/vloth%2Fports-and-adapters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vloth%2Fports-and-adapters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vloth%2Fports-and-adapters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vloth%2Fports-and-adapters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vloth","download_url":"https://codeload.github.com/vloth/ports-and-adapters/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245382159,"owners_count":20606162,"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","ports-and-adapters","typescript"],"created_at":"2024-07-31T12:00:45.578Z","updated_at":"2025-03-25T01:32:08.733Z","avatar_url":"https://github.com/vloth.png","language":"TypeScript","funding_links":[],"categories":["Uncategorized","📦 Legacy \u0026 Inactive Projects"],"sub_categories":["Uncategorized"],"readme":"A *type safe functional* implementation of the hexagonal architecture in typescript \n![ports \u0026 adapters](./docs/asset/ports-and-adapters.png)\n\n#### usecase\nThe usecase layer represents the business rules of the software. It encapsulates the constraints around\nthe core types. Therefore all the *use cases*. A change in this layer should not affect the core types.\nAlso changes external to usecases, in the outer layer, should not generate any changes in\nthis layer.\n\n#### adapter\nAdapters are responsible for converting the data between the outer layer\n(http transport, storages, third party services, etc) and the inner layer\n(use cases and core types). Data representations are converted through decoding/encoding.  \n`core.adapter` is the main adapter which decodes any unknown data to a core type.\nBesides the core adapter, there is also the `storage.adapter`, which handles\ndata transport between database engines and the application \n[(more about decoding)](docs/DECODE.md).\n\n#### protocol\nProtocols setup any required infraestructure for the communication between the \noutmost layer and the external world.\n\n\n### Getting Started\n\n```bash\n$ cp .env.sample .env \u0026\u0026 yarn install\n```\n\n### Running in docker\n\n```bash\n# compiling docker compose\n$ docker-compose -f docker/docker-compose.yml build\n\n# running the stack\n$ docker-compose -f docker/docker-compose.yml up -d\n\n# get logs of the application\n$ docker-compose -f docker/docker-compose.yml logs -f app\n\n# run just the database\n$ docker-compose -f docker/docker-compose.yml run --service-ports --detach db\n```\n\n### Tests\n\n```bash\n# unit tests\n$ yarn test\n\n# watch unit tests (transpile only)\n$ yarn test:watch\n\n# in a new window watch build with noEmit\n$ yarn build:watch\n\n# run code coverage\n$ yarn test:cover\n\n# open html report in default browser\n$ yarn test:cover:open\n\n# integration tests\n$ yarn test:integration\n\n# functional tests\n$ yarn test:functional\n```\n\n### References \u0026 Inspiration:\n* https://netflixtechblog.com/ready-for-changes-with-hexagonal-architecture-b315ec967749\n* https://github.com/nubank/basic-microservice-example\n* https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html\n* https://www.youtube.com/watch?v=US8QG9I1XW0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvloth%2Fports-and-adapters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvloth%2Fports-and-adapters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvloth%2Fports-and-adapters/lists"}