Skip to content

Commit

Permalink
Merge branch 'release/0.0.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnymillergh committed Feb 4, 2022
2 parents 230ca4c + ef12812 commit 84a03e2
Show file tree
Hide file tree
Showing 295 changed files with 3,185 additions and 2,665 deletions.
Binary file modified .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# [0.0.8](https://github.com/johnnymillergh/muscle-and-fitness-server/compare/0.0.7...0.0.8) (2022-02-04)


### Performance Improvements

* **$api-gateway:** DDD modularized microservice ([ee45dab](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/ee45dab9e3e0f236db27cccb295ecce7cd041cc4))
* **$auth-center:** DDD modularized microservice ([f883d81](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/f883d8127a41546976402187f3ec635b18e9f2c7))
* **$Consul:** move more common configurations to `application` config ([c207cc5](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/c207cc5aa4851589f2e708b08b77af5fd2511567))
* **$Consul:** reduce duplicate application configuration YAML files ([a9c3237](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/a9c3237cfa7943d326ce2de2a29d3211619a3e86))
* **$Consul:** update Consul to 1.11.2 ([92abee4](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/92abee45e79d6a2897759124cebc4ffb8946afef))
* **$ELK:** update version to 7.17.0 ([6cfafd4](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/6cfafd47f6c7d4bb2efffde44b26b717dd862ff1))
* **$Logback:** universal logback configuration in starter ([91c0fe5](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/91c0fe557ed3bb72f578f5c5a0a113e7d74c54af))
* **$maf-mis:** DDD modularized microservice ([4a827f4](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/4a827f4eac11e847fa749fc2d08662f82fd1a5aa))
* **$OpenAPI:** disable OpenAPI in `stage` and `production` ([b03377d](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/b03377d1c3d1040a4ecfdb254685ba64058bc43f))
* **$OpenFeign:** add support for Spring Cloud CircuitBreaker Resilience4J ([9568372](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/9568372a6381f8c18fd796622cb4996e81d512a0))
* **$oss-center:** DDD modularized microservice ([3f1b72b](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/3f1b72b3b857e03401774ad910731568152ec72f))
* **$POM:** remove deprecated dependency `spring-cloud-starter-bootstrap` ([772cfbb](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/772cfbb558d27ecbd6ea0c096695d2168d288b07))
* **$reactive-starter:** remove deprecated dependency `spring-cloud-starter-bootstrap` ([ba5d823](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/ba5d8237c1d4a798984d97e10e19fb56f7aa04da))
* **$spring-boot-admin:** DDD modularized microservice ([f30a420](https://github.com/johnnymillergh/muscle-and-fitness-server/commit/f30a42003e3f296c5c39fe398fbcd0407abc332c))


### BREAKING CHANGES

* **$reactive-starter:** `spring-cloud-starter-bootstrap` has been removed
* **$Logback:** delete customized field `applicationName`



# [0.0.7](https://github.com/johnnymillergh/muscle-and-fitness-server/compare/0.0.6...0.0.7) (2022-02-02)


Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@

# Muscle and Fitness Server

**Muscle and Fitness Server** a Spring Cloud microservice based, back-end server for managing data of muscle and fitness.
**Muscle and Fitness Server** a Spring Cloud microservice based, DDD structured, back-end server for managing data of muscle and fitness.

[Official Docker Image](https://hub.docker.com/u/ijohnnymiller)

## Features

Here is the highlights of **Muscle and Fitness Server**:

1. Each microservice is organized by [Domain Driven Design](https://en.wikipedia.org/wiki/Domain-driven_design) (DDD) structure.

1. Inherited from the most modern and newest Spring frameworks:

`org.springframework.boot:spring-boot-starter-parent` - [![Spring Boot](https://maven-badges.herokuapp.com/maven-central/org.springframework.boot/spring-boot-starter-parent/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.springframework.boot/spring-boot-starter-parent/)
Expand Down Expand Up @@ -76,7 +78,11 @@ Here is the highlights of **Muscle and Fitness Server**:

21. [Startup and deployment statistics](https://github.com/johnnymillergh/muscle-and-fitness-server/blob/master/spring-cloud-starter/src/main/java/com/jmsoftware/maf/springcloudstarter/helper/SpringBootStartupHelper.java).

22. Customized startup banner.
23. Customized startup banner.

## Architecture

![architectur](the-project-structure-of-ddd.drawio.png)

## Usage

Expand Down
22 changes: 22 additions & 0 deletions api-gateway/api-gateway-biz/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<!-- Sub-module Basics -->
<artifactId>api-gateway-biz</artifactId>
<name>Muscle and Fitness Server :: API Gateway - Biz</name>
<description>API Gateway for Muscle and Fitness microservices.</description>
<parent>
<groupId>com.jmsoftware.maf</groupId>
<artifactId>api-gateway</artifactId>
<version>0.0.8</version>
</parent>

<dependencies>
<dependency>
<groupId>com.jmsoftware.maf</groupId>
<artifactId>api-gateway-domain</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package com.jmsoftware.maf.apigateway;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.jmsoftware.maf.apigateway.security.impl;

import cn.hutool.core.util.StrUtil;
import com.jmsoftware.maf.apigateway.remoteapi.AuthCenterRemoteApi;
import com.jmsoftware.maf.apigateway.remote.AuthCenterRemoteApi;
import com.jmsoftware.maf.common.domain.authcenter.security.UserPrincipal;
import com.jmsoftware.maf.common.exception.BizException;
import com.jmsoftware.maf.common.exception.SecurityException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.jmsoftware.maf.apigateway.security.impl;

import cn.hutool.core.util.StrUtil;
import com.jmsoftware.maf.apigateway.remoteapi.AuthCenterRemoteApi;
import com.jmsoftware.maf.apigateway.remote.AuthCenterRemoteApi;
import com.jmsoftware.maf.common.domain.authcenter.security.UserPrincipal;
import com.jmsoftware.maf.common.exception.SecurityException;
import com.jmsoftware.maf.reactivespringcloudstarter.property.JwtConfigurationProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import cn.hutool.core.util.StrUtil;
import com.google.common.collect.Lists;
import com.jmsoftware.maf.apigateway.remoteapi.AuthCenterRemoteApi;
import com.jmsoftware.maf.apigateway.remote.AuthCenterRemoteApi;
import com.jmsoftware.maf.common.constant.MafHttpHeader;
import com.jmsoftware.maf.common.domain.authcenter.permission.GetPermissionListByRoleIdListPayload;
import com.jmsoftware.maf.common.domain.authcenter.permission.GetPermissionListByRoleIdListResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package com.jmsoftware.maf.apigateway.security;
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package com.jmsoftware.maf.apigateway;
183 changes: 183 additions & 0 deletions api-gateway/api-gateway-bootstrap/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<!-- Sub-module Basics -->
<artifactId>api-gateway-bootstrap</artifactId>
<name>Muscle and Fitness Server :: API Gateway - Bootstrap</name>
<description>API Gateway for Muscle and Fitness microservices.</description>
<parent>
<groupId>com.jmsoftware.maf</groupId>
<artifactId>api-gateway</artifactId>
<version>0.0.8</version>
</parent>

<!-- Build Settings -->
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>build-info</id>
<phase>compile</phase>
<goals>
<goal>build-info</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>${maven-pmd-plugin.version}</version>
<configuration>
<sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
<targetJdk>${java.version}</targetJdk>
<printFailingErrors>true</printFailingErrors>
<rulesets>
<ruleset>rulesets/java/ali-comment.xml</ruleset>
<ruleset>rulesets/java/ali-concurrent.xml</ruleset>
<ruleset>rulesets/java/ali-constant.xml</ruleset>
<ruleset>rulesets/java/ali-exception.xml</ruleset>
<ruleset>rulesets/java/ali-flowcontrol.xml</ruleset>
<ruleset>rulesets/java/ali-naming.xml</ruleset>
<ruleset>rulesets/java/ali-oop.xml</ruleset>
<ruleset>rulesets/java/ali-orm.xml</ruleset>
<ruleset>rulesets/java/ali-other.xml</ruleset>
<ruleset>rulesets/java/ali-set.xml</ruleset>
</rulesets>
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.alibaba.p3c</groupId>
<artifactId>p3c-pmd</artifactId>
<version>${p3c-pmd.version}</version>
</dependency>
</dependencies>
</plugin>

<!-- https://github.com/GoogleContainerTools/jib/blob/master/jib-maven-plugin/README.md -->
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>${jib-maven-plugin.version}</version>
<dependencies>
<dependency>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-spring-boot-extension-maven</artifactId>
<version>${jib-spring-boot-extension-maven.version}</version>
</dependency>
</dependencies>
<executions>
<!-- Bind `jib:dockerBuild` to a Maven lifecycle `verify`. Jib will build your image directly to a Docker daemon.
<execution>
<id>buildDockerImagePhase</id>
<phase>verify</phase>
<goals>
<goal>dockerBuild</goal>
</goals>
</execution> -->
<!-- Bind `jib:build` to a Maven lifecycle `install`. Jib will build and push image to image registry. -->
<execution>
<id>buildAndPushDockerImagePhase</id>
<phase>install</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<from>
<!-- Don't use alpine or slim version, https://hub.docker.com/r/adoptopenjdk/openjdk11/tags?page=1&ordering=last_updated&name=jre-11 -->
<image>adoptopenjdk/openjdk11:${adoptopenjdk11.tag}</image>
</from>
<to>
<image>docker.io/ijohnnymiller/${project.baseArtifactId}.${project.parent.artifactId}</image>
<tags>
<tag>${git.commit.id.abbrev}-${project.version}</tag>
</tags>
</to>
<container>
<!-- The root directory on the container where the app's contents are placed. -->
<appRoot>/${project.parent.artifactId}</appRoot>
<jvmFlags>
<jvmFlag>-Dfile.encoding=${project.build.sourceEncoding}</jvmFlag>
</jvmFlags>
<ports>
<port>${api-gateway.port}</port>
</ports>
<creationTime>USE_CURRENT_TIMESTAMP</creationTime>
</container>
<pluginExtensions>
<pluginExtension>
<implementation>
com.google.cloud.tools.jib.maven.extension.springboot.JibSpringBootExtension
</implementation>
<properties>
<excludeDevtools>true</excludeDevtools>
</properties>
</pluginExtension>
</pluginExtensions>
</configuration>
</plugin>

<!-- https://github.com/git-commit-id/git-commit-id-maven-plugin -->
<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
<version>5.0.0</version>
<executions>
<execution>
<id>get-the-git-info</id>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
</includeOnlyProperties>
<commitIdGenerationMode>full</commitIdGenerationMode>
</configuration>
</plugin>
</plugins>
</build>

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.3</version>
</plugin>
</plugins>
</reporting>

<dependencies>
<dependency>
<groupId>com.jmsoftware.maf</groupId>
<artifactId>api-gateway-web</artifactId>
</dependency>
<dependency>
<groupId>com.jmsoftware.maf</groupId>
<artifactId>api-gateway-message</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@Slf4j
@EnableDiscoveryClient
@SpringBootApplication
@SuppressWarnings("scwjava_Createprivateconstructorforutilityclassallfieldsmethodsarestatic")
public class ApiGatewayApplication {
public static void main(String[] args) {
val stopWatch = new StopWatch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,28 @@ server:
context-path:

spring:
application:
name: @project.parent.artifactId@
profiles:
active: @environment@
mvc:
throw-exception-if-no-handler-found: true
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: Asia/Hong_Kong
config:
import: consul:${spring.cloud.consul.host}:${spring.cloud.consul.port}
cloud:
# https://docs.spring.io/spring-cloud-consul/docs/current/reference/html/index.html#spring-cloud-consul-config
consul:
host: "should-be-passed-by-java-opts"
port: 8500
config:
# `default-context` should not be modified, keeps "application" for common configuration.
# Properties in the config/application folder are applicable to all applications using consul for configuration.
profile-separator: "::"
format: YAML
data-key: "data"
watch:
enabled: true
delay: 1000
prefixes:
- config
discovery:
register: true
instance-id: ${spring.application.name}-${spring.cloud.client.hostname}-${vcap.application.instance_id:${spring.application.instance_id:${random.value}}}
Expand All @@ -35,30 +48,9 @@ spring:
'[/**]':
allowedOrigins: "*"
allowedMethods: "*"
redis:
database: 0
timeout: 10000ms
client-type: LETTUCE
lettuce:
pool:
max-active: 20
max-idle: 10
max-wait: -1ms
min-idle: 0

management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS

logging:
config: classpath:logback-configuration/logback-${spring.profiles.active}.xml
level:
org.springframework.cloud.client.loadbalancer.reactive: DEBUG

maf:
project-properties:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
**/
@Slf4j
@SpringBootTest
public class AuthorizationTests {
class AuthorizationTests {
@Test
void antPathMatcherTests() {
val antPathMatcher = new AntPathMatcher();
Expand Down
Loading

1 comment on commit 84a03e2

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.