{"id":48836599,"url":"https://github.com/andrei-punko/spring-boot-3-template","last_synced_at":"2026-04-14T23:36:10.379Z","repository":{"id":105078991,"uuid":"267293525","full_name":"andrei-punko/spring-boot-3-template","owner":"andrei-punko","description":"Spring Boot 3 application template","archived":false,"fork":false,"pushed_at":"2026-04-05T14:54:53.000Z","size":411,"stargazers_count":8,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-05T16:26:26.041Z","etag":null,"topics":["crud-application","rest-api","spring-boot","spring-boot-3","spring-boot-application","spring-boot-template","spring-data"],"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/andrei-punko.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-05-27T10:49:35.000Z","updated_at":"2026-04-05T14:54:57.000Z","dependencies_parsed_at":"2024-01-16T22:44:30.652Z","dependency_job_id":"b003582d-3a57-48cd-9667-3246815bd106","html_url":"https://github.com/andrei-punko/spring-boot-3-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/andrei-punko/spring-boot-3-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei-punko%2Fspring-boot-3-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei-punko%2Fspring-boot-3-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei-punko%2Fspring-boot-3-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei-punko%2Fspring-boot-3-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrei-punko","download_url":"https://codeload.github.com/andrei-punko/spring-boot-3-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei-punko%2Fspring-boot-3-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31820118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["crud-application","rest-api","spring-boot","spring-boot-3","spring-boot-application","spring-boot-template","spring-data"],"created_at":"2026-04-14T23:36:07.813Z","updated_at":"2026-04-14T23:36:10.350Z","avatar_url":"https://github.com/andrei-punko.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Template for Spring Boot 3 application\r\n\r\n![Java CI with Maven](https://github.com/andrei-punko/spring-boot-3-template/workflows/Java%20CI%20with%20Maven/badge.svg)\r\n[![Coverage](.github/badges/jacoco.svg)](https://github.com/andrei-punko/spring-boot-3-template/actions/workflows/maven.yml)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\r\n\r\nIncludes web-server on port **9080** with REST API under **`/api/v1`** (articles CRUD and paged list). OpenAPI/Swagger describes request/response examples and error shapes.\r\n\r\n## Prerequisites:\r\n\r\n- Maven 3\r\n- JDK 21\r\n\r\n## How to build:\r\n\r\n    mvn clean install\r\n\r\n#### Build Docker image with application inside:\r\n\r\n    docker build ./ -t backend-template-app\r\n\r\n## Start application using a starting script:\r\n\r\nUse [run.bat](./run.bat) script\r\n\r\n## Start application (vs in-memory DB H2) by running executable jar:\r\n\r\n    java -jar target/spring-boot-3-template-0.0.1-SNAPSHOT.jar \\\r\n     --spring.datasource.url=jdbc:h2:mem:testdb \\\r\n     --spring.datasource.username=sa \\\r\n     --spring.datasource.password=password \\\r\n     --spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect \\\r\n     --spring.datasource.driver-class-name=org.h2.Driver\r\n\r\n## Same thing but using Spring profile to determine properties:\r\n\r\n    java -jar target/spring-boot-3-template-0.0.1-SNAPSHOT.jar \\\r\n     --spring.profiles.active=dev\r\n\r\n## Start application (vs in-memory DB H2) using Maven:\r\n\r\n    mvn spring-boot:run -Dspring-boot.run.arguments=\"\\\r\n    --spring.datasource.url=jdbc:h2:mem:testdb \\\r\n    --spring.datasource.username=sa \\\r\n    --spring.datasource.password=password \\\r\n    --spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect \\\r\n    --spring.datasource.driver-class-name=org.h2.Driver\"\r\n\r\n## Same thing but using Spring profile to determine properties:\r\n\r\n    mvn spring-boot:run -Dspring-boot.run.arguments=--spring.profiles.active=dev\r\n\r\n## Start Docker containers (application \u0026 Postgres DB) using existing images:\r\n\r\n    docker-compose up\r\n\r\n## Build images, force recreate and start Docker containers (application \u0026 Postgres DB):\r\n\r\n    docker-compose up --build --force-recreate\r\n\r\n## Stop and delete containers:\r\n\r\n    docker-compose down\r\n\r\n## Link for quick check:\r\n\r\n- Articles: http://localhost:9080/api/v1/articles  \r\n- Swagger UI: http://localhost:9080/swagger-ui.html  \r\n- OpenAPI JSON: http://localhost:9080/v3/api-docs  \r\n\r\n## Useful CURL commands\r\n\r\n### New article addition:\r\n\r\n```bash\r\ncurl -i -H \"Accept: application/json\" -H \"Content-Type: application/json\" -d '{ \"title\": \"Some tittle\", \"text\": \"Some text\", \"author\": \"Pushkin\" }' -X POST http://localhost:9080/api/v1/articles\r\n```\r\n\r\n### Get existing article:\r\n\r\n```bash\r\ncurl -i http://localhost:9080/api/v1/articles/1\r\n```\r\n\r\n### Update existing article:\r\n\r\n```bash\r\ncurl -i -H \"Accept: application/json\" -H \"Content-Type: application/json\" -d '{ \"title\": \"Another tittle\" }' -X PATCH http://localhost:9080/api/v1/articles/2\r\n```\r\n\r\n### Get a list of articles with pagination support:\r\n\r\n```bash\r\ncurl -i 'http://localhost:9080/api/v1/articles?size=2\u0026page=4\u0026sort=author,DESC'\r\n```\r\n\r\n### Deletion of article:\r\n\r\n```bash\r\ncurl -i -X DELETE http://localhost:9080/api/v1/articles/1\r\n```\r\n\r\n## Configuration and environment variables\r\n\r\n| Variable | Purpose |\r\n|----------|---------|\r\n| `DB_URL` | JDBC URL (required when using Postgres) |\r\n| `DB_USER` | Database user |\r\n| `DB_PASSWORD` | Database password |\r\n| `logging.file.path` | Log directory (default `logs`; see `logback-spring.xml`) |\r\n\r\nSpring profile **`dev`** selects in-memory **H2** (`application-dev.properties`). Default `application.properties` expects Postgres-related variables.\r\n\r\n## Deployment\r\n\r\n1. **Runnable JAR:** `mvn clean package`, then run `java -jar target/spring-boot-3-template-0.0.1-SNAPSHOT.jar` with the right profile and `DB_*` (or `--spring.profiles.active=dev` for H2).\r\n2. **Docker image:** `docker build ./ -t backend-template-app` (the build expects `target/*.jar` to exist—run `mvn package` first).\r\n3. **Docker Compose:** `docker-compose up --build` brings up Postgres and the service with healthchecks and optional `.env`.\r\n\r\n## Security (production)\r\n\r\nREST APIs ship **without Spring Security**—suitable for local development only. Before a public deployment, add authentication (e.g. Spring Security or an API gateway), keep secrets in environment variables (see `.env.example` for Compose), and restrict Actuator in production (`RECOMMENDATIONS.md`).\r\n\r\n## Related project\r\n\r\nSame project but with usage of Spring Boot 2 available [here](https://github.com/andrei-punko/spring-boot-2-template)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrei-punko%2Fspring-boot-3-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrei-punko%2Fspring-boot-3-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrei-punko%2Fspring-boot-3-template/lists"}