{"id":19521565,"url":"https://github.com/cryptedsnow/sb3-hxh","last_synced_at":"2026-04-09T17:58:04.260Z","repository":{"id":231121889,"uuid":"779054867","full_name":"CryptedSnow/sb3-hxh","owner":"CryptedSnow","description":"Spring Boot 3 application (codes in Portuguese).","archived":false,"fork":false,"pushed_at":"2025-05-08T12:56:38.000Z","size":307,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-04T03:41:59.254Z","etag":null,"topics":["docker","java","mysql","postgresql","spring-boot"],"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/CryptedSnow.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,"zenodo":null}},"created_at":"2024-03-29T00:10:42.000Z","updated_at":"2025-05-08T12:56:42.000Z","dependencies_parsed_at":"2024-04-13T00:35:18.948Z","dependency_job_id":"bf6ce2fa-b990-4e69-9eaf-012581c650f1","html_url":"https://github.com/CryptedSnow/sb3-hxh","commit_stats":null,"previous_names":["iury189/sb3-hxh","cryptedsnow/sb3-hxh"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CryptedSnow%2Fsb3-hxh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CryptedSnow%2Fsb3-hxh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CryptedSnow%2Fsb3-hxh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CryptedSnow%2Fsb3-hxh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CryptedSnow","download_url":"https://codeload.github.com/CryptedSnow/sb3-hxh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CryptedSnow%2Fsb3-hxh/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259256426,"owners_count":22829626,"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":["docker","java","mysql","postgresql","spring-boot"],"created_at":"2024-11-11T00:33:18.366Z","updated_at":"2025-12-30T22:37:25.618Z","avatar_url":"https://github.com/CryptedSnow.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Application (map)\n\n```\nsb3-hxh  \n├── src  \n    └── main  \n        ├── java  \n        │   └── com.springboot3.sb3hxh  \n        │       ├── Controller  \n        │       │   ├── HunterController.java  \n        │       │   ├── RecompensaController.java  \n        │       │   └── RecompensadoController.java  \n        │       ├── Converter  \n        │       │   ├── HunterConverter.java  \n        │       │   ├── RecompensaConverter.java  \n        │       │   ├── TipoHunterConverter.java  \n        │       │   ├── TipoNenConverter.java  \n        │       │   └── TipoSanguineoConverter.java  \n        │       ├── DAO  \n        │       │   ├── HunterDAO.java  \n        │       │   ├── RecompensaDAO.java  \n        │       │   ├── RecompensadoDAO.java  \n        │       │   ├── TipoHunterDAO.java  \n        │       │   ├── TipoNenDAO.java  \n        │       │   └── TipoSanguineoDAO.java  \n        │       ├── Entity  \n        │       │   ├── HunterEntity.java  \n        │       │   ├── RecompensadoEntity.java  \n        │       │   ├── RecompensaEntity.java  \n        │       │   ├── TipoHunterEntity.java  \n        │       │   ├── TipoNenEntity.java  \n        │       │   └── TipoSanguineoEntity.java  \n        │       ├── Service  \n        │       │   ├── HunterService.java  \n        │       │   ├── RecompensadoService.java  \n        │       │   ├── RecompensaService.java  \n        │       │   ├── TipoHunterService.java  \n        │       │   ├── TipoNenService.java  \n        │       │   └── TipoSanguineoService.java  \n        │       └── Validation  \n        │           ├── ConstraintValidation  \n        │           │   ├── HunterValidation.java  \n        │           │   ├── RecompensaConstraintValidation.java  \n        │           │   ├── TipoHunterConstraintValidation.java  \n        │           │   ├── TipoNenConstraintValidation.java  \n        │           │   └── TipoSanguineoConstraintValidation.java  \n        │           ├── HunterValidation.java  \n        │           ├── RecompensaValidation.java  \n        │           ├── RecompensadoValidation.java  \n        │           ├── TipoHunterValidation.java  \n        │           ├── TipoNenValidation.java  \n        │           └── TipoSanguineoValidation.java  \n        └── resources  \n            ├── templates  \n            └── application.properties  \n```\n\nIt is necessary install ```JDK```, the minimum version to perfomate Spring Boot 3 is **17** (I usually use **JDK 21** version). Don't forget about to use [IntelliJ IDEA](https://www.jetbrains.com/idea/) to facilitate your experience.\n\n### Application structure pattern\n\nSee more about **[Three-Tier Architecture](https://www.ibm.com/topics/three-tier-architecture)**.\n\n1 - Presentation tier:\n* ```templates``` folder: Interface files from application (Because redirecting of ```Controller``` class).\n\n2 - Application tier:\n* ```Controller``` folder: HTTP requests (extends ```Entity, Service``` class).\n* ```Service``` folder: Logic of application methods (extends ```DAO, Entity``` class).\n\n3 - Data tier:\n* ```DAO``` folder: Access the database (extends ```Entity``` class).\n* ```Entity``` folder: Represent the database informations.\n\n4 - Foreign key converter\n* ```Converter``` folder: Use to define correctly foreign key value.\n\n5 - Exist validation\n* ```Validation``` folder: Create a validation to check existence of foreign keys.\n\n6 - Others files:\n* ```application.properties```: Application settings file.\n\n## Database\n\n- You can use ```PostgreSQL``` or ```MySQL``` database. Define settings database in ```application.properties``` (Check the database name, user and password of your preference)\n\n```\n# MySQL\nspring.datasource.url=jdbc:mysql://localhost:3306/database_name\nspring.datasource.username=root\nspring.datasource.password=\nspring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver\n\n# PostgreSQL\nspring.datasource.url=jdbc:postgresql://localhost:5432/database_name\nspring.datasource.username=postgres\nspring.datasource.password=\nspring.datasource.driver-class-name=org.postgresql.Driver\n```\n\n- If you want use ```Docker``` to insert the lines:\n\n```\n# MySQL\nspring.datasource.url=jdbc:mysql://localhost:3306/sb3-hxh\nspring.datasource.username=user\nspring.datasource.password=password\nspring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver\n\n# PostgreSQL\nspring.datasource.url=jdbc:postgresql://localhost:5432/sb3-hxh\nspring.datasource.username=user\nspring.datasource.password=password\nspring.datasource.driver-class-name=org.postgresql.Driver\n```\n\n### Panels\n\n- phpMyAdmin: http://localhost:8081\n    - User: ```user```\n    - Password: ```password```\n- pgAdmin: http://localhost:8082\n    - User: ```admin@admin.com```\n    - Password: ```admin```\n\nTo create a server to pgAdmin:\n- Host name/address: ```pgsql```\n- Port: ```5432```\n- Maintenance database:\t```postgres```\n- Username:\t```user```\n- Password:\t```password```\n\nCreate table to **PostgreSQL** database:\n```\nCREATE TABLE tipos_hunters (\n\tid SERIAL PRIMARY KEY,\n\tdescricao VARCHAR(50) NOT NULL,\n\tdeleted_at TIMESTAMP\n);\n\nCREATE TABLE tipos_nens (\n\tid SERIAL PRIMARY KEY,\n\tdescricao VARCHAR(15) NOT NULL,\n\tdeleted_at TIMESTAMP\n);\n\nCREATE TABLE tipos_sanguineos (\n\tid SERIAL PRIMARY KEY,\n\tdescricao VARCHAR(3) NOT NULL,\n\tdeleted_at TIMESTAMP\n);\n\nCREATE TABLE hunters (\n\tid SERIAL PRIMARY KEY,\n\tnome_hunter VARCHAR(50) NOT NULL,\n\tidade_hunter INT NOT NULL,\n\taltura_hunter DECIMAL(3,2) NOT NULL,\n\tpeso_hunter DECIMAL(5,2) NOT NULL,\n\ttipo_hunter_id INT NOT NULL,\n\ttipo_nen_id INT NOT NULL,\n\ttipo_sanguineo_id INT NOT NULL,\n\tinicio DATE,\n\ttermino DATE,\n\tdeleted_at TIMESTAMP,\n\tFOREIGN KEY (tipo_hunter_id) REFERENCES tipos_hunters (id),\n\tFOREIGN KEY (tipo_nen_id) REFERENCES tipos_nens (id),\n\tFOREIGN KEY (tipo_sanguineo_id) REFERENCES tipos_sanguineos (id)\n);\n\nCREATE TABLE recompensas (\n\tid SERIAL PRIMARY KEY,\n\tdescricao_recompensa VARCHAR(255) NOT NULL,\n\tvalor_recompensa DECIMAL(10,2) NOT NULL,\n\tdeleted_at TIMESTAMP\n);\n\nCREATE TABLE recompensados (\n\tid SERIAL PRIMARY KEY,\n\thunter_id INT NOT NULL,\n\trecompensa_id INT NOT NULL,\n\tstatus BOOLEAN NOT NULL,\n\tdeleted_at TIMESTAMP,\n\tFOREIGN KEY (hunter_id) REFERENCES hunters (id),\n\tFOREIGN KEY (recompensa_id) REFERENCES recompensas (id)\n);\n```\n\nCreate tables to **MySQL** database:\n```\nCREATE TABLE tipos_hunters (\n\tid INT PRIMARY KEY AUTO_INCREMENT,\n\tdescricao VARCHAR(50) NOT NULL,\n\tdeleted_at TIMESTAMP\n);\n\nCREATE TABLE tipos_nens (\n\tid INT PRIMARY KEY AUTO_INCREMENT,\n\tdescricao VARCHAR(15) NOT NULL,\n\tdeleted_at TIMESTAMP\n);\n\nCREATE TABLE tipos_sanguineos (\n\tid INT PRIMARY KEY AUTO_INCREMENT,\n\tdescricao VARCHAR(3) NOT NULL,\n\tdeleted_at TIMESTAMP\n);\n\nCREATE TABLE hunters (\n\tid INT PRIMARY KEY AUTO_INCREMENT,\n\tnome_hunter VARCHAR(50) NOT NULL,\n\tidade_hunter INT NOT NULL,\n\taltura_hunter DECIMAL(3,2) NOT NULL,\n\tpeso_hunter DECIMAL(5,2) NOT NULL,\n\ttipo_hunter_id INT NOT NULL,\n\ttipo_nen_id INT NOT NULL,\n\ttipo_sanguineo_id INT NOT NULL,\n\tinicio DATE,\n\ttermino DATE,\n\tdeleted_at TIMESTAMP,\n\tFOREIGN KEY (tipo_hunter_id) REFERENCES tipos_hunters (id),\n\tFOREIGN KEY (tipo_nen_id) REFERENCES tipos_nens (id),\n\tFOREIGN KEY (tipo_sanguineo_id) REFERENCES tipos_sanguineos (id)\n);\n\nCREATE TABLE recompensas (\n\tid INT PRIMARY KEY AUTO_INCREMENT,\n\tdescricao_recompensa VARCHAR(255) NOT NULL,\n\tvalor_recompensa DECIMAL(10,2) NOT NULL,\n\tdeleted_at TIMESTAMP\n);\n\nCREATE TABLE recompensados (\n\tid INT PRIMARY KEY AUTO_INCREMENT,\n\thunter_id INT NOT NULL,\n\trecompensa_id INT NOT NULL,\n\tstatus BOOLEAN NOT NULL,\n\tdeleted_at TIMESTAMP,\n\tFOREIGN KEY (hunter_id) REFERENCES hunters (id),\n\tFOREIGN KEY (recompensa_id) REFERENCES recompensas (id)\n);\n```\n\nInsert commands:\n```\nINSERT INTO tipos_hunters (descricao) VALUES\n('Hunter Gourmet'),\n('Hunter Arqueólogo'),\n('Hunter Cientista ou Hunter Técnico'),\n('Hunter Selvagem ou Hunter Ambientalista'),\n('Hunter Musical'),\n('Hunter Treasure'),\n('Hunter Lista Negra'),\n('Hunter Mercenário'),\n('Hunter Medicinal'),\n('Hunter Hacker'),\n('Hunter Cabeça'),\n('Hunter de Informação'),\n('Hunter Jackspot'),\n('Hunter Vírus'),\n('Hunter da Juventudade e Beleza'),\n('Hunter Terrorista'),\n('Hunter de Venenos'),\n('Hunter Caçador'),\n('Hunter Paleógrafo'),\n('Hunter Perdido'),\n('Hunter Provisório'),\n('Hunter Temporário');\n\nINSERT INTO tipos_nens (descricao) VALUES\n('Reforço'),\n('Emissão'),\n('Transformação'),\n('Manipulação'),\n('Materialização'),\n('Especialização');\n\nINSERT INTO tipos_sanguineos (descricao) VALUES\n('A+'),\n('A-'),\n('B+'),\n('B-'),\n('AB+'),\n('AB-'),\n('O+'),\n('O-');\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptedsnow%2Fsb3-hxh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcryptedsnow%2Fsb3-hxh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptedsnow%2Fsb3-hxh/lists"}