Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saas installation #161

Merged
merged 243 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
243 commits
Select commit Hold shift + click to select a range
7036051
fix: upgrade jdk version for org and fin service
98jan Nov 16, 2024
aa7bc78
feat: initial draft of helm chart #64
98jan Nov 20, 2024
5e3b62b
Merge remote-tracking branch 'origin/main'
98jan Nov 20, 2024
9e0a050
Merge remote-tracking branch 'origin/main'
98jan Nov 25, 2024
7ac6d12
feat: first draft of saas installation #64
98jan Nov 25, 2024
43aa1c1
fix: disable secrets for keycloak bootstrap
98jan Nov 25, 2024
73e0fc5
fix: update postgresql configuration
98jan Nov 25, 2024
03b260d
fix: patching of postgresql
98jan Nov 25, 2024
06e8b01
fix: patching of postgresql
98jan Nov 25, 2024
66c7b99
fix: patching of postgresql
98jan Nov 25, 2024
96e7162
fix: reduce running pods
98jan Nov 25, 2024
4b910e5
fix: reduce running pods
98jan Nov 25, 2024
402bdb2
fix: reduce running pods
98jan Nov 25, 2024
efc5fe0
fix: add missing secret for postgresl-cluster
98jan Nov 25, 2024
d54eb90
fix: add missing secret for postgresl-cluster and openfga
98jan Nov 25, 2024
810a264
Merge remote-tracking branch 'origin/main'
98jan Nov 26, 2024
f2bcf58
fix: update secrets for hopps implementation
98jan Nov 26, 2024
2fdd26f
fix: update helm-release
98jan Nov 26, 2024
16db773
fix: update helm-release
98jan Nov 26, 2024
67039a4
fix: update keycloak url in secret
98jan Nov 26, 2024
4eddf5e
fix: add openfga job manually for migration
98jan Nov 26, 2024
5139bb3
fix: add openfga job manually for migration
98jan Nov 26, 2024
cd9c3bd
fix: intendation of kafka-ui ingress config
98jan Nov 26, 2024
0ee124e
fix: tls configuration
98jan Nov 26, 2024
1772711
Implement organization tree editor
pro100Koss Nov 4, 2024
0ad60d7
[126] settings page and organization structure
pro100Koss Nov 7, 2024
5b61af0
[126] emojis and other improvements
pro100Koss Nov 8, 2024
5d0d91f
[126] add toast notifications. dark theme improvements and other...
pro100Koss Nov 8, 2024
cc03991
[126] fix ts issues for tests, add refresing token, add some tests an…
pro100Koss Nov 15, 2024
4138d80
[126] fix failed build
pro100Koss Nov 15, 2024
46d21ef
[126] change nginx port 8080
pro100Koss Nov 17, 2024
9cfee0e
[126] add pid to nginx.conf
pro100Koss Nov 17, 2024
61f361b
[126] fix pid and run nginx on 8080
pro100Koss Nov 18, 2024
a4df8c8
[126] trying to configure keycloak
pro100Koss Nov 18, 2024
097ad0e
[126] update docker file to serve react app with node:18
pro100Koss Nov 21, 2024
f10e0be
Bump quarkus.platform.version from 3.16.4 to 3.17.0 in /backend
dependabot[bot] Nov 27, 2024
4c4727d
Bump quarkus.platform.version from 3.17.0 to 3.17.2 in /backend
dependabot[bot] Nov 29, 2024
a10c187
Bump org.cyclonedx:cyclonedx-maven-plugin in /backend
dependabot[bot] Nov 29, 2024
3bc863e
🚧 (bommel): WIP for multi-tenant capabilities
byte-sized-emi Nov 11, 2024
e6d6f50
🛂 (bommel): Require user to be authenticated in bommel endpoints
byte-sized-emi Nov 19, 2024
9843622
✨ (bommel): Make bommel multi-tenant capable
byte-sized-emi Nov 20, 2024
0db8f6c
✅ (bommel multi-tenant): Fix Organization tests
byte-sized-emi Nov 28, 2024
ced9dc5
🎨 (org): Change import style
byte-sized-emi Nov 28, 2024
674117f
✅ (org): Add test to verify non-cascading behavior in Bommel.
d135-1r43 Dec 1, 2024
7803fea
🎨 (org): Improve code formatting for readability
d135-1r43 Dec 1, 2024
40ebbb9
✨ (#111): Use java money in JPA
d135-1r43 Nov 2, 2024
93df64d
✨ (banner): Change banner to real name
d135-1r43 Nov 2, 2024
a89d96b
➕ (109): Add flyway
Nov 9, 2024
40b1072
✨ (109): Add BPMN process for az-document events
Nov 24, 2024
ec527c8
✅ (109): Add tests and cleanup application.properties
Nov 24, 2024
77f4076
✨ (109): Add RestResource
Nov 27, 2024
85eaea4
✨ (109): Add RestClient against org service
Nov 30, 2024
d3e52e2
✅ (109): Add pact consumer test
Nov 30, 2024
84070f2
✅ (109): Add two new tests and fix sonar issues
Nov 30, 2024
4c5a16e
🚚 Rename Sonar Vereine to Org
Nov 30, 2024
309b0b7
🎨 (fin): Refactor and optimize transaction resource and dependencies
d135-1r43 Dec 1, 2024
9e41389
🚧 (dev setup): Create initial docker compose setup, to be tested
byte-sized-emi Nov 26, 2024
2ec5b74
🧑‍💻 (dev setup): Finish local dev docker-compose.yaml
byte-sized-emi Nov 26, 2024
68410e6
🎨 (compose): Improve keycloak_default_realm.json
byte-sized-emi Dec 2, 2024
527b230
🐛 (backend): Add migrations to stop services not creating their tables
byte-sized-emi Dec 4, 2024
6dd37e2
🗃️ (backend): Update init migration script
byte-sized-emi Dec 4, 2024
7ff2632
🐛 (backend): Make sure everything works + fix stuff that doesn't
byte-sized-emi Dec 4, 2024
7e30362
Bump org.instancio:instancio-junit from 5.1.0 to 5.2.0 in /backend
dependabot[bot] Dec 4, 2024
e081aee
Bump io.quarkiverse.wiremock:quarkus-wiremock-test in /backend
dependabot[bot] Dec 2, 2024
9f78399
🚚 (109): Migration in wrong folder
Dec 4, 2024
0bd8dc6
[126] WIP invoices service
pro100Koss Dec 2, 2024
b45fe35
[126] update filter and re-rendering invoices
pro100Koss Dec 2, 2024
6905164
[155] cleanup
pro100Koss Dec 6, 2024
cf95a35
[155] fix updating summary after refresh
pro100Koss Dec 6, 2024
43ec40f
[155] small improvements
pro100Koss Dec 6, 2024
7ddefd8
[155] add pact tests for invoices
pro100Koss Dec 6, 2024
f9450e8
[155] fix lock file
pro100Koss Dec 6, 2024
381de35
[155] all language service
kzamurnyak Dec 7, 2024
8ddc18b
✨ (142): First iteration of wrapper
Dec 4, 2024
ba455c7
📈 (#180): Add Micrometer metrics to all services
d135-1r43 Dec 9, 2024
4789183
✨ (#177): Add PersistOrganizationDelegate and its tests
d135-1r43 Dec 8, 2024
90d01b8
✨ (#177): Integrate into BPMN and fix tests
d135-1r43 Dec 8, 2024
5b083e3
✅ (#177): Change test visibility
d135-1r43 Dec 9, 2024
9d35f77
💚 (fin): Fix failing tests
d135-1r43 Dec 9, 2024
fd3ec83
🐛 (#182): Fix user creation in Keycloak
d135-1r43 Dec 9, 2024
7fba63b
✨ (#183): API to get Org by slug and their members
d135-1r43 Dec 9, 2024
eaf5d92
🎨 (#183): Remove unnecessary trailing spaces in OrganizationResource.…
d135-1r43 Dec 10, 2024
f77d22c
fix: increase storage for database
98jan Dec 10, 2024
f95f847
feat: add healthcheck and monitoring functionality to helm chart
98jan Dec 10, 2024
c450abe
✅ (org): Try to make BommelTest run again
byte-sized-emi Dec 10, 2024
de3b497
✅ (#183): Add @Transactional to setUp method in DataHandlerTest
d135-1r43 Dec 10, 2024
c47f025
✅(#183): Add Redpanda Kafka image as a Quarkus devservices workaround
d135-1r43 Dec 10, 2024
824e726
✅ (org): Refactor Keycloak user creation test to improve assertions
d135-1r43 Dec 10, 2024
0110138
🎨 (org): Fix format
d135-1r43 Dec 10, 2024
92dcb1d
🧑‍💻 (188): Enable Quarkus Management Interface
d135-1r43 Dec 10, 2024
66486f4
🚨 (sonar): Fix sonar warnings and typos
d135-1r43 Dec 10, 2024
33e008c
fix: remove not needed service and merge to one
98jan Dec 11, 2024
d3d9847
Merge pull request #187 from hopps-app/helm
d135-1r43 Dec 11, 2024
9a4885e
Merge pull request #189 from hopps-app/188-management-interface
d135-1r43 Dec 11, 2024
34cb0d3
Bump org.instancio:instancio-junit from 5.2.0 to 5.2.1 in /backend
dependabot[bot] Dec 11, 2024
f8a0c85
Bump quarkus.platform.version from 3.17.2 to 3.17.4 in /backend
dependabot[bot] Dec 11, 2024
7aaf42b
Merge pull request #191 from hopps-app/dependabot/maven/backend/quark…
d135-1r43 Dec 11, 2024
c32c738
Merge pull request #190 from hopps-app/dependabot/maven/backend/org.i…
d135-1r43 Dec 11, 2024
bf0ac59
Merge pull request #184 from hopps-app/183-api-zum-listen-aller-mitgl…
d135-1r43 Dec 11, 2024
60195eb
Merge pull request #181 from hopps-app/180-metrics-hinzufügen
d135-1r43 Dec 11, 2024
73ff65f
fix: update helm chart and use new healthcheck endpoints
98jan Dec 11, 2024
06dd4f9
fix: update healthcheck endpoints and remove nginx references for fro…
98jan Dec 14, 2024
18621d5
🔥 (kafka): Remove workaround
Dec 14, 2024
3fbad52
📌 (kogito): use 10.0.0 release
Dec 14, 2024
5ac8046
♻️ (api): Refactor resources to conform to RESTful
Dec 14, 2024
4d80076
🧑‍💻 (org): Include test data for org service
byte-sized-emi Nov 28, 2024
1081223
🔨 (org): Adjust test data for multitenant bommels
byte-sized-emi Dec 2, 2024
6bef946
🧑‍💻 (org): Make test data available in DEV and TEST modes, automatically
byte-sized-emi Dec 8, 2024
b0bcab1
✅ (org): Create test that uses the test data
byte-sized-emi Dec 12, 2024
9657589
✅ (org): Pass tests
byte-sized-emi Dec 16, 2024
b6f8950
💚 (org): Add mvn clean to backend CI/CD
byte-sized-emi Dec 16, 2024
3d3392a
✅ (org): Try to pass test
byte-sized-emi Dec 16, 2024
cec412b
✅ (org): Try to pass OrganizationResourceTests
byte-sized-emi Dec 16, 2024
fb91c4f
🐛 (org): Add transaction in OrganizationResourceTests
byte-sized-emi Dec 16, 2024
4ca625e
✅ (org): Delete all bommels and members in OrganizationResourceTests
byte-sized-emi Dec 16, 2024
c042f53
🎨 (org): mvn formatter:format
byte-sized-emi Dec 16, 2024
fccc082
fix: update to newest helm chart, configure kafka integration
98jan Dec 18, 2024
a900daf
✨ (#197): Allow setting of first password
d135-1r43 Dec 16, 2024
5130b9b
🔊 (#197): Log correct exception
d135-1r43 Dec 19, 2024
5340ddd
✨ (subtotal): Remove subtotal, not needed by product
d135-1r43 Dec 22, 2024
679ad38
:sparkles: replace frontend envs
Dec 23, 2024
7b370ba
:bug: fix path to startup scripts
Dec 23, 2024
74631e6
:bug: fix legacy environment variable setting
Dec 23, 2024
8853d3e
:sparkles: deploy new frontend version
Dec 23, 2024
f48f8e8
:bug: fix startup script in frontend
Dec 23, 2024
2dba825
:bug: fix startup script in frontend
Dec 23, 2024
6dd3328
:bug: fix nginx path issue for frontend
Dec 23, 2024
6b28d6f
:bug: fix file permission issue for sed command
Dec 23, 2024
7521071
:bug: fix group for sed command
Dec 23, 2024
75df7fa
:bug: fix symbol issue in frontend secret
Dec 23, 2024
e05190b
🐛 (208): Fix insertion issues with test-data
Dec 23, 2024
bca4ed9
✅ (208): Fix tests
Dec 23, 2024
2ebb979
🎨 (tests): Refactor test class modifiers and formatting adjustments.
d135-1r43 Dec 23, 2024
3bb3afa
🔥 (213): remove migration which is cannot work
Dec 23, 2024
18563dc
docs: update README.md
allcontributors[bot] Dec 23, 2024
dd70173
docs: update .all-contributorsrc
allcontributors[bot] Dec 23, 2024
1be25d2
🐛 (#198): Add example, remove operationID
d135-1r43 Dec 23, 2024
6424501
fix: add node user as owner of files (#218)
98jan Dec 24, 2024
5305054
fix: update replace string to not replace key in files
98jan Dec 25, 2024
9fbec16
Added progress up to last commit of 99-service-fr-zugferd, in order t…
Josh1ku Dec 19, 2024
7a701ed
change of kafka topic names
Josh1ku Dec 21, 2024
999b02a
addition of zugferd-document-service to backend pom.xml
Josh1ku Dec 21, 2024
294293d
Changes to shouldAnayzeInvoiceWithZugferd test
Josh1ku Dec 23, 2024
26e3e05
Changed URL usage to URI
Josh1ku Dec 23, 2024
0bd653c
Change so that Errors get logged instead of being thrown
Josh1ku Dec 24, 2024
46da1b9
Removement of unused imports
Josh1ku Dec 24, 2024
525559d
Changed tests to be protected
Josh1ku Dec 24, 2024
11bb7ff
adjustments to error handling in the KafkaConnector
Josh1ku Dec 28, 2024
ca702ad
changed package name accordingly
Josh1ku Dec 28, 2024
42d6677
✨ (195): Baseline for proxy
Dec 15, 2024
51c0c4e
✨ (195): Add referenceKey to kafka input/output
Dec 18, 2024
6dfb23b
✨ (195): Integration of commons module
Dec 22, 2024
d4ff287
🔥 (195): remove subtotal
Dec 23, 2024
aae88b8
✨ (195): Enable authentication and add url for fin service
Dec 24, 2024
fd52650
🔧 (ZUGFERD): Build, sonar and track zugferd status
Dec 28, 2024
2e4d1b8
✨ (#195): Update BPMN processes
Dec 29, 2024
c505f0c
🔧 (#195): Allow dependency track and sonarqube to run always
Dec 29, 2024
032467f
✨ (#195): Working communication between fin and zugferd
Dec 29, 2024
564e406
✨ (#195): Working communication between fin and az-document-ai
Dec 29, 2024
dbed68a
🐛 (#195): Fix null address in zugferd
Dec 29, 2024
ae39c83
🎨 (#195): formatting
Dec 29, 2024
8efaa07
Bump quarkus.platform.version from 3.17.4 to 3.17.5 in /backend (#224)
dependabot[bot] Dec 30, 2024
9108a38
✨ (#220): Add endpoint to get my org (#221)
d135-1r43 Dec 30, 2024
52ae33f
🐛 (#195): fix PR requests (#225)
3thr3n Dec 30, 2024
f9b2a15
📝 (Kogito): Temporary fix for not listing the endpoints of kogito
Dec 30, 2024
1894679
🔧 (ZUGFeRD): Enable management port
Dec 30, 2024
e42e27d
💚 (spa) improve CI build when replacing envs in frontend
Jan 2, 2025
3234edd
🔖 (spa) deploy 171
Jan 2, 2025
8fc3610
[000] create organization WIP
pro100Koss Dec 9, 2024
e71f79c
[000] create organization WIP 3
pro100Koss Dec 13, 2024
5646c8a
[000] create organization create root bommel
pro100Koss Dec 13, 2024
dbabf88
[000] create bommels
pro100Koss Dec 13, 2024
7c3496a
[000] implementing saving bommels. fix tests
pro100Koss Dec 13, 2024
ce7a03a
[000] add translations and ability to change languages
pro100Koss Dec 13, 2024
b3e74ae
[000] updates and fixes
pro100Koss Dec 16, 2024
8cf4676
[000] set password for user on registration
pro100Koss Dec 23, 2024
44f62ad
[000] improvements and fixes
pro100Koss Dec 27, 2024
a701a50
[000] fix build
pro100Koss Dec 30, 2024
c266a7f
Merge branch 'refs/heads/main' into fix/improve-frontend-build
Jan 2, 2025
088ae42
🚀 deploy frontend with new environment variables fin and org service
Jan 2, 2025
a8a2099
:sparkles: take photo of invoice
manuelhummler Jan 2, 2025
1c3c547
✨ (#228): Do not disable Auth in Dev mode for org service
d135-1r43 Jan 2, 2025
e22a328
⚗️ (todos): Update TODOs for FGAC implementation and dynamic media types
d135-1r43 Jan 2, 2025
87b513b
📝 (schema): Add example to document attributs with OpenAPI
d135-1r43 Jan 2, 2025
0ee588a
Bump io.quarkiverse.wiremock:quarkus-wiremock-test in /backend
dependabot[bot] Dec 16, 2024
9ddfcb4
Merge branch 'refs/heads/fix/improve-frontend-build'
Jan 2, 2025
e7ba266
Merge branch 'main' of github.com:hopps-app/hopps
Jan 2, 2025
060bafe
🙈 add .dockerignore and undo Dockerfile variable improvement
manuelhummler Jan 5, 2025
69cdb22
🚀 deploy frontend 180
manuelhummler Jan 5, 2025
c469d59
🚀 increase volume size of postgres-cluster
manuelhummler Jan 5, 2025
64517a7
fix: cleanup repo and update implementation
98jan Jan 6, 2025
840e50b
fix: remove obsolete job
98jan Jan 6, 2025
a5f0ff3
🔐 update spa frontend secret
manuelhummler Jan 6, 2025
96a49db
🔒️ fix cors issue for hopps.cloud
manuelhummler Jan 6, 2025
e42fdf8
🔒️ fix cors issue for hopps.cloud enable cors
manuelhummler Jan 6, 2025
71bc8da
fix: update secret implementation and switch migrationType for openfga
98jan Jan 6, 2025
86e6172
🐛 (org): Allow creating Orgs without Login
d135-1r43 Jan 9, 2025
bea9c4b
🐛 (org): Allow creating Orgs without Login, once again
d135-1r43 Jan 9, 2025
b9637bc
🐛 fix path rewrite issue for org and fin service
manuelhummler Jan 9, 2025
e78ae79
Bump quarkus.platform.version from 3.17.5 to 3.17.6 in /backend
dependabot[bot] Jan 8, 2025
0c3203a
Bump org.mustangproject:validator from 2.15.2 to 2.16.0 in /backend
dependabot[bot] Jan 10, 2025
2dc614e
feat: initial draft of helm chart #64
98jan Nov 20, 2024
8cc916c
feat: first draft of saas installation #64
98jan Nov 25, 2024
0d50f46
fix: disable secrets for keycloak bootstrap
98jan Nov 25, 2024
c4a03ef
fix: update postgresql configuration
98jan Nov 25, 2024
da64e71
fix: patching of postgresql
98jan Nov 25, 2024
a85f663
fix: patching of postgresql
98jan Nov 25, 2024
147e99d
fix: patching of postgresql
98jan Nov 25, 2024
21e86cc
fix: reduce running pods
98jan Nov 25, 2024
2fedeef
fix: reduce running pods
98jan Nov 25, 2024
71357e4
fix: reduce running pods
98jan Nov 25, 2024
daf18ac
fix: add missing secret for postgresl-cluster
98jan Nov 25, 2024
a4702ba
fix: add missing secret for postgresl-cluster and openfga
98jan Nov 25, 2024
cdf9031
fix: update secrets for hopps implementation
98jan Nov 26, 2024
60a5382
fix: update helm-release
98jan Nov 26, 2024
fc63e37
fix: update helm-release
98jan Nov 26, 2024
f794c1b
fix: update keycloak url in secret
98jan Nov 26, 2024
71829ca
fix: add openfga job manually for migration
98jan Nov 26, 2024
65cd28b
fix: add openfga job manually for migration
98jan Nov 26, 2024
c979daf
fix: intendation of kafka-ui ingress config
98jan Nov 26, 2024
e4b586f
fix: tls configuration
98jan Nov 26, 2024
0473e97
fix: increase storage for database
98jan Dec 10, 2024
e9b3a02
fix: update helm chart and use new healthcheck endpoints
98jan Dec 11, 2024
e2e6648
fix: update to newest helm chart, configure kafka integration
98jan Dec 18, 2024
23e6c58
:sparkles: deploy new frontend version
Dec 23, 2024
9952e07
:bug: fix startup script in frontend
Dec 23, 2024
1d6205c
:bug: fix file permission issue for sed command
Dec 23, 2024
a9d8b78
:bug: fix group for sed command
Dec 23, 2024
90f86f4
:bug: fix symbol issue in frontend secret
Dec 23, 2024
c4f6111
🔖 (spa) deploy 171
Jan 2, 2025
e347d5d
🚀 deploy frontend with new environment variables fin and org service
Jan 2, 2025
375bef0
🚀 deploy frontend 180
manuelhummler Jan 5, 2025
9bba5e2
🚀 increase volume size of postgres-cluster
manuelhummler Jan 5, 2025
8c8e3a8
fix: cleanup repo and update implementation
98jan Jan 6, 2025
8fabdfe
fix: remove obsolete job
98jan Jan 6, 2025
0b0376d
🔐 update spa frontend secret
manuelhummler Jan 6, 2025
7ca57d8
🔒️ fix cors issue for hopps.cloud
manuelhummler Jan 6, 2025
3974135
🔒️ fix cors issue for hopps.cloud enable cors
manuelhummler Jan 6, 2025
1fe447a
fix: update secret implementation and switch migrationType for openfga
98jan Jan 6, 2025
c66f833
🐛 fix path rewrite issue for org and fin service
manuelhummler Jan 9, 2025
181eda6
Merge remote-tracking branch 'origin/saas-installation' into saas-ins…
manuelhummler Jan 12, 2025
1de8538
fix: update keycloak domain and add admin-client configuration for or…
98jan Jan 12, 2025
55a3525
fix: configure realm for admin client
98jan Jan 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@
"contributions": [
"code"
]
},
{
"login": "98jan",
"name": "Jan",
"avatar_url": "https://avatars.githubusercontent.com/u/46779261?v=4",
"profile": "https://github.com/98jan",
"contributions": [
"code",
"infra"
]
}
]
}
19 changes: 11 additions & 8 deletions .github/workflows/backend-sonarqube-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ on:
paths:
- backend/**
- .github/workflows/backend-sonarqube-analysis.yml
branches: [ "main" ]
pull_request:
paths:
- backend/**
- .github/workflows/backend-sonarqube-analysis.yml
types: [ opened, reopened, synchronize ]

jobs:
build-and-analyse:
Expand All @@ -25,10 +19,13 @@ jobs:
label: "AZ Document AI"
- key: "hopps-app_hopps-vereine"
folder: "app.hopps.org"
label: "Vereine"
label: "Org"
- key: "hopps-app_hopps-fin"
folder: "app.hopps.fin"
label: "Finanzen"
- key: "hopps-app_zugferd"
folder: "app.hopps.zugferd"
label: "ZUGFeRD"

steps:
- uses: actions/checkout@v4
Expand All @@ -39,8 +36,14 @@ jobs:
distribution: "temurin"
cache: maven

- name: mvn install parent
run: mvn -B -N clean install --file backend/pom.xml

- name: mvn install commons
run: mvn -B install --file backend/app.hopps.commons/pom.xml

- name: mvn package
run: mvn -B verify --file backend/pom.xml
run: mvn -B verify --file backend/${{ matrix.sonar.folder }}/pom.xml

- name: Cache SonarQube packages
uses: actions/cache@v4
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
directory: app.hopps.org
- label: az-document-ai
directory: app.hopps.az-document-ai
- label: zugferd
directory: app.hopps.zugferd

runs-on: ubuntu-latest
steps:
Expand All @@ -40,9 +42,15 @@ jobs:
distribution: 'temurin'
cache: maven

- name: mvn install parent
run: mvn -B -N clean install --file backend/pom.xml

- name: mvn install commons
run: mvn -B install --file backend/app.hopps.commons/pom.xml

# only build relevant service
- name: mvn package
run: mvn -B package --file backend/${{ matrix.service.directory }}/pom.xml
run: mvn -B clean package --file backend/${{ matrix.service.directory }}/pom.xml

- name: Extract metadata (tags, labels) for Docker
id: meta
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/dependency-track-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ on:
paths:
- backend/**
- .github/workflows/dependency-track-analysis.yml
branches: [ "main" ]
pull_request:
paths:
- backend/**
- .github/workflows/dependency-track-analysis.yml
types: [ opened, reopened, synchronize ]

jobs:
upload-bom:
Expand All @@ -19,7 +13,11 @@ jobs:

strategy:
matrix:
projectName: [ "app.hopps.org", "app.hopps.az-document-ai", "app.hopps.fin" ]
projectName:
- "app.hopps.org"
- "app.hopps.az-document-ai"
- "app.hopps.fin"
- "app.hopps.zugferd"

steps:
# Checkout the code
Expand All @@ -32,7 +30,7 @@ jobs:
cache: maven

- name: mvn makeAggregateBom
run: mvn org.cyclonedx:cyclonedx-maven-plugin:2.8.0:makeBom --file backend/pom.xml
run: mvn org.cyclonedx:cyclonedx-maven-plugin:2.8.0:makeBom --file backend/${{ matrix.projectName }}/pom.xml

- name: Get current project version
uses: avides/[email protected]
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,10 @@ $RECYCLE.BIN/

# Drawio
*.drawio.bkp

# helm
./charts/hopps/charts

# unencrypted secrets
*decrypted.env
age.agekey
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ unter [hub.docker.com/r/apache/incubator-kie-kogito-data-index-ephemeral/tags](h
<td align="center" valign="top" width="14.28%"><a href="https://github.com/eliashehme"><img src="https://avatars.githubusercontent.com/u/176706065?v=4?s=100" width="100px;" alt="Elias Hehme"/><br /><sub><b>Elias Hehme</b></sub></a><br /><a href="#projectManagement-eliashehme" title="Project Management">📆</a> <a href="#business-eliashehme" title="Business development">💼</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://www.nachhilfe-paf.de"><img src="https://avatars.githubusercontent.com/u/119429802?v=4?s=100" width="100px;" alt="Simon Krumböck"/><br /><sub><b>Simon Krumböck</b></sub></a><br /><a href="#projectManagement-sk2675" title="Project Management">📆</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/3thr3n"><img src="https://avatars.githubusercontent.com/u/33932819?v=4?s=100" width="100px;" alt="3thr3n"/><br /><sub><b>3thr3n</b></sub></a><br /><a href="#code-3thr3n" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/98jan"><img src="https://avatars.githubusercontent.com/u/46779261?v=4?s=100" width="100px;" alt="Jan"/><br /><sub><b>Jan</b></sub></a><br /><a href="#code-98jan" title="Code">💻</a> <a href="#infra-98jan" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
</tr>
</tbody>
</table>
Expand Down
23 changes: 22 additions & 1 deletion backend/app.hopps.az-document-ai/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>3.16.4</quarkus.platform.version>
<quarkus.platform.version>3.17.6</quarkus.platform.version>
<skipITs>true</skipITs>
<surefire-plugin.version>3.5.2</surefire-plugin.version>
<sonar.coverage.jacoco.xmlReportPaths>
Expand All @@ -44,6 +44,11 @@
</dependencyManagement>

<dependencies>
<dependency>
<groupId>app.hopps</groupId>
<artifactId>commons</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- quarkus -->
<dependency>
<groupId>io.quarkus</groupId>
Expand All @@ -69,6 +74,22 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-health</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-micrometer</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-micrometer-registry-prometheus</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-oidc-client</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client-jackson</artifactId>
</dependency>
<!-- third party -->
<dependency>
<groupId>com.azure</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,73 +1,98 @@
package app.hopps;

import app.hopps.model.InvoiceData;
import app.hopps.model.ReceiptData;
import com.azure.ai.documentintelligence.DocumentIntelligenceClient;
import com.azure.ai.documentintelligence.DocumentIntelligenceClientBuilder;
import com.azure.ai.documentintelligence.models.AnalyzeDocumentRequest;
import app.hopps.auth.FinRestClientImpl;
import app.hopps.commons.DocumentData;
import app.hopps.commons.InvoiceData;
import app.hopps.commons.ReceiptData;
import app.hopps.model.InvoiceDataHelper;
import app.hopps.model.ReceiptDataHelper;
import com.azure.ai.documentintelligence.models.AnalyzeResult;
import com.azure.ai.documentintelligence.models.AnalyzeResultOperation;
import com.azure.ai.documentintelligence.models.Document;
import com.azure.core.credential.AzureKeyCredential;
import com.azure.core.util.polling.SyncPoller;
import io.quarkus.oidc.client.OidcClient;
import io.quarkus.oidc.client.runtime.TokensHelper;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.net.URISyntaxException;
import java.net.URL;
import java.time.Duration;
import java.util.List;

@ApplicationScoped
public class AzureAiService {

private final Logger LOGGER = LoggerFactory.getLogger(AzureAiService.class);
private static final Logger LOG = LoggerFactory.getLogger(AzureAiService.class);

private final AzureDocumentConnector azureDocumentConnector;

@ConfigProperty(name = "app.hopps.az-document-ai.azure.invoiceModelId")
String invoiceModelId;

@ConfigProperty(name = "app.hopps.az-document-ai.azure.receiptModelId")
String receiptModelId;

private final OidcClient oidcClient;
private final TokensHelper tokensHelper = new TokensHelper();

@Inject
AzureDocumentConnector azureDocumentConnector;
public AzureAiService(AzureDocumentConnector azureDocumentConnector, OidcClient oidcClient) {
this.azureDocumentConnector = azureDocumentConnector;
this.oidcClient = oidcClient;
}

public ReceiptData scanReceipt(URL imageUrl) {
Document document = scanDocument(receiptModelId, imageUrl);
public ReceiptData scanReceipt(DocumentData documentData) {
Document document = scanDocument(receiptModelId, documentData.internalFinUrl());
if (document == null) {
return null;
}

return ReceiptData.fromDocument(document);
return ReceiptDataHelper.fromDocument(documentData.referenceKey(), document);
}

public InvoiceData scanInvoice(URL imageUrl) {
Document document = scanDocument(invoiceModelId, imageUrl);
public InvoiceData scanInvoice(DocumentData documentData) {
Document document = scanDocument(invoiceModelId, documentData.internalFinUrl());
if (document == null) {
return null;
}

LOGGER.info("Scanned document: {}", document.getFields());
LOG.info("Scanned document: {}", document.getFields());

return InvoiceData.fromDocument(document);
return InvoiceDataHelper.fromDocument(documentData.referenceKey(), document);
}

private Document scanDocument(String modelId, URL imageUrl) {
LOGGER.info("(model={}) Starting scan of document: '{}'", modelId, imageUrl);
private Document scanDocument(String modelId, URL documentUrl) {
LOG.info("(model={}) Starting scan of document: '{}'", modelId, documentUrl);
byte[] documentBytes = fetchDocument(documentUrl);

AnalyzeResult analyzeLayoutResult = azureDocumentConnector.getAnalyzeResult(modelId, imageUrl);
AnalyzeResult analyzeLayoutResult = azureDocumentConnector.getAnalyzeResult(modelId, documentBytes);
List<Document> documents = analyzeLayoutResult.getDocuments();

if (documents.isEmpty()) {
LOGGER.error("Couldn't analyze document '{}'", imageUrl);
LOG.error("Couldn't analyze document '{}'", documentUrl);
return null;
} else if (documents.size() > 1) {
LOGGER.warn("Document analysis found {} documents, using first one", documents.size());
LOG.warn("Document analysis found {} documents, using first one", documents.size());
}

LOGGER.info("(model={}) Scan successfully completed for: '{}'", modelId, imageUrl);
LOG.info("(model={}) Scan successfully completed for: '{}'", modelId, documentUrl);

return documents.getFirst();
}

private byte[] fetchDocument(URL documentUrl) {
try {
FinRestClientImpl finRestClient = new FinRestClientImpl(documentUrl);
String accessToken = tokensHelper.getTokens(oidcClient)
.await()
.atMost(Duration.ofSeconds(3))
.getAccessToken();

return finRestClient.getDocumentBase64(accessToken);
} catch (URISyntaxException e) {
throw new IllegalStateException("Couldn't fetch document", e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import jakarta.enterprise.context.ApplicationScoped;
import org.eclipse.microprofile.config.inject.ConfigProperty;

import java.net.URL;

@ApplicationScoped
public class AzureDocumentConnector {

Expand All @@ -26,7 +24,7 @@ public AzureDocumentConnector(
.buildClient();
}

public AnalyzeResult getAnalyzeResult(String modelId, URL imageUrl) {
public AnalyzeResult getAnalyzeResult(String modelId, byte[] imageBytes) {
SyncPoller<AnalyzeResultOperation, AnalyzeResult> analyzeLayoutPoller = azureClient.beginAnalyzeDocument(
modelId,
null,
Expand All @@ -36,7 +34,7 @@ public AnalyzeResult getAnalyzeResult(String modelId, URL imageUrl) {
null,
null,
null,
new AnalyzeDocumentRequest().setUrlSource(imageUrl.toString()));
new AnalyzeDocumentRequest().setBase64Source(imageBytes));

return analyzeLayoutPoller.getFinalResult();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,42 @@
package app.hopps;

import app.hopps.model.InvoiceData;
import app.hopps.model.ReceiptData;
import app.hopps.commons.DocumentData;
import app.hopps.commons.DocumentType;
import app.hopps.commons.InvoiceData;
import app.hopps.commons.ReceiptData;
import io.quarkus.arc.profile.IfBuildProfile;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;

import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;

@ApplicationScoped
@IfBuildProfile("dev")
@Path("/documents/scan")
public class DevDocumentConnector {
private final AzureAiService aiService;

@Inject
AzureAiService aiService;
public DevDocumentConnector(AzureAiService aiService) {
this.aiService = aiService;
}

@Path("/invoice")
@POST
public InvoiceData scanInvoice(String imageUrl) throws URISyntaxException, MalformedURLException {
return aiService.scanInvoice(new URI(imageUrl).toURL());
DocumentData documentData = new DocumentData(new URI(imageUrl).toURL(), -1L, DocumentType.INVOICE);
return aiService.scanInvoice(documentData);
}

@Path("/receipt")
@POST
public ReceiptData scanReceipt(String imageUrl) throws URISyntaxException, MalformedURLException {
return aiService.scanReceipt(new URI(imageUrl).toURL());
DocumentData documentData = new DocumentData(new URI(imageUrl).toURL(), -1L, DocumentType.RECEIPT);
return aiService.scanReceipt(documentData);
}

}
Loading
Loading