{"id":18290622,"url":"https://github.com/shuai132/springbootdemo","last_synced_at":"2025-04-09T07:29:04.731Z","repository":{"id":124278058,"uuid":"160192694","full_name":"shuai132/SpringBootDemo","owner":"shuai132","description":"SpringBoot RESTful API Demo with Gradle and Docker","archived":false,"fork":false,"pushed_at":"2019-07-09T00:22:10.000Z","size":79,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T01:44:04.584Z","etag":null,"topics":["docker","java-docker-optimization","restful-api","spring-boot","spring-boot-demo"],"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/shuai132.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":"2018-12-03T13:10:04.000Z","updated_at":"2023-03-26T14:55:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"4beac015-3d5d-47a6-a074-0312e6608a63","html_url":"https://github.com/shuai132/SpringBootDemo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuai132%2FSpringBootDemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuai132%2FSpringBootDemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuai132%2FSpringBootDemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuai132%2FSpringBootDemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shuai132","download_url":"https://codeload.github.com/shuai132/SpringBootDemo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247997819,"owners_count":21030686,"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-docker-optimization","restful-api","spring-boot","spring-boot-demo"],"created_at":"2024-11-05T14:11:40.741Z","updated_at":"2025-04-09T07:29:04.709Z","avatar_url":"https://github.com/shuai132.png","language":"Java","readme":"SpringBootDemo\n====\n\n[![Build Status](https://www.travis-ci.org/shuai132/SpringBootDemo.svg?branch=master)](https://www.travis-ci.org/shuai132/SpringBootDemo)\n\nSpringBoot RESTful API的例子，组织工程架构，作为基础工程使用。\n\n## 主要技术方案\n* SpringBoot 2.x\n* MySQL 8.0\n* JPA\n* Swagger\n\n## 开发构建环境\n* OpenJDK 11\n* Gradle 5.0\n* Docker\n\n## 开发环境配置\n首先创建docker环境变量:\n```bash\ncp .example.env .env\n```\n### 1. 配置数据库和Redis\n```bash\ndocker-compose up -d mysql redis\n```\n### 2. IDE插件\n* IDE需配置Lombok相关插件，并开启Java注解处理器(Enable annotation processors)。\n### 3. 运行\n使用IDE或直接执行:\n```bash\n./gradlew bootRun\n```\n\n### 3. 查看API\n* \u003chttp://localhost:8080/swagger-ui.html\u003e\n* \u003chttp://localhost:8080/api-docs\u003e\n\n## 使用Docker部署\n为了充分利用gradle缓存，分为编译和构建镜像两步。\n### 1. 编译\n方式一：使用Docker\n```bash\ndocker-compose -f docker-compose-gradle.yml up\n```\n方式二：本地有JDK11环境\n```bash\n./gradlew assemble\n```\n### 2. 构建运行\n```bash\ndocker-compose up -d --build\n```\n映射的端口：API:8080，MySQL:3406，Redis:6479。\n\n## 默认配置说明\n在项目同级目录下会创建\"SpringBootDemo_DATA\"文件夹，用于存放日志和相关docker宿主目录绑定。\n\n## 其他\n* 与项目名称有关的配置都以\"SpringBootDemo\"开头，所以修改项目名称时，替换成自己想要的名称即可。\n* IDE需配置Lombok相关插件，并开启Java注解处理器(Enable annotation processors)。\n\n## Links\n* [官方API](https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/api/)\n* [官方文档](https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/reference/htmlsingle/)\n* [官方文档 PDF](https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/reference/pdf/spring-boot-reference.pdf)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuai132%2Fspringbootdemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshuai132%2Fspringbootdemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuai132%2Fspringbootdemo/lists"}