{"id":20042885,"url":"https://github.com/juarce/java-api-template","last_synced_at":"2025-09-20T09:31:20.295Z","repository":{"id":200236693,"uuid":"677128105","full_name":"JuArce/java-api-template","owner":"JuArce","description":"Template for a Java API, using Spring Boot, Spring Data JPA, Spring Security, and JWT.","archived":false,"fork":false,"pushed_at":"2024-01-16T19:22:39.000Z","size":83,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T05:31:49.482Z","etag":null,"topics":["api-rest","java","spring","spring-boot","spring-security"],"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/JuArce.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":"2023-08-10T20:06:42.000Z","updated_at":"2024-05-31T21:20:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"bbe31326-298b-45da-b602-5250de80705a","html_url":"https://github.com/JuArce/java-api-template","commit_stats":null,"previous_names":["juarce/java-api-template"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/JuArce/java-api-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuArce%2Fjava-api-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuArce%2Fjava-api-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuArce%2Fjava-api-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuArce%2Fjava-api-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JuArce","download_url":"https://codeload.github.com/JuArce/java-api-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuArce%2Fjava-api-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276077054,"owners_count":25581287,"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-09-20T02:00:10.207Z","response_time":63,"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":["api-rest","java","spring","spring-boot","spring-security"],"created_at":"2024-11-13T10:54:04.859Z","updated_at":"2025-09-20T09:31:19.976Z","avatar_url":"https://github.com/JuArce.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java Api Template ☕\nThis is a template for a Java API, using Spring Boot, Spring Data JPA, Spring Security, and JWT.\n\nThe API is a simple CRUD for a User entity.\n\n## Next Steps 🚀\n- [ ] Add unit tests in the service layer\n- [x] Integrate Spring Security and JWT authentication\n- [x] Implement user roles\n- [x] Implement ACL\n- [ ] Add integration tests\n- [ ] Add Dockerfile\n- [ ] Add Swagger documentation\n\n## Requirements 📋\n- Java 21 :coffee:\n- Maven :wrench:\n- Docker :whale:\n- Postgres :elephant:\n\n# Setup 🔨\n```make install``` or\n```mvn clean install```\n\n## Database Setup 💾\n### Create Database Container 🐋\nThis API uses a postgres database. To set up the database, run the following command:\n\n```make create_db container=\u003ccontainer\u003e user=\u003cuser\u003e password=\u003cpwd\u003e database=\u003cdb_name\u003e```\n\n    Where:\n    - container:    the name of the docker container. If not provided, the default value is 'postgres'\n    - user:         the user to create. If not provided, the default value is 'user'\n    - password:     the password for the user. If not provided, the default value is '123123123'\n    - database:     the name of the database to create. If not provided, the default value is 'java_api_template'\n### Run Database Container 🏹\nIf you want to run or re-run the database in a different container, you can use the following command:\n\n```make run_db container=\u003ccontainer\u003e```\n\n    Where:\n    - container:    the name of the docker container. If not provided, the default value is 'postgres'\n### Stop Database Container 🛑\nIf you want to stop the database container, you can use the following command:\n\n```make stop_db container=\u003ccontainer\u003e```\n\n    Where:\n    - container:    the name of the docker container. If not provided, the default value is 'postgres'\n\nTests will run using an in-memory HSQL database, so there is no need to create a database for tests.\n\n## Security Configuration 🔒\nThis API uses Basic and JWT authentication. \n\nTo configure the security, you need to create a file named `jwk_set.json` in the `resources` folder.\nThis file must contain a JWK Set, with at least one key.\n\nYou can use the online [JSON Web Key generator](https://mkjwk.org/) to generate a JWK Set: .\nOr using the [Command line JSON Web Key (JWK) generator](https://connect2id.com/products/nimbus-jose-jwt/generator).\n\nThe Jwk set must be in the following format:\n```json\n{\n    \"keys\": [\n        {\n            \"kty\": \"EC\",\n            \"d\": \"HSveA5XkSWeaJeg79AsXlghcfFAqbBNG1Ep51QKptOY\",\n            \"crv\": \"P-256\",\n            \"x\": \"Dmh5T6s69NLhGKv1nE_-gl36h9s6hvGttn5m91G9jnY\",\n            \"y\": \"l8C-AGgQDGR3MpRGKFQkch0GPEYliFAHTO6osrMQwZE\",\n            \"alg\": \"ES256\"\n        }\n    ]\n}\n```\n⚠️ Make sure to do not use this key in production. It is only an example.\n\n# Run 🏃\n```make run``` \n\n\n```mvn spring-boot:run -pl webapp```\n\n⚠️ `make run` will run the database container if it is not running.\n\n# Test ✅\n```make test```\n\n```mvn test```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuarce%2Fjava-api-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuarce%2Fjava-api-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuarce%2Fjava-api-template/lists"}