Skip to content

Commit e9ee7e1

Browse files
committed
Add services
1 parent 2037126 commit e9ee7e1

File tree

109 files changed

+15424
-0
lines changed

Some content is hidden

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

109 files changed

+15424
-0
lines changed

.devcontainers/devcontainer.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml.
2+
{
3+
"name": "OpenAPI Editor",
4+
5+
// Update the 'dockerComposeFile' list if you have more compose files or use different names.
6+
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
7+
"dockerComposeFile": [
8+
"../docker-compose.yml",
9+
"docker-compose.yml"
10+
],
11+
12+
// The 'service' property is the name of the service for the container that VS Code should
13+
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
14+
"service": "openapi-editor",
15+
16+
// The optional 'workspaceFolder' property is the path VS Code should open by default when
17+
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
18+
"workspaceFolder": "/workspace"
19+
20+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
21+
// "forwardPorts": [],
22+
23+
// Uncomment the next line if you want start specific services in your Docker Compose config.
24+
// "runServices": [],
25+
26+
// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
27+
// "shutdownAction": "none",
28+
29+
// Uncomment the next line to run commands after the container is created - for example installing curl.
30+
// "postCreateCommand": "apt-get update && apt-get install -y curl",
31+
32+
// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
33+
// "remoteUser": "vscode"
34+
}
35+

