{"id":22307797,"url":"https://github.com/albertllousas/flight-booking-microservice","last_synced_at":"2025-03-26T01:24:33.432Z","repository":{"id":120564506,"uuid":"426379184","full_name":"albertllousas/flight-booking-microservice","owner":"albertllousas","description":null,"archived":false,"fork":false,"pushed_at":"2021-11-23T18:13:25.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T22:48:30.006Z","etag":null,"topics":["ddd","functional-programming","hexagonal-architecture","microservice","pedestal"],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/albertllousas.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":"2021-11-09T20:36:46.000Z","updated_at":"2024-06-06T09:41:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"e0b7b58a-5f66-48ce-bc19-c979da880e9d","html_url":"https://github.com/albertllousas/flight-booking-microservice","commit_stats":null,"previous_names":["albertllousas/flight-booking-microservice"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertllousas%2Fflight-booking-microservice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertllousas%2Fflight-booking-microservice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertllousas%2Fflight-booking-microservice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertllousas%2Fflight-booking-microservice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/albertllousas","download_url":"https://codeload.github.com/albertllousas/flight-booking-microservice/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245569640,"owners_count":20637013,"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":["ddd","functional-programming","hexagonal-architecture","microservice","pedestal"],"created_at":"2024-12-03T20:11:40.450Z","updated_at":"2025-03-26T01:24:33.406Z","avatar_url":"https://github.com/albertllousas.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flight-booking-system\n\n## Description\n\nFlight booking system is a try to apply hexagonal architecture and domain-driven design patterns to the clojure world.\n\nKeywords: `microservice`, `clojure`, `Hexagonal-Architecture`, `SOLID`, `dependecy-inversion`, `Domain-Driven Design`, \n`functional-programming`, `Testing`, `Domain-Events`, `Pedestal`\n\n## Why\n\nLearning clojure I was wondering if an architecture pattern like hexagonal architecture that mainly relies on the \ndependency inversion principle could make sense in a dynamic language where types are weak.\n\nHere you have the result, even though I am not an expert on clojure I think this pattern could be applied and can bring \nits main benefit, the business/domain isolation.\n\n## Test\n```shell\nlein test\n```\nOutput:\n```shell\nlein test flight-booking-system.application-service.flight-services-test\nlein test flight-booking-system.domain-model.flight-test\nlein test flight-booking-system.infrastructure.in-adapters.http-routes-test\nlein test flight-booking-system.infrastructure.out-adapters.in-memory-event-publisher-test\nlein test flight-booking-system.infrastructure.out-adapters.in-memory-flight-repository-test\n\nRan 10 tests containing 34 assertions.\n0 failures, 0 errors.\n```\n\n## Missing\n- Implement optimistic locking: keeping track of the version of the flight aggregate and throwing concurrent-flight-modification-exception when it happens.\n- Add specs to the flight domain\n\n## Run\n\n```shell\nlein uberjar\n```\n\n### Usage\n\n```shell\nlein run\n```\n\n```shell\ncurl --request POST http://localhost:8080/flights \\                \n  --header 'Content-Type: application/json' \\\n  --data '{\"flight-code\":\"LH1617\", \"seat-rows\": 24, \"seats-per-row\": 6}' \\\n  --include\n```\n\n```shell\ncurl --request POST http://localhost:8080/flights/LH1617/bookings \\\n  --header 'Content-Type: application/json' \\\n  --data '{\"seat-letter\": \"a\", \"seat-row\": 1}' \\\n  --include\n```\n\n```shell\ncurl --request GET http://localhost:8080/flights/LH1617\n```\n\n## License\n\nCopyright © 2021 FIXME\n\nThis program and the accompanying materials are made available under the\nterms of the Eclipse Public License 2.0 which is available at\nhttp://www.eclipse.org/legal/epl-2.0.\n\nThis Source Code may also be made available under the following Secondary\nLicenses when the conditions for such availability set forth in the Eclipse\nPublic License, v. 2.0 are satisfied: GNU General Public License as published by\nthe Free Software Foundation, either version 2 of the License, or (at your\noption) any later version, with the GNU Classpath Exception which is available\nat https://www.gnu.org/software/classpath/license.html.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbertllousas%2Fflight-booking-microservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbertllousas%2Fflight-booking-microservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbertllousas%2Fflight-booking-microservice/lists"}