{"id":23402586,"url":"https://github.com/martincastroalvarez/hexagonal-spring-boot","last_synced_at":"2026-04-02T03:08:33.281Z","repository":{"id":240299060,"uuid":"795700114","full_name":"MartinCastroAlvarez/hexagonal-spring-boot","owner":"MartinCastroAlvarez","description":"Hexagonal Architecture on Java Spring Boot","archived":false,"fork":false,"pushed_at":"2024-06-29T21:37:25.000Z","size":76171,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-03T13:17:59.891Z","etag":null,"topics":["aws","docker","docker-compose","hexagonal-architecture","java","javascript","postgresql","react","spring-boot","tailwind"],"latest_commit_sha":null,"homepage":"","language":"Java","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/MartinCastroAlvarez.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":"2024-05-03T20:56:03.000Z","updated_at":"2025-12-05T03:25:56.000Z","dependencies_parsed_at":"2024-12-22T12:39:52.690Z","dependency_job_id":null,"html_url":"https://github.com/MartinCastroAlvarez/hexagonal-spring-boot","commit_stats":null,"previous_names":["martincastroalvarez/hexagonal-spring-boot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MartinCastroAlvarez/hexagonal-spring-boot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinCastroAlvarez%2Fhexagonal-spring-boot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinCastroAlvarez%2Fhexagonal-spring-boot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinCastroAlvarez%2Fhexagonal-spring-boot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinCastroAlvarez%2Fhexagonal-spring-boot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MartinCastroAlvarez","download_url":"https://codeload.github.com/MartinCastroAlvarez/hexagonal-spring-boot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinCastroAlvarez%2Fhexagonal-spring-boot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31294867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:43:37.129Z","status":"online","status_checked_at":"2026-04-02T02:00:08.535Z","response_time":89,"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":["aws","docker","docker-compose","hexagonal-architecture","java","javascript","postgresql","react","spring-boot","tailwind"],"created_at":"2024-12-22T12:29:35.195Z","updated_at":"2026-04-02T03:08:33.262Z","avatar_url":"https://github.com/MartinCastroAlvarez.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hexagonal-spring-boot\nHexagonal Architecture on Java Spring Boot for managing an e-commerce, and React with Tailwind on the Frontend.\n\n![wallpaper.jpg](wallpaper.jpg)\n\n## What the demos!\n\n- [User Management Demo](user%20management.mov)\n- [Product Management Demo](product%20management.mov)\n- [Time Management Demo](time%20management.mov)\n- [Email Management Demo](message%20management.mov)\n- [Meeting Management Demo](meeting%20management.mov)\n- [Sign Up Demo](sign%20up.mov)\n\n## Introduction\n \n* Read the paper [here](./Paper.pdf)\n\n![Paper.png](./Paper.png)\n\nThis application relies on Java Spring Boot Hexagonal Architecture:\n\n- Domain Models: Defines the core domain models used throughout the application [here](./app/src/main/java/com/martincastroalvarez/hex/hex/domain/models).\n- Domain Out Ports: Includes repository interfaces which define the expected behaviors of data access mechanisms [here](./app/src/main/java/com/martincastroalvarez/hex/hex/domain/ports/out).\n- Domain Exceptions: Custom exceptions that handle specific domain errors [here](./app/src/main/java/com/martincastroalvarez/hex/hex/domain/exceptions).\n- Domain Service Interfaces: Interfaces for the domain services that encapsulate business logic [here](./app/src/main/java/com/martincastroalvarez/hex/hex/domain/services).\n- Unit Tests: Contains unit tests that verify the behavior of the application components [here](./app/src/test/java/com/martincastroalvarez/hex/hex).\n- Configuration: Application configurations and properties [here](./app/src/main/java/com/martincastroalvarez/hex/hex/config).\n- Web API Adapters (Controllers): Adapters that expose the application functionality over HTTP as web APIs [here](./src/main/java/com/martincastroalvarez/hex/hex/adapters/web).\n- Database Adapters (JPA Repositories): Database adapters that implement the repository interfaces with JPA [here](./app/src/main/java/com/martincastroalvarez/hex/hex/adapters/db).\n- Adapter Model Entities: Entity models used by JPA to map to the database tables [here](./app/src/main/java/com/martincastroalvarez/hex/hex/adapters/entities).\n- Mappers for Model to Entity Mapping and Vice Versa: Utility classes to convert between domain models and JPA entities [here](./app/src/main/java/com/martincastroalvarez/hex/hex/adapters/mappers).\n- Models Application (Service Implementations): Implementation of the domain services, where the business logic is actually carried out, [here](./app/src/main/java/com/martincastroalvarez/hex/hex/application).\n- Web application: The React application is implemented [here](./web).\n\n## Documentation\n\n### Installation\n\n* Install Java\n\n```bash\n/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\njava -version\n```\n\n* Install Maven\n\n```bash\nbrew install maven\nmvn -v\n```\n\n* Install the frontend dependencies\n\n```bash\ncd web/\npnpm i\n```\n\n* Install Docker Compose\n\n```bash\nsudo curl -L \"https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-$(uname -s)-$(uname -m)\" -o /usr/local/bin/docker-compose\nsudo chmod +x /usr/local/bin/docker-compose\nsudo systemctl enable docker\nsudo systemctl start docker\n```\n\n### Development\n\n* Run the application\n\n```bash\ncd app/\nmvn spring-boot:run\n```\n\n* Access the application at [http://localhost:8080/](http://localhost:8080/)\n\n* Test the application:\n\n```bash\ncd app/\nmvn test\n```\n```bash\n[...]\n[INFO] Tests run: X, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.056 s -- in com.martincastroalvarez.hex.hex.RunCommandTests\n[INFO] Running com.martincastroalvarez.hex.hex.adapters.web.ProductControllerTest\n[INFO] Tests run: X, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.200 s -- in com.martincastroalvarez.hex.hex.adapters.web.ProductControllerTest\n[INFO] \n[INFO] Results:\n[INFO] \n[INFO] Tests run: X, Failures: 0, Errors: 0, Skipped: 0\n[INFO] \n[INFO] ------------------------------------------------------------------------\n[INFO] BUILD SUCCESS\n[INFO] ------------------------------------------------------------------------\n[INFO] Total time:  8.120 s\n[INFO] Finished at: 2024-05-06T13:39:45-04:00\n[INFO] ------------------------------------------------------------------------\n```\n\n* Start the React app\n\n```bash\ncd web/\nREACT_APP_API_URL=http://localhost:8080 npm start\n```\n\n* Try logging in using the API.\n\n```bash\nRESPONSE=$(curl -s -X POST \"http://localhost:8080/auth/login\" -H \"Content-Type: application/json\" -d '{\"email\": \"user@test.com\", \"password\": \"test\"}')\nTOKEN=$(echo $RESPONSE | jq -r '.Token')\necho $RESPONSE | jq\n```\n```bash\n{\n  \"Token\": \"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ1c2VyQHRlc3QuY29tIn0.vgHfw5gAI9avcrqH_Qt_yrMAroaD_ey0IxouNCkX8DpvBgW2_a_gyFFZ38tqlzchkcjGvoE5uuXc-KhXNgww3Q\"\n}\n```\n\n* Try listing existing products.\n\n```bash\ncurl -s -X GET -H \"Authorization: Bearer $TOKEN\" \"http://localhost:8080/products?page=0\u0026size=3\u0026sort=id\u0026asc=true\" | jq\n```\n```bash\n[\n  {\n    \"id\": 19,\n    \"name\": \"Product 1\",\n    \"isActive\": true,\n    \"price\": 10,\n  },\n  {\n    \"id\": 20,\n    \"name\": \"Product 2\",\n    \"isActive\": true,\n    \"price\": 50,\n  },\n  {\n    \"id\": 21,\n    \"name\": \"Product 3\",\n    \"isActive\": true,\n    \"price\": 50,\n  }\n]\n```\n\n### Deployment\n\n* Build the Java Spring Boot application\n\n```bash\ncd app/\nmvn clean package\n```\n\n* Build the React application\n\n```bash\ncd web/ \nREACT_APP_API_URL=http://54.189.152.54:8080 npm run build\n```\n\n* Upload the React application to AWS S3.\n\n```\ncd web/build/\ns3.post s3://com.martincastroalvarez.aec/\n```\n\n* Deploy the changes to the EC2 instance.\n\n```bash\nssh -i \"hex.pem\" ec2-user@ec2-54-189-152-54.us-west-2.compute.amazonaws.com\n```\n\n* Start the application using Docker Compose\n\n```bash\ndocker-compose up --build -d\n```\n\n* Visit the login page\n\n![login.png](login.png)\n\n* Visit the signup page\n\n![signup.png](signup.png)\n\n* Visit the users management page\n\n![users.png](users.png)\n\n* Visit the homepage \n\n![homepage.png](homepage.png)\n\n* Visit the schedule management page\n\n![schedule.png](schedule.png)\n\n* Visit the meeting management page\n\n![meeting.png](meeting.png)\n\n* Visit the product management page\n\n![product.png](product.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartincastroalvarez%2Fhexagonal-spring-boot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartincastroalvarez%2Fhexagonal-spring-boot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartincastroalvarez%2Fhexagonal-spring-boot/lists"}