{"id":26457131,"url":"https://github.com/kamillobinski/hexagonal-architecture","last_synced_at":"2025-07-27T18:09:27.284Z","repository":{"id":162695928,"uuid":"622925855","full_name":"kamillobinski/hexagonal-architecture","owner":"kamillobinski","description":"Tutorial repository representing a hexagonal Spring Boot application. With PostgreSQL integration, it demonstrates balance, deposit, and withdrawal endpoints for a cash machine.","archived":false,"fork":false,"pushed_at":"2025-03-16T10:30:43.000Z","size":122,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T17:51:45.465Z","etag":null,"topics":["example-project","hexagonal-architecture","maven","postgresql","spring","spring-boot","template"],"latest_commit_sha":null,"homepage":"","language":"Java","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/kamillobinski.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":"2023-04-03T10:48:30.000Z","updated_at":"2025-03-16T10:44:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"7d41de7f-6646-4d29-b02d-ffae8f74fc73","html_url":"https://github.com/kamillobinski/hexagonal-architecture","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kamillobinski/hexagonal-architecture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamillobinski%2Fhexagonal-architecture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamillobinski%2Fhexagonal-architecture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamillobinski%2Fhexagonal-architecture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamillobinski%2Fhexagonal-architecture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kamillobinski","download_url":"https://codeload.github.com/kamillobinski/hexagonal-architecture/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamillobinski%2Fhexagonal-architecture/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267400398,"owners_count":24081183,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["example-project","hexagonal-architecture","maven","postgresql","spring","spring-boot","template"],"created_at":"2025-03-18T22:42:29.703Z","updated_at":"2025-07-27T18:09:27.232Z","avatar_url":"https://github.com/kamillobinski.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n\n[//]: # (  \u003cimg src=\"assets/logo.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e)\n  \u003ch3 align=\"center\"\u003eHexagonal-Architecture\u003c/h3\u003e\n  \u003cp align=\"center\"\u003e\n    Tutorial repository representing a hexagonal Spring Boot\n    \u003cbr\u003eapplication. With PostgreSQL integration, it demonstrates\n    \u003cbr\u003ebalance, deposit, and withdrawal endpoints\n    \u003cbr\u003efor a cash machine.\n    \u003cbr /\u003e\u003cbr /\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## About The Project\n\nThis repository is designed to provide developers with a practical understanding of hexagonal architecture in Java. The project showcases a cash machine application implemented in plain Java, emphasizing flexibility and ease of adapting to different frameworks.\n\nThe application's core logic and domain models are written in plain Java, ensuring modularity and decoupling from any specific framework. This design approach allows for seamless transitions or framework changes, offering developers the freedom to switch from Spring to another framework if needed.\n\nWith the integration of PostgreSQL for data management, developers can explore the implementation of balance, deposit, and withdrawal endpoints in a hexagonal architecture context. By studying this repository, developers can gain valuable insights into building flexible and maintainable Java applications while keeping the door open for future framework adaptability.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n### Built With\n\n![Java][Java-url]\n![Spring][Spring-url]\n![PostgreSQL][PostgreSQL-url]\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\n\nTo get a local copy up and running follow these simple steps.\n\n### Installation\n\n1. Clone the repo\n   ```sh\n   git clone https://github.com/kamillobinski/hexagonal-architecture.git\n   ```\n\n2. Update database variables in the application.yml\n   ```yaml\n   url: jdbc:postgresql://HOST:PORT/DB\n   username: DB_USERNAME\n   password: DB_PASSWORD\n   ```\n\n3. Run the command to start the Spring Boot application (make sure you have Java and Maven installed on your system)\n   ```sh\n   cd ./cash-machine-bootstrap\n   mvn spring-boot:run\n   ```\n\nAlternatively, you can use Docker Compose to simplify the setup process:\n\n1. Ensure that you have Docker and Docker Compose installed on your system.\n2. Open a terminal and navigate to the project's root directory.\n3. Run the following command to build the app and create the PostgreSQL database:\n   ```sh\n   docker-compose up --build -d\n   ```\n   Docker Compose will handle the containerization of the application and automatically set up the PostgreSQL database for you.\n\n   Once the process is complete, the Spring Boot application will be running, and you can access it using the endpoints.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- USAGE --\u003e\n## Usage\n\nAfter setting up and running the application, you can interact with the following endpoints to perform various operations:\n\n1. **Deposit**: To deposit a specified amount into the cash machine, send a POST request to `/deposit/{amount}`. Replace `{amount}` with the desired deposit amount. For example:\n   ```sh\n   POST /deposit/100.00\n   ```\n   ```json\n   {\n      \"cashMachine\": {\n         \"id\": 1,\n         \"balance\": 1100.00\n      },\n      \"balanceBefore\": 1000.00,\n      \"balanceAfter\": 1100.00,\n      \"eventType\": \"DEPOSIT\",\n      \"timestamp\": \"2023-05-13T18:28:18.177313671Z\"\n   }\n   ```\n   This will deposit 100 units of currency into the cash machine.\n\n2. **Withdraw**: To withdraw a specified amount from the cash machine, send a POST request to `/withdraw/{amount}`. Replace `{amount}` with the desired withdrawal amount. For example:\n   ```sh\n   POST /withdraw/205.50\n   ```\n   ```json\n   {\n      \"cashMachine\": {\n         \"id\": 1,\n         \"balance\": 894.50\n      },\n      \"balanceBefore\": 1100.00,\n      \"balanceAfter\": 894.50,\n      \"eventType\": \"WITHDRAWAL\",\n      \"timestamp\": \"2023-05-13T18:30:17.577463254Z\"\n   }\n   ```\n   This will withdraw 205.50 units of currency from the cash machine.\n\n3. **Balance**: To check the current balance of the cash machine, send a GET request to `/balance`. For example:\n   ```sh\n   GET /balance\n   ```\n   ```json\n   {\n      \"cashMachine\": {\n         \"id\": 1,\n         \"balance\": 894.50\n      },\n      \"eventType\": \"BALANCE\",\n      \"timestamp\": \"2023-05-13T18:32:45.287229003Z\"\n   }\n   ```\n   This will retrieve the current balance of the cash machine.\n\nEnsure that you replace the placeholders {amount} with actual values when making requests. \n\nUpon making these API calls, you will receive the appropriate response indicating the success or failure of the operation.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- LICENSE --\u003e\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n[Java-url]: https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge\u0026logo=java\u0026logoColor=white\n[Spring-url]: https://img.shields.io/badge/spring-%236DB33F.svg?style=for-the-badge\u0026logo=spring\u0026logoColor=white\n[PostgreSQL-url]: https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamillobinski%2Fhexagonal-architecture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamillobinski%2Fhexagonal-architecture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamillobinski%2Fhexagonal-architecture/lists"}