ms-spring-ddd-examples
Unified Domain-driven Layered Architecture for MicroService Apps,试图探索一套切实可行的应用架构规范,可以复制、可以理解、可以落地、可以控制复杂性的指导和约束。
For more information on how to this works with other frontends/backends, head over to the RealWorld repo.
WIP,项目正在逐步开放中,对于软件架构与领域驱动设计请参考Software Architecture Series 软件架构设计系列文章,关于 Spring 相关学习参考 Spring Series。
Usage
IDE
安装 google-java-format 和 lombok 插件;在配置中 Editor | Code Style | scheme 中导入 conf/intellij-java-google-style.xml
风格配置。
Database Migration
使用 flyway 进行数据库迁移,迁移脚本默认放在 infra/src/main/resources/db/migration
下,在 infra/build.gradle
已经默认配置了测试数据库。
./gradlew flywayInfo
./gradlew :realworld:infra:flywayInfo
可以通过 flyway.configFiles
来替换配置文件:
./gradlew -Pflyway.configFiles=/path/to/flyway.conf flywayInfo
flyway 依赖在 com.udma.core.infra 子项目中添加,如果配置文件使用相对路径,它相对的将是该子项目根目录。如在根目录中执行命令,要使用 conf/flyway-local.conf
配置:
./gradlew -Pflyway.configFiles=../conf/flyway-local.conf flywayInfo
数据库迁移脚本的命名见 https://flywaydb.org/documentation/migrations#naming。我们正常使用的就是 Versioned Migrations。
Deployment
此部署指部署 Web 应用。
- 本地部署
cp conf/env.tpl .dev.env
# 设定 .dev.env 中的环境变量
# 构建、推送镜像
(source .dev.env && ./scripts/docker/build-locally.sh)
# 部署
(source .dev.env && ./scripts/deploy-locally.sh)
- 正式版本部署
git checkout master
git merge dev
# 修改 .prod.env 版本如 1.0
(source .prod.env && ./scripts/docker/build-locally.sh && ./scripts/deploy-locally.sh)
# 部署成功后,推送对应 tag
git tag 1.0 -m
git push --tags
About
Roadmap
See the open issues for a list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE
for more information.
Acknowledgements
-
Awesome-Lists:
📚 Guide to Galaxy, curated, worthy and up-to-date links/reading list for ITCS-Coding/Algorithm/SoftwareArchitecture/AI.💫 ITCS-编程/算法/软件架构/人工智能等领域的文章/书籍/资料/项目链接精选。 -
Awesome-CS-Books:
📚 Awesome CS Books/Series(.pdf by git lfs) Warehouse for Geeks, ProgrammingLanguage, SoftwareEngineering, Web, AI, ServerSideApplication, Infrastructure, FE etc.💫 优秀计算机科学与技术领域相关的书籍归档。 -
Hutool #Project#: A set of com.udma.core.tools that keep Java sweet.
-
freedom: freedom 是一个基于六边形架构的框架,可以支撑充血的领域模型范式。
Copyright & More | 延伸阅读
笔者所有文章遵循知识共享 署名 - 非商业性使用 - 禁止演绎 4.0 国际许可协议,欢迎转载,尊重版权。您还可以前往 NGTE Books 主页浏览包含知识体系、编程语言、软件工程、模式与架构、Web 与大前端、服务端开发实践与工程架构、分布式基础架构、人工智能与深度学习、产品运营与创业等多类目的书籍列表: