Skip to content

Commit bb0a977

Browse files
author
jianggang
authored
refactor: module split (#36)
refactor: module split
1 parent bc65130 commit bb0a977

File tree

316 files changed

+2807
-1471
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

316 files changed

+2807
-1471
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ RUN apk --no-cache add curl
55

66
ENV JVM_ARGS=${JVM_ARGS}
77

8-
COPY target/feature-probe-api-1.1.0.jar feature-probe-api-1.1.0.jar
8+
COPY feature-probe-admin/target/feature-probe-admin-1.0.0.jar feature-probe-admin-1.0.0.jar
99

1010

1111

12-
ENTRYPOINT java ${JVM_ARGS} -jar feature-probe-api-1.1.0.jar
12+
ENTRYPOINT java ${JVM_ARGS} -jar feature-probe-admin-1.0.0.jar

README.md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,27 @@
44
[![Docker Pulls](https://img.shields.io/docker/pulls/featureprobe/api)](https://hub.docker.com/u/featureprobe)
55
[![Apache-2.0 license](https://img.shields.io/github/license/FeatureProbe/FeatureProbe)](https://github.com/FeatureProbe/FeatureProbe/blob/main/LICENSE)
66

7-
FeatureProbe supports an extensive API so that other services or clients can use it programmatically.
8-
This API is exposed using the standard REST architecture in a secure, uniform, stateless manner.
7+
FeatureProbe supports an extensive API so that other services or clients can use it programmatically.
8+
This API is exposed using the standard REST architecture in a secure, uniform, stateless manner.
99

1010
FeatureProbe API is one of the key components of the whole system. You must install it to set up Feature Probe services.
11-
We provide a docker composer configuration as an example to make it easier to set up all the services together including API;
11+
We provide a docker composer configuration as an example to make it easier to set up all the services together including
12+
API;
1213
or you can choose to run API as a docker container and boot other services one by one.
1314

1415
## [中文文档](https://docs.featureprobe.io/zh-CN/)
1516

1617
## Getting Started
1718

18-
1919
### Using Docker Composer to Install Main Services
2020

21-
We recommend booting up UI along with other core components by using a docker composer file.
21+
We recommend booting up UI along with other core components by using a docker composer file.
2222

2323
Here is an example to help to boot up FeatureProbe Server, API, UI and db with a simple docker-compose up command.
2424
Check it out at [FeatureProbe Official Compose File](https://github.com/FeatureProbe/featureprobe).
2525

2626
Or you can simply run below command to clone and boot up the Docker composer components.
27+
2728
``` bash
2829
git clone https://github.com/FeatureProbe/featureprobe.git
2930
cd featureprobe
@@ -33,65 +34,70 @@ docker compose up
3334
### Installing API Independently with a Docker Image
3435

3536
You can alternatively install and run API with a Docker image. To run, binding the exposed port 4007 to the host, use:
37+
3638
```
3739
$ docker run -d -p 4007:4007 --name fp-api featureprobe/api
3840
```
41+
3942
Remember to add the environment variables for connecting an RDS database, like
43+
4044
```angular2svg
4145
spring.datasource.jdbc-url=jdbc:mysql://database:13306/feature_probe?useSSL=false&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&rewriteBatchedStatements=TRUE&useSSL=false&serverTimezone=Asia/Shanghai
4246
```
4347

4448
### Building jar Package and Running it on a VM or Server
4549

4650
You can also choose to build the project and generate the package use Maven.
51+
4752
```
4853
git clone https://github.com/FeatureProbe/feature-probe-api.git
4954
mvn clean package
5055
```
51-
If everything checks out, the jar package should be available in the target folder.
56+
57+
If everything checks out, the jar package should be available in the target folder.
5258
You can deploy it as you wish to.
59+
5360
```
5461
java -jar feature-probe-api-1.0-SNAPSHOT.jar
5562
```
5663

57-
5864
### Building your own Image and Installing
59-
In most cases, the settings from the environment are used to populate the application configuration on the container startup.
60-
However, in some cases you may wish to customise the settings in ways that are not supported by the environment variables above.
61-
There are two main ways of doing this; modify our repository to your own image, build a new image from the existing one.
65+
66+
In most cases, the settings from the environment are used to populate the application configuration on the container
67+
startup.
68+
However, in some cases you may wish to customise the settings in ways that are not supported by the environment
69+
variables above.
70+
There are two main ways of doing this; modify our repository to your own image, build a new image from the existing one.
6271
We will briefly outline these methods here, but in practice how you do this will depend on your needs.
6372

6473
#### Building your own image
74+
6575
* Clone the FeatureProbe API repository at https://github.com/FeatureProbe/feature-probe-api.git
6676
* Modify codes as you wish.
6777
* Build the new image with e.g: docker build --tag my-featureprobe-api
6878
* Optionally push to a registry, and deploy.
6979

7080
#### Build a new image from the existing one
81+
7182
* Create a new Dockerfile, which starts with the line e.g: FROM featureprobe/api:latest.
7283
* Add some commands.
7384
* Build, push and deploy the new image as above.
7485

75-
76-
77-
7886
## API Endpoints
7987

80-
Checkout the API endpoints at `http://localhost:4009/api-docs` after you boot up the service locally with the
81-
Docker Composer file.
88+
Checkout the API endpoints at `http://localhost:4009/api-docs` after you boot up the service locally with the
89+
Docker Composer file.
8290
You may need to modify the host address and port if you deploy the services in a different way.
8391

84-
85-
8692
## Contributing
87-
We are working on continue evolving FeatureProbe core, making it flexible and easier to use.
88-
Development of FeatureProbe happens in the open on GitHub, and we are grateful to the
93+
94+
We are working on continue evolving FeatureProbe core, making it flexible and easier to use.
95+
Development of FeatureProbe happens in the open on GitHub, and we are grateful to the
8996
community for contributing bugfixes and improvements.
9097

91-
Please read [CONTRIBUTING](https://github.com/FeatureProbe/featureprobe/blob/master/CONTRIBUTING.md)
98+
Please read [CONTRIBUTING](https://github.com/FeatureProbe/featureprobe/blob/master/CONTRIBUTING.md)
9299
for details on our code of conduct, and the process for taking part in improving FeatureProbe.
93100

94-
95101
## License
96102

97103
This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.

checkstyle.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
44
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
55

6-
<module name = "Checker">
6+
<module name="Checker">
77
<property name="charset" value="UTF-8"/>
88

99
<property name="severity" value="error"/>

feature-probe-admin/pom.xml

Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>feature-probe-api</artifactId>
7+
<groupId>com.featureprobe</groupId>
8+
<version>1.0.0</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>feature-probe-admin</artifactId>
13+
<version>1.0.0</version>
14+
15+
<properties>
16+
<maven.compiler.source>1.8</maven.compiler.source>
17+
<maven.compiler.target>1.8</maven.compiler.target>
18+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
19+
</properties>
20+
21+
<dependencies>
22+
<dependency>
23+
<groupId>com.featureprobe</groupId>
24+
<artifactId>feature-probe-base</artifactId>
25+
</dependency>
26+
<dependency>
27+
<groupId>com.featureprobe</groupId>
28+
<artifactId>feature-probe-dao</artifactId>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.springframework.boot</groupId>
32+
<artifactId>spring-boot-starter-web</artifactId>
33+
</dependency>
34+
<dependency>
35+
<groupId>org.springframework.boot</groupId>
36+
<artifactId>spring-boot-starter-actuator</artifactId>
37+
</dependency>
38+
<dependency>
39+
<groupId>org.springframework.boot</groupId>
40+
<artifactId>spring-boot-starter-aop</artifactId>
41+
</dependency>
42+
<dependency>
43+
<groupId>org.springframework.boot</groupId>
44+
<artifactId>spring-boot-devtools</artifactId>
45+
</dependency>
46+
<dependency>
47+
<groupId>org.springframework.boot</groupId>
48+
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
49+
</dependency>
50+
<dependency>
51+
<groupId>org.springframework.boot</groupId>
52+
<artifactId>spring-boot-starter-security</artifactId>
53+
</dependency>
54+
<dependency>
55+
<groupId>org.springdoc</groupId>
56+
<artifactId>springdoc-openapi-ui</artifactId>
57+
</dependency>
58+
<dependency>
59+
<groupId>com.auth0</groupId>
60+
<artifactId>java-jwt</artifactId>
61+
</dependency>
62+
<dependency>
63+
<groupId>org.flywaydb</groupId>
64+
<artifactId>flyway-core</artifactId>
65+
</dependency>
66+
</dependencies>
67+
68+
<build>
69+
<pluginManagement>
70+
<plugins>
71+
<plugin>
72+
<groupId>org.apache.maven.plugins</groupId>
73+
<artifactId>maven-compiler-plugin</artifactId>
74+
<version>3.8.1</version>
75+
<configuration>
76+
<source>1.8</source>
77+
<target>1.8</target>
78+
<annotationProcessorPaths>
79+
<path>
80+
<groupId>org.mapstruct</groupId>
81+
<artifactId>mapstruct-processor</artifactId>
82+
<version>${mapstruct.version}</version>
83+
</path>
84+
<path>
85+
<groupId>org.projectlombok</groupId>
86+
<artifactId>lombok</artifactId>
87+
<version>${lombok.version}</version>
88+
</path>
89+
<path>
90+
<groupId>org.projectlombok</groupId>
91+
<artifactId>lombok-mapstruct-binding</artifactId>
92+
<version>0.2.0</version>
93+
</path>
94+
</annotationProcessorPaths>
95+
</configuration>
96+
</plugin>
97+
<plugin>
98+
<groupId>org.apache.maven.plugins</groupId>
99+
<artifactId>maven-checkstyle-plugin</artifactId>
100+
<version>3.1.2</version>
101+
<dependencies>
102+
<dependency>
103+
<groupId>com.puppycrawl.tools</groupId>
104+
<artifactId>checkstyle</artifactId>
105+
<version>8.29</version>
106+
</dependency>
107+
</dependencies>
108+
<configuration>
109+
<configLocation>checkstyle.xml</configLocation>
110+
<encoding>UTF-8</encoding>
111+
<consoleOutput>true</consoleOutput>
112+
<failsOnError>true</failsOnError>
113+
<linkXRef>false</linkXRef>
114+
</configuration>
115+
<executions>
116+
<execution>
117+
<id>validate</id>
118+
<phase>validate</phase>
119+
<goals>
120+
<goal>check</goal>
121+
</goals>
122+
</execution>
123+
</executions>
124+
</plugin>
125+
</plugins>
126+
</pluginManagement>
127+
<plugins>
128+
<plugin>
129+
<groupId>org.springframework.boot</groupId>
130+
<artifactId>spring-boot-maven-plugin</artifactId>
131+
</plugin>
132+
<plugin>
133+
<groupId>org.apache.maven.plugins</groupId>
134+
<artifactId>maven-checkstyle-plugin</artifactId>
135+
</plugin>
136+
137+
<plugin>
138+
<groupId>org.codehaus.gmavenplus</groupId>
139+
<artifactId>gmavenplus-plugin</artifactId>
140+
<version>1.6.3</version>
141+
<executions>
142+
<execution>
143+
<goals>
144+
<goal>compileTests</goal>
145+
</goals>
146+
</execution>
147+
</executions>
148+
</plugin>
149+
<plugin>
150+
<groupId>org.apache.maven.plugins</groupId>
151+
<artifactId>maven-compiler-plugin</artifactId>
152+
<configuration>
153+
<source>1.8</source>
154+
<target>1.8</target>
155+
</configuration>
156+
</plugin>
157+
158+
<plugin>
159+
<groupId>org.apache.maven.plugins</groupId>
160+
<artifactId>maven-surefire-plugin</artifactId>
161+
<version>2.18</version>
162+
<configuration>
163+
<includes>
164+
<include>**/*Test.java</include>
165+
<include>**/*Spec.java</include>
166+
</includes>
167+
</configuration>
168+
</plugin>
169+
170+
<plugin>
171+
<groupId>org.jacoco</groupId>
172+
<artifactId>jacoco-maven-plugin</artifactId>
173+
<version>0.8.6</version>
174+
<executions>
175+
<execution>
176+
<id>jacoco-initialize</id>
177+
<goals>
178+
<goal>prepare-agent</goal>
179+
</goals>
180+
</execution>
181+
<execution>
182+
<id>jacoco-site</id>
183+
<phase>test</phase>
184+
<goals>
185+
<goal>report</goal>
186+
</goals>
187+
</execution>
188+
</executions>
189+
</plugin>
190+
<plugin>
191+
<groupId>org.eluder.coveralls</groupId>
192+
<artifactId>coveralls-maven-plugin</artifactId>
193+
<version>4.3.0</version>
194+
<dependencies>
195+
<dependency>
196+
<groupId>javax.xml.bind</groupId>
197+
<artifactId>jaxb-api</artifactId>
198+
<version>2.3.1</version>
199+
</dependency>
200+
</dependencies>
201+
</plugin>
202+
</plugins>
203+
204+
205+
</build>
206+
207+
<reporting>
208+
<plugins>
209+
<plugin>
210+
<groupId>org.apache.maven.plugins</groupId>
211+
<artifactId>maven-surefire-report-plugin</artifactId>
212+
<version>3.0.0-M5</version>
213+
</plugin>
214+
215+
<plugin>
216+
<groupId>org.jacoco</groupId>
217+
<artifactId>jacoco-maven-plugin</artifactId>
218+
<reportSets>
219+
<reportSet>
220+
<reports>
221+
<!-- select non-aggregate reports -->
222+
<report>report</report>
223+
</reports>
224+
</reportSet>
225+
</reportSets>
226+
</plugin>
227+
228+
</plugins>
229+
</reporting>
230+
231+
</project>

src/main/java/com/featureprobe/api/Application.java renamed to feature-probe-admin/src/main/java/com/featureprobe/api/Application.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
import lombok.extern.slf4j.Slf4j;
66
import org.springframework.boot.SpringApplication;
77
import org.springframework.boot.autoconfigure.SpringBootApplication;
8-
import org.springframework.cache.annotation.EnableCaching;
98

109
@Slf4j
11-
@EnableCaching
1210
@SpringBootApplication
1311
@OpenAPIDefinition(info = @Info(title = "Feature Probe API", version = "1.0", description = "Feature Probe API"))
1412
public class Application {

0 commit comments

Comments
 (0)