.github/workflows/build.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Online Shop
2+
on:
3+
push:
4+
branches: [ "**" ]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v3
11+
12+
- name: Set up JDK
13+
uses: actions/setup-java@v3
14+
with:
15+
java-version: '11'
16+
distribution: 'temurin'
17+
cache: maven
18+
19+
- name: Build customer-service
20+
run: mvn clean package -f customer-service/pom.xml -Dservice.name=customer-service
21+
22+
- name: Build billing-service
23+
run: mvn clean package -f billing-service/pom.xml -Dservice.name=billing-service
24+
25+
- name: Build delivery-service
26+
run: mvn clean package -f delivery-service/pom.xml -Dservice.name=delivery-service
27+
28+
- name: Build address-validation-service
29+
run: mvn clean package -f address-validation-service/pom.xml -Dservice.name=address-validation-service
30+
31+
- name: Build with Docker
32+
run: docker compose build
33+
34+
- name: Start with Docker
35+
run: docker compose up -d
36+
37+
- name: Stop Docker Containers
38+
run: docker compose down

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/.*
2+
/*/.*
3+
!.gitignore
4+
!.github
5+
/keycloak/*
6+
!/keycloak/keycloak.mv.db
7+
target/
8+
*.iml

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Workshop API Design
2+
3+
Herzlich willkommen zum Workshop API Design.
4+
5+
## Übungen
6+
7+
### API Design
8+
9+
- [OpenAPI](https://github.com/openknowledge/workshop-api-design/tree/openapi)
10+
- [Mocking](https://github.com/openknowledge/workshop-api-design/tree/wiremock)
11+
- [AsyncAPI](https://github.com/openknowledge/workshop-api-design/tree/asyncapi)
12+
13+
### API Testing
14+
15+
- [Pact](https://github.com/openknowledge/workshop-api-design/tree/pact-mock-server)
16+
- [Pact Pipeline](https://github.com/openknowledge/workshop-api-design/tree/pact)
17+
18+
### API Security
19+
20+
- [JWT](https://github.com/openknowledge/workshop-api-design/tree/jwt)
21+
- [OAuth2](https://github.com/openknowledge/workshop-api-design/tree/oauth2)
22+
- [OAuth2 mit PKCE](https://github.com/openknowledge/workshop-api-design/tree/oauth2-pkce)
23+
24+
### API Governance
25+
26+
- [Linting](https://github.com/openknowledge/workshop-api-design/tree/linting)
27+
28+
### API Management
29+
30+
- [Rate Limiting](https://github.com/openknowledge/workshop-api-design/tree/rate-limiting)
31+
- [Backstage](https://github.com/openknowledge/workshop-api-design/tree/backstage)
32+
33+
### API Operation
34+
35+
- [Observability](https://github.com/openknowledge/workshop-api-design/tree/observability)
36+
37+
### API Evolution
38+
39+
- [Versioning](https://github.com/openknowledge/workshop-api-design/tree/versioning)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM maven:3.9.9-eclipse-temurin-21 AS mvn
2+
3+
WORKDIR /usr/src/online-shop
4+
COPY pom.xml ./
5+
RUN mvn package dependency:go-offline # cache dependencies
6+
COPY src ./src
7+
RUN mvn clean package meecrowave:bundle -Dservice.name=address-validation-service -Dmaven.test.skip=true -Dcheckstyle.skip=true
8+
9+
FROM eclipse-temurin:21-jre
10+
11+
RUN apt-get update -qq && apt-get install --no-install-recommends -qqy unzip && rm -rf /var/lib/apt/lists/*
12+
COPY --from=mvn /usr/src/online-shop/target/address-validation-service-meecrowave-distribution.zip /opt/address-validation-service.zip
13+
WORKDIR /opt
14+
RUN unzip address-validation-service.zip && rm address-validation-service.zip
15+
EXPOSE 8080
16+
17+
ENTRYPOINT ["/opt/address-validation-service-distribution/bin/meecrowave.sh", "run"]

address-validation-service/pom.xml

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- ~ Copyright (C) open knowledge GmbH. ~ ~ Licensed under the Apache License,
3+
Version 2.0 (the "License"); you may not use this file except in compliance
4+
with ~ the License. You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0
5+
~ ~ Unless required by applicable law or agreed to in writing, software distributed
6+
under the License is distributed on ~ an "AS IS" BASIS, WITHOUT WARRANTIES
7+
OR CONDITIONS OF ANY KIND, either express or implied. See the License for
8+
the ~ specific language governing permissions and limitations under the License. -->
9+
10+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
11+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
12+
<modelVersion>4.0.0</modelVersion>
13+
14+
<groupId>de.openkonwledge.sample.shop</groupId>
15+
<artifactId>${service.name}</artifactId>
16+
<version>1.0.0-SNAPSHOT</version>
17+
18+
<properties>
19+
<service.name>online-shop</service.name>
20+
<maven.compiler.source>11</maven.compiler.source>
21+
<maven.compiler.target>11</maven.compiler.target>
22+
<failOnMissingWebXml>false</failOnMissingWebXml>
23+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
24+
<meecrowave.version>1.2.15</meecrowave.version>
25+
<deltaspike.version>1.9.6</deltaspike.version>
26+
<junit.version>5.8.2</junit.version>
27+
</properties>
28+
29+
<dependencies>
30+
31+
<dependency>
32+
<groupId>org.apache.meecrowave</groupId>
33+
<artifactId>meecrowave-specs-api</artifactId>
34+
<version>${meecrowave.version}</version>
35+
<scope>provided</scope>
36+
</dependency>
37+
<dependency>
38+
<groupId>org.apache.meecrowave</groupId>
39+
<artifactId>meecrowave-core</artifactId>
40+
<version>${meecrowave.version}</version>
41+
<scope>provided</scope>
42+
</dependency>
43+
<dependency>
44+
<groupId>org.apache.geronimo.specs</groupId>
45+
<artifactId>geronimo-validation_1.0_spec</artifactId>
46+
<version>1.1</version>
47+
</dependency>
48+
<dependency>
49+
<groupId>org.eclipse.microprofile.config</groupId>
50+
<artifactId>microprofile-config-api</artifactId>
51+
<version>1.4</version>
52+
</dependency>
53+
<dependency>
54+
<groupId>org.apache.geronimo.config</groupId>
55+
<artifactId>geronimo-config-impl</artifactId>
56+
<version>1.2.2</version>
57+
</dependency>
58+
<dependency>
59+
<groupId>org.eclipse.microprofile.jwt</groupId>
60+
<artifactId>microprofile-jwt-auth-api</artifactId>
61+
<version>1.2.1</version>
62+
</dependency>
63+
<dependency>
64+
<groupId>org.apache.geronimo</groupId>
65+
<artifactId>geronimo-jwt-auth</artifactId>
66+
<version>1.0.4</version>
67+
</dependency>
68+
<dependency>
69+
<groupId>org.apache.deltaspike.modules</groupId>
70+
<artifactId>deltaspike-security-module-api</artifactId>
71+
<version>${deltaspike.version}</version>
72+
<scope>compile</scope>
73+
</dependency>
74+
<dependency>
75+
<groupId>org.apache.deltaspike.modules</groupId>
76+
<artifactId>deltaspike-security-module-impl</artifactId>
77+
<version>${deltaspike.version}</version>
78+
<scope>runtime</scope>
79+
</dependency>
80+
<dependency>
81+
<groupId>org.apache.commons</groupId>
82+
<artifactId>commons-lang3</artifactId>
83+
<version>3.9</version>
84+
</dependency>
85+
86+
<dependency>
87+
<groupId>org.junit.jupiter</groupId>
88+
<artifactId>junit-jupiter-api</artifactId>
89+
<version>${junit.version}</version>
90+
<scope>test</scope>
91+
</dependency>
92+
<dependency>
93+
<groupId>org.junit.jupiter</groupId>
94+
<artifactId>junit-jupiter-engine</artifactId>
95+
<version>${junit.version}</version>
96+
<scope>test</scope>
97+
</dependency>
98+
<dependency>
99+
<groupId>org.assertj</groupId>
100+
<artifactId>assertj-core</artifactId>
101+
<version>3.22.0</version>
102+
<scope>test</scope>
103+
</dependency>
104+
<dependency>
105+
<groupId>org.mockito</groupId>
106+
<artifactId>mockito-core</artifactId>
107+
<version>2.28.2</version>
108+
<scope>test</scope>
109+
</dependency>
110+
<dependency>
111+
<groupId>org.apache.meecrowave</groupId>
112+
<artifactId>meecrowave-junit</artifactId>
113+
<version>${meecrowave.version}</version>
114+
<scope>test</scope>
115+
</dependency>
116+
<dependency>
117+
<groupId>rocks.limburg.cdimock</groupId>
118+
<artifactId>cdimock</artifactId>
119+
<version>1.0.4</version>
120+
<scope>test</scope>
121+
</dependency>
122+
<dependency>
123+
<groupId>com.tngtech.archunit</groupId>
124+
<artifactId>archunit</artifactId>
125+
<version>1.0.1</version>
126+
<scope>test</scope>
127+
</dependency>
128+
</dependencies>
129+
130+
<build>
131+
<finalName>${project.artifactId}</finalName>
132+
<plugins>
133+
<plugin>
134+
<groupId>org.apache.maven.plugins</groupId>
135+
<artifactId>maven-surefire-plugin</artifactId>
136+
<version>3.0.0-M5</version>
137+
</plugin>
138+
<plugin>
139+
<groupId>org.apache.meecrowave</groupId>
140+
<artifactId>meecrowave-maven-plugin</artifactId>
141+
<version>${meecrowave.version}</version>
142+
</plugin>
143+
<plugin>
144+
<artifactId>maven-checkstyle-plugin</artifactId>
145+
<version>3.2.0</version>
146+
<configuration>
147+
<consoleOutput>true</consoleOutput>
148+
<headerLocation>${project.basedir}/src/main/checkstyle/java.header</headerLocation>
149+
<failsOnError>true</failsOnError>
150+
<consoleOutput>true</consoleOutput>
151+
</configuration>
152+
<executions>
153+
<execution>
154+
<id>compile</id>
155+
<phase>compile</phase>
156+
<goals>
157+
<goal>checkstyle</goal>
158+
</goals>
159+
<configuration>
160+
<configLocation>${project.basedir}/src/main/checkstyle/configuration.xml</configLocation>
161+
<includeTestSourceDirectory>true</includeTestSourceDirectory>
162+
</configuration>
163+
</execution>
164+
</executions>
165+
</plugin>
166+
</plugins>
167+
</build>
168+
</project>

0 commit comments

Comments
 (0)