{"id":15134432,"url":"https://github.com/afet-yonetim-sistemi/ays-be","last_synced_at":"2025-04-06T05:18:27.421Z","repository":{"id":66651869,"uuid":"601138589","full_name":"afet-yonetim-sistemi/ays-be","owner":"afet-yonetim-sistemi","description":"Afet Yönetim Sistemi Back-End","archived":false,"fork":false,"pushed_at":"2025-03-29T14:37:10.000Z","size":2280,"stargazers_count":76,"open_issues_count":2,"forks_count":14,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-03-30T04:10:07.415Z","etag":null,"topics":["api","authentication","authorization","back-end","disaster-management","docker","docker-compose","end-to-end-testing","hexalayered-architecture","intellij-idea","java","junit","jwt-authentication","liquibase","mysql","restful-api","spring-boot","spring-security","testcontainers","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/afet-yonetim-sistemi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-13T12:59:40.000Z","updated_at":"2025-03-29T14:37:11.000Z","dependencies_parsed_at":"2024-11-19T19:36:45.414Z","dependency_job_id":"83a2075d-21e9-4bab-ad51-e63ef9a226a5","html_url":"https://github.com/afet-yonetim-sistemi/ays-be","commit_stats":{"total_commits":254,"total_committers":25,"mean_commits":10.16,"dds":0.5826771653543308,"last_synced_commit":"e77a099c706f66f0d62661b9368f8acabf044bb6"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afet-yonetim-sistemi%2Fays-be","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afet-yonetim-sistemi%2Fays-be/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afet-yonetim-sistemi%2Fays-be/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afet-yonetim-sistemi%2Fays-be/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afet-yonetim-sistemi","download_url":"https://codeload.github.com/afet-yonetim-sistemi/ays-be/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247436629,"owners_count":20938602,"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":["api","authentication","authorization","back-end","disaster-management","docker","docker-compose","end-to-end-testing","hexalayered-architecture","intellij-idea","java","junit","jwt-authentication","liquibase","mysql","restful-api","spring-boot","spring-security","testcontainers","unit-testing"],"created_at":"2024-09-26T05:20:42.915Z","updated_at":"2025-04-06T05:18:27.379Z","avatar_url":"https://github.com/afet-yonetim-sistemi.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AYS | Afet Yönetim Sistemi APIs  [![Application Status](https://github.com/afet-yonetim-sistemi/ays-be/actions/workflows/application-health-checker.yml/badge.svg)](https://github.com/afet-yonetim-sistemi/ays-be/actions/workflows/application-health-checker.yml)\n\n## Tech Stack\n\n**Framework**\n\n* Core\n    * Spring\n        * Spring Boot 3\n        * Spring Boot Test (Junit)\n        * Spring Boot Dev Tools\n        * Spring Web\n        * Spring Boot Actuator\n        * Spring Doc Open API\n        * Spring Security 6\n        * Spring OAuth2 Client\n        * Spring OAuth2 Resource Server\n    * Spring Data\n        * Spring Data JPA\n\n**3rd Party Dependencies**\n\n* Lombok\n* Test Containers\n* Mapstruct\n* Easy Random\n* JSON Web Token\n* JSON Web Signature\n* Bouncy Castle\n\n**Database**\n\n* MySQL\n\n**Database Migration Tool**\n\n* Liquibase\n\n**Language**\n\n* Java 17\n\n**Build Tool**\n\n* Maven\n\n**Software Development Process**\n\n* TDD\n* Agile Kanban\n* Jira\n\n**Version Control**\n\n* Git\n* GitHub\n\n**APIs Interaction Platform**\n\n* Postman\n\n**Application Pipeline**\n\n* GitHub Actions\n\n--- \n\n---\n\n# Getting Started\n\n---\n\nThe project has been generated by Spring Initializer.\n\n## Instructions Before Building Project\n\n⚠ Make sure NOT to push `template-settings.xml` at all times. ⚠\n\nFirst of all, generate personal access token with this url : https://github.com/settings/tokens\n\n- Create one classic token\n- Make sure to give project, read:packages, repo scopes\n- Give it a name\n- Then click on \"Generate Token\"\n- In case of errors, please check [here](#Common Maven errors)\n\n# Before Running Locally On IDE\n\n\u003e 0. If you don't want to replace your `~/m2/settings.xml` file, use following command to build the project (go to the root folder of the application): `mvn -gs template-settings.xml clean install -U`\n\u003e 1. If you have `~/m2/settings.xml` file in your computer, skip the step without reading the after section.\n     If you aren't using the `~/.m2/settings.xml` file to actively, you can be back up it before creating\n     the new `settings.xml` file, if you want. If you are using actively, after the perform step 3 you can\n     manually merge the `settings.xml` file in the project with the `~/.m2/settings.xml` file and skip step 2 and 4.\n\u003e 2. While inside the project directory in the terminal; that is, when you are in the `~/afet-yonetim-sistemi/ays-be`\n     directory, run the command `cp template-settings.xml settings.xml`.\n\u003e 3. In the settings.xml file within the project, replace the `{YOUR_GITHUB_USERNAME}` placeholder with your GitHub\n     username and replace `{YOUR_PERSONAL_GITHUB_ACCESS_TOKEN}` with the access token value you created on GitHub as\n     described in the instructions under the `'Instructions Before Building The Project'` section.\n\u003e 4. If the `.m2` directory has not been created before, you can use the command `mkdir ~/.m2` and then run the\n     command `cp settings.xml ~/.m2/settings.xml` for copy the `settings.xml` file located in the project\n     to the `~/.m2` directory.\n\n#### Don't forget to enable Lombok pre-processing in your IDE!\n\n## Building The Project With Tests\n\n```\n./mvnw clean install\n```\n\n## Building The Project Without Tests\n\n```\n./mvnw clean install -DskipTests\n```\n\n## Running as Docker MySQL container\n\nBefore running the project, you need to run the following command to start the MySQL container:\n\n```\ndocker compose up -d --build database\n```\n\nIf you want to recreate the MySQL container, you can run the following command:\n\n```\ndocker compose up --force-recreate -d --build database\n```\n\nIf you want to stop the MySQL container, you can run the following command:\n\n```\ndocker compose down -v database\n```\n\n---\n\n# Running As Docker Container\n\n\u003e 1. While inside the project directory in the terminal; that is, when you are in the `~/afet-yonetim-sistemi/ays-be`\n     directory, run the command `cp template-settings.xml settings.xml`.\n\u003e 2. In the `settings.xml` file within the project, replace the `{YOUR_GITHUB_USERNAME}` placeholder with your GitHub\n     username and replace `{YOUR_PERSONAL_GITHUB_ACCESS_TOKEN}` with the access token value you created on GitHub as\n     described in the instructions under the `'Instructions Before Building The Project'` section.\n\nBefore running the project, you need to run the following command to start the project container:\n\n```\ndocker compose up -d --build\n```\n\nIf you want to recreate the project container, you can run the following command:\n\n```\ndocker compose up --force-recreate -d --build \n```\n\nIf you want to stop the project container, you can run the following command:\n\n```\ndocker compose down -v \n```\n\n---\n\n---\n\n# [How to Contribute](https://github.com/afet-yonetim-sistemi/ays-be/edit/main/CONTRIBUTING.md)\n\nThe project is managed by [Jira](https://afetyonetimsistemi.atlassian.net/jira/projects).\nYou can assign an issue from the Todo list and start working on it.\n\n---\n\n## Project Documents\n\nFor other information, you can check [Confluence](https://afetyonetimsistemi.atlassian.net/wiki/spaces/AYS/overview)\nPage.\n\n---\n\n## Postman\n\n### [Documentation](https://documenter.getpostman.com/view/26813504/2s93kz55Jz) \u0026 [Workspace](https://www.postman.com/afetyonetimsistemi/workspace/api)\n\n---\n\n## Common Errors\n\n### 1. Can't download the package from the private repo:\n\n#### Error:\n\n\u003e [ERROR] Failed to execute goal on project ays-be: Could not resolve dependencies for project org.ays:ays-be:jar:\n\u003e 1.1.0.MVP: Could not find artifact org.locationtech.jts:jts-core:jar:1.18.2 -\u003e [Help 1]\n\n#### Solution:\n\n\u003e Make sure to create your github user token with the correct scopes\n\n### 2. Can't build the project since it gets the following exception from bouncycasle:\n\n#### Error:\n\n```log\n[ERROR] error reading .../.m2/repository/org/bouncycastle/bcprov-jdk18on/1.78/bcprov-jdk18on-1.78.jar; zip file is empty\n[ERROR] .../ays-be/src/main/java/org/ays/auth/service/AysInvalidTokenService.java:[1,1] cannot access org.ays.auth.service\nZipException opening \"bcprov-jdk18on-1.78.jar\": zip END header not found\n```\n\n#### Solution:\n\n\u003e Make sure to remove bouncy castle from your .m2 folder then run `mvn clean install` again to download the packages.\n\n### 3. Can't download the package from the private repo:\n\n#### Error:\n\n```log\n[ERROR] Failed to execute goal on project ays-be: Could not resolve dependencies for project org.ays:ays-be🫙1.1.0.MVP:\norg.ays:ays-be-encryption-utility🫙1.0.2 was not found\nin https://maven.pkg.github.com/afet-yonetim-sistemi/ays-be-encryption-utility during a previous attempt. This failure\nwas cached in the local repository and resolution is not reattempted until the update interval of github has elapsed\nor updates are forced -\u003e [Help 1]\n```\n\n#### Solution:\n\n\u003e Use the following command to build the project: `mvn clean install -U -DskipTests`\n\n### 4. Email Configuration Errors:\n\n#### 4.1 Running the project with the following error:\n\n```log\n2024-07-13T12:13:21.244+03:00 WARN 5171 --- [on(2)-127.0.0.1] o.s.b.actuate.mail.MailHealthIndicator   : Mail health\ncheck failed\n\njakarta.mail.AuthenticationFailedException: 535-5.7.8 Username and Password not accepted. For more information, go to\n535 5.7.8  https://support.google.com/mail/?p=BadCredentials 5b1f17b1804b1-427a5e9a809sm13702135e9.28 - gsmtp\nat org.eclipse.angus.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:954) ~[jakarta.mail-2.0.3.jar:na]\n     at org.eclipse.angus.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:865) ~[jakarta.mail-2.0.3.jar:na]\n     at org.eclipse.angus.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:769) ~[jakarta.mail-2.0.3.jar:na]\n```\n\n#### 4.2 Error while sending an email from the application:\n\n```log\n 2024-07-13T12:13:23.028+03:00 ERROR 5171 --- [onPool-worker-1] o.a.c.service.impl.AysMailServiceImpl    : Received\n error while sending mail to [iletisim@afetyonetimsistemi.org] with EXAMPLE template\n\n org.springframework.mail.MailAuthenticationException: Authentication failed\n at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:402) ~[spring-context-support-6.1.10.jar:6.1.10]\n     at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:350) ~[spring-context-support-6.1.10.jar:6.1.10]\n```\n\n#### Solution:\n\n\u003e If you don’t need to send an email, you can ignore these warnings.\n\u003e\n\u003e ---\n\u003e\n\u003e If you need to send an email from the application;\n\u003e\n\u003e Please review the documentation and use the Override configuration properties feature to override the default mail\n\u003e parameters with your own mail information. You can refer to this link for more\n\u003e details: https://www.jetbrains.com/help/idea/run-debug-configuration-spring-boot.html\n\n### 5. Validation Failed Exception:\n\n#### Error:\n```log\n[ERROR] Validation Failed:\n    2 changesets check sum\n        db/changelog/changes/1-ays-ddl.xml::1-ays-ddl::ays was: 9:bc046153f5677aace14604c2c58c3442 but is now: 9:34f914e2fbb9a593ea3c725551f758ad\n        db/changelog/changes/2-ays-dml.xml::2-ays-dml::ays was: 9:125d52ec3abeced458eb69767a39c443 but is now: 9:6e22314bcbe8286ee0eea2f049e16e26\n```\n\n#### Solution:\n\u003e This problem is caused by the checksum values in the database not matching.\n\u003e The Override configuration properties section opens. \n\u003e Application parameters can be overridden specifically. \n\u003e If the **_AYS_LIQUIBASE_ENABLE_DROP_FIRST_** parameter in application.yml is defined here and given as true, the database is cleaned and recreated in the local environment. \n\u003e If this is not desired to be done every time the application is run, the parameter can only be disabled without deleting it.\n\u003e details: https://www.jetbrains.com/help/idea/run-debug-configuration-spring-boot.html#spring-boot\n---\n\n# Project Infrastructure\n\n## 🏛️ HexaLayered Architecture\n\n![](/documents/architecture/ays-architecture.png?raw=true)\n\n\u003e **Reference: [HexaLayered Architecture](https://github.com/agitrubard/hexalayered-architecture)**\n\n## 📦 Package Architecture\n\n![](/documents/architecture/package-architecture-example.png?raw=true)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafet-yonetim-sistemi%2Fays-be","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafet-yonetim-sistemi%2Fays-be","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafet-yonetim-sistemi%2Fays-be/lists"}