From fab3680c07ecf1c988783dfeda19770a04c6287f Mon Sep 17 00:00:00 2001
From: Phan Huy Tran
Date: Wed, 12 Feb 2025 11:15:27 +0100
Subject: [PATCH 001/176] feat: Add proper redirects to login and logout button
---
.../homepage/homepage/homepage.component.ts | 8 ++++---
.../landing-page/landing-page.component.ts | 22 ++++++++++---------
2 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/frontend/src/app/homepage/homepage/homepage.component.ts b/frontend/src/app/homepage/homepage/homepage.component.ts
index 1f01382..2b2dda8 100644
--- a/frontend/src/app/homepage/homepage/homepage.component.ts
+++ b/frontend/src/app/homepage/homepage/homepage.component.ts
@@ -1,5 +1,5 @@
-import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
-import { KeycloakService } from 'keycloak-angular';
+import {ChangeDetectionStrategy, Component, inject} from '@angular/core';
+import {KeycloakService} from 'keycloak-angular';
@Component({
selector: 'app-homepage',
@@ -12,6 +12,8 @@ export class HomepageComponent {
private keycloakService: KeycloakService = inject(KeycloakService);
logout() {
- this.keycloakService.logout();
+ const baseUrl = window.location.origin;
+
+ this.keycloakService.logout(`${baseUrl}/`);
}
}
diff --git a/frontend/src/app/landing-page/landing-page.component.ts b/frontend/src/app/landing-page/landing-page.component.ts
index ff25911..eefe0d4 100644
--- a/frontend/src/app/landing-page/landing-page.component.ts
+++ b/frontend/src/app/landing-page/landing-page.component.ts
@@ -1,16 +1,18 @@
-import { Component, inject } from '@angular/core';
-import { KeycloakService } from 'keycloak-angular';
+import {Component, inject} from '@angular/core';
+import {KeycloakService} from 'keycloak-angular';
@Component({
- selector: 'app-landing-page',
- standalone: true,
- imports: [],
- templateUrl: './landing-page.component.html',
+ selector: 'app-landing-page',
+ standalone: true,
+ imports: [],
+ templateUrl: './landing-page.component.html',
})
export class LandingPageComponent {
- private keycloakService: KeycloakService = inject(KeycloakService);
+ private keycloakService: KeycloakService = inject(KeycloakService);
- login() {
- this.keycloakService.login();
- }
+ login() {
+ const baseUrl = window.location.origin;
+
+ this.keycloakService.login({redirectUri: `${baseUrl}/home`});
+ }
}
--
2.47.2
From c64152b99fad46c310a8eb184731c4db7b373ca8 Mon Sep 17 00:00:00 2001
From: Phan Huy Tran
Date: Wed, 12 Feb 2025 11:16:29 +0100
Subject: [PATCH 002/176] style: format code with prettier
---
frontend/src/app/app.routes.ts | 2 +-
.../homepage/homepage/homepage.component.ts | 4 ++--
.../landing-page/landing-page.component.ts | 22 +++++++++----------
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/frontend/src/app/app.routes.ts b/frontend/src/app/app.routes.ts
index 2d53d28..02b958c 100644
--- a/frontend/src/app/app.routes.ts
+++ b/frontend/src/app/app.routes.ts
@@ -12,5 +12,5 @@ export const routes: Routes = [
path: 'home',
component: HomepageComponent,
canActivate: [authGuard],
- }
+ },
];
diff --git a/frontend/src/app/homepage/homepage/homepage.component.ts b/frontend/src/app/homepage/homepage/homepage.component.ts
index 2b2dda8..ff894dc 100644
--- a/frontend/src/app/homepage/homepage/homepage.component.ts
+++ b/frontend/src/app/homepage/homepage/homepage.component.ts
@@ -1,5 +1,5 @@
-import {ChangeDetectionStrategy, Component, inject} from '@angular/core';
-import {KeycloakService} from 'keycloak-angular';
+import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
+import { KeycloakService } from 'keycloak-angular';
@Component({
selector: 'app-homepage',
diff --git a/frontend/src/app/landing-page/landing-page.component.ts b/frontend/src/app/landing-page/landing-page.component.ts
index eefe0d4..f7509cf 100644
--- a/frontend/src/app/landing-page/landing-page.component.ts
+++ b/frontend/src/app/landing-page/landing-page.component.ts
@@ -1,18 +1,18 @@
-import {Component, inject} from '@angular/core';
-import {KeycloakService} from 'keycloak-angular';
+import { Component, inject } from '@angular/core';
+import { KeycloakService } from 'keycloak-angular';
@Component({
- selector: 'app-landing-page',
- standalone: true,
- imports: [],
- templateUrl: './landing-page.component.html',
+ selector: 'app-landing-page',
+ standalone: true,
+ imports: [],
+ templateUrl: './landing-page.component.html',
})
export class LandingPageComponent {
- private keycloakService: KeycloakService = inject(KeycloakService);
+ private keycloakService: KeycloakService = inject(KeycloakService);
- login() {
- const baseUrl = window.location.origin;
+ login() {
+ const baseUrl = window.location.origin;
- this.keycloakService.login({redirectUri: `${baseUrl}/home`});
- }
+ this.keycloakService.login({ redirectUri: `${baseUrl}/home` });
+ }
}
--
2.47.2
From e270b8abe5379be569e75f16efca7e36c0170a86 Mon Sep 17 00:00:00 2001
From: Jan Klattenhoff
Date: Wed, 12 Feb 2025 11:11:35 +0100
Subject: [PATCH 003/176] ci: add CI workflow configuration file
---
.gitea/workflows/ci.yml | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 .gitea/workflows/ci.yml
diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml
new file mode 100644
index 0000000..c32dab9
--- /dev/null
+++ b/.gitea/workflows/ci.yml
@@ -0,0 +1,21 @@
+name: CI
+
+on:
+ pull_request:
+
+jobs:
+ test-build:
+ name: test-build
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: oven-sh/setup-bun@v2
+ - uses: actions/cache@v4
+ with:
+ path: |
+ ~/.npm
+ key: ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
+ restore-keys: |
+ ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-
+ - run: bun install
+ - run: bun run build
--
2.47.2
From d1aa0222a1167929a8177a144d8e6c24d252f12a Mon Sep 17 00:00:00 2001
From: Jan Klattenhoff
Date: Wed, 12 Feb 2025 11:13:45 +0100
Subject: [PATCH 004/176] ci: change runner to remote in CI configuration
---
.gitea/workflows/ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml
index c32dab9..158e66a 100644
--- a/.gitea/workflows/ci.yml
+++ b/.gitea/workflows/ci.yml
@@ -6,7 +6,7 @@ on:
jobs:
test-build:
name: test-build
- runs-on: ubuntu-latest
+ runs-on: remote
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
--
2.47.2
From cb80b041a63f5e46c9228bec4978ea69ed062df1 Mon Sep 17 00:00:00 2001
From: Jan Klattenhoff
Date: Wed, 12 Feb 2025 11:16:48 +0100
Subject: [PATCH 005/176] ci: update CI workflow to use new container image
---
.gitea/workflows/ci.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml
index 158e66a..6234d3a 100644
--- a/.gitea/workflows/ci.yml
+++ b/.gitea/workflows/ci.yml
@@ -7,6 +7,8 @@ jobs:
test-build:
name: test-build
runs-on: remote
+ container:
+ image: catthehacker/ubuntu:act-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
--
2.47.2
From f51d32ba5f315d191f55e7f74c06786b2c7505f0 Mon Sep 17 00:00:00 2001
From: Jan Klattenhoff
Date: Wed, 12 Feb 2025 11:20:51 +0100
Subject: [PATCH 006/176] ci: add cd command to frontend in CI workflow
---
.gitea/workflows/ci.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml
index 6234d3a..0f1e330 100644
--- a/.gitea/workflows/ci.yml
+++ b/.gitea/workflows/ci.yml
@@ -19,5 +19,6 @@ jobs:
key: ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-
+ - run: cd frontend
- run: bun install
- run: bun run build
--
2.47.2
From 3e1e42fa31874572da031d96c7b07cdab3dca4f5 Mon Sep 17 00:00:00 2001
From: Jan Klattenhoff
Date: Wed, 12 Feb 2025 11:21:56 +0100
Subject: [PATCH 007/176] ci: update CI script for better readability
---
.gitea/workflows/ci.yml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml
index 0f1e330..4b95517 100644
--- a/.gitea/workflows/ci.yml
+++ b/.gitea/workflows/ci.yml
@@ -19,6 +19,7 @@ jobs:
key: ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-
- - run: cd frontend
- - run: bun install
+ - run: |
+ cd frontend
+ bun install
- run: bun run build
--
2.47.2
From ac3c84106dbb27660a9d37da9c6e504341896fb5 Mon Sep 17 00:00:00 2001
From: Jan Klattenhoff
Date: Wed, 12 Feb 2025 11:23:38 +0100
Subject: [PATCH 008/176] ci: improve CI workflow with step names for clarity
---
.gitea/workflows/ci.yml | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml
index 4b95517..269ef51 100644
--- a/.gitea/workflows/ci.yml
+++ b/.gitea/workflows/ci.yml
@@ -10,16 +10,23 @@ jobs:
container:
image: catthehacker/ubuntu:act-latest
steps:
- - uses: actions/checkout@v4
- - uses: oven-sh/setup-bun@v2
- - uses: actions/cache@v4
+ - name: Checkout Code
+ uses: actions/checkout@v4
+ - name: Install bun
+ uses: oven-sh/setup-bun@v2
+ - name: Cache
+ uses: actions/cache@v4
with:
path: |
~/.npm
key: ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-
- - run: |
+ - name: Install dependencies
+ run: |
cd frontend
bun install
- - run: bun run build
+ - name: Test build
+ run: |
+ cd frontend
+ bun run build
--
2.47.2
From 343704959bc5e61b6d5454f1c47d04ec8e408b15 Mon Sep 17 00:00:00 2001
From: Jan Klattenhoff
Date: Wed, 12 Feb 2025 11:31:32 +0100
Subject: [PATCH 009/176] ci: update runner from remote to vps-4 in workflows
---
.gitea/workflows/ci.yml | 2 +-
.gitea/workflows/release.yml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml
index 269ef51..760e3f4 100644
--- a/.gitea/workflows/ci.yml
+++ b/.gitea/workflows/ci.yml
@@ -6,7 +6,7 @@ on:
jobs:
test-build:
name: test-build
- runs-on: remote
+ runs-on: vps-4
container:
image: catthehacker/ubuntu:act-latest
steps:
diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml
index 51e555c..fa827f3 100644
--- a/.gitea/workflows/release.yml
+++ b/.gitea/workflows/release.yml
@@ -13,7 +13,7 @@ permissions:
jobs:
release:
name: Release
- runs-on: remote
+ runs-on: vps-4
permissions:
contents: write
issues: write
--
2.47.2
From dc1482c3206823a834a355f915c53446f8a0c6c3 Mon Sep 17 00:00:00 2001
From: Jan Klattenhoff
Date: Wed, 12 Feb 2025 11:33:32 +0100
Subject: [PATCH 010/176] ci: add prettier job to CI workflow
---
.gitea/workflows/ci.yml | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml
index 760e3f4..e537b78 100644
--- a/.gitea/workflows/ci.yml
+++ b/.gitea/workflows/ci.yml
@@ -4,6 +4,33 @@ on:
pull_request:
jobs:
+ prettier:
+ name: prettier
+ runs-on: vps-4
+ container:
+ image: catthehacker/ubuntu:act-latest
+ steps:
+ - name: Checkout Code
+ uses: actions/checkout@v4
+ - name: Install bun
+ uses: oven-sh/setup-bun@v2
+ - name: Cache
+ uses: actions/cache@v4
+ with:
+ path: |
+ ~/.npm
+ key: ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
+ restore-keys: |
+ ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-
+ - name: Install dependencies
+ run: |
+ cd frontend
+ bun install
+ - name: Run prettier
+ run: |
+ cd frontend
+ bun run format:check
+
test-build:
name: test-build
runs-on: vps-4
--
2.47.2
From 2d955eed1afd621efe91fe229e8abc3d6abbb4dd Mon Sep 17 00:00:00 2001
From: Jan Klattenhoff
Date: Wed, 12 Feb 2025 11:36:45 +0100
Subject: [PATCH 011/176] ci: remove caching from CI workflow configuration
---
.gitea/workflows/ci.yml | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml
index e537b78..eaead1c 100644
--- a/.gitea/workflows/ci.yml
+++ b/.gitea/workflows/ci.yml
@@ -14,14 +14,6 @@ jobs:
uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v2
- - name: Cache
- uses: actions/cache@v4
- with:
- path: |
- ~/.npm
- key: ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
- restore-keys: |
- ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-
- name: Install dependencies
run: |
cd frontend
@@ -41,14 +33,6 @@ jobs:
uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v2
- - name: Cache
- uses: actions/cache@v4
- with:
- path: |
- ~/.npm
- key: ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
- restore-keys: |
- ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-
- name: Install dependencies
run: |
cd frontend
--
2.47.2
From 21bdbab1cf878cf7afead5580764dd023612601c Mon Sep 17 00:00:00 2001
From: Jan-Marlon Leibl
Date: Wed, 12 Feb 2025 11:45:12 +0100
Subject: [PATCH 012/176] style: Update CSS formatting and add theme variables
---
frontend/src/styles.css | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/frontend/src/styles.css b/frontend/src/styles.css
index 22329e3..b1ddff1 100644
--- a/frontend/src/styles.css
+++ b/frontend/src/styles.css
@@ -1,8 +1,12 @@
-@import 'tailwindcss';
+@import "tailwindcss";
-.btn-primary {
- @apply px-4 py-2 cursor-pointer relative font-bold rounded-lg transition-all duration-300 ease-out transform-gpu hover:scale-105 will-change-transform bg-gradient-to-r from-emerald-500 to-emerald-400 text-black hover:shadow-xl hover:shadow-emerald-500/20;
-}
-.btn-secondary {
- @apply px-4 py-2 cursor-pointer relative font-bold rounded-lg transition-all duration-300 ease-out transform-gpu hover:scale-105 will-change-transform bg-white/10 text-white hover:bg-white/20;
+@theme {
+ --color-deep-blue: #0F212E;
+ --color-deep-blue-light: #1A2C38;
+ --color-deep-blue-contrast: #1B2C3B;
+ --color-light-blue: #1475E1;
}
+
+body {
+ @apply bg-deep-blue text-gray-100;
+}
\ No newline at end of file
--
2.47.2
From aea34424b897d87a5f6414a59c296fb9d62f580f Mon Sep 17 00:00:00 2001
From: Jan-Marlon Leibl
Date: Wed, 12 Feb 2025 11:46:52 +0100
Subject: [PATCH 013/176] style: Update CSS syntax and fix color case
sensitivity
---
frontend/src/styles.css | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/frontend/src/styles.css b/frontend/src/styles.css
index b1ddff1..8de5d08 100644
--- a/frontend/src/styles.css
+++ b/frontend/src/styles.css
@@ -1,12 +1,12 @@
-@import "tailwindcss";
+@import 'tailwindcss';
@theme {
- --color-deep-blue: #0F212E;
- --color-deep-blue-light: #1A2C38;
- --color-deep-blue-contrast: #1B2C3B;
- --color-light-blue: #1475E1;
+ --color-deep-blue: #0f212e;
+ --color-deep-blue-light: #1a2c38;
+ --color-deep-blue-contrast: #1b2c3b;
+ --color-light-blue: #1475e1;
}
body {
- @apply bg-deep-blue text-gray-100;
-}
\ No newline at end of file
+ @apply bg-deep-blue text-gray-100;
+}
--
2.47.2
From 3a2b92b3ffc7dabeb57b27a06d9f642e2340c5c0 Mon Sep 17 00:00:00 2001
From: Phan Huy Tran
Date: Wed, 12 Feb 2025 12:19:31 +0100
Subject: [PATCH 014/176] feat: Convert login button to hompage button when
user is authenticated
---
.../src/app/landing-page/landing-page.component.html | 6 +++++-
.../src/app/landing-page/landing-page.component.ts | 12 ++++++++++--
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/frontend/src/app/landing-page/landing-page.component.html b/frontend/src/app/landing-page/landing-page.component.html
index aa8bbd8..944881c 100644
--- a/frontend/src/app/landing-page/landing-page.component.html
+++ b/frontend/src/app/landing-page/landing-page.component.html
@@ -1 +1,5 @@
-
+@if (isLoggedIn) {
+
+} @else {
+
+}
diff --git a/frontend/src/app/landing-page/landing-page.component.ts b/frontend/src/app/landing-page/landing-page.component.ts
index f7509cf..f5fee0c 100644
--- a/frontend/src/app/landing-page/landing-page.component.ts
+++ b/frontend/src/app/landing-page/landing-page.component.ts
@@ -1,16 +1,24 @@
import { Component, inject } from '@angular/core';
import { KeycloakService } from 'keycloak-angular';
+import {RouterLink} from "@angular/router";
@Component({
selector: 'app-landing-page',
standalone: true,
- imports: [],
+ imports: [
+ RouterLink
+ ],
templateUrl: './landing-page.component.html',
})
export class LandingPageComponent {
+ public isLoggedIn = false;
private keycloakService: KeycloakService = inject(KeycloakService);
- login() {
+ private ngOnInit() {
+ this.isLoggedIn = this.keycloakService.isLoggedIn();
+ }
+
+ public login() {
const baseUrl = window.location.origin;
this.keycloakService.login({ redirectUri: `${baseUrl}/home` });
--
2.47.2
From 22086a88fae7a5806eb31106b30a4a4e1606c192 Mon Sep 17 00:00:00 2001
From: Phan Huy Tran
Date: Wed, 12 Feb 2025 12:20:57 +0100
Subject: [PATCH 015/176] style: Run prettier
---
frontend/src/app/landing-page/landing-page.component.html | 4 ++--
frontend/src/app/landing-page/landing-page.component.ts | 6 ++----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/frontend/src/app/landing-page/landing-page.component.html b/frontend/src/app/landing-page/landing-page.component.html
index 944881c..80d5974 100644
--- a/frontend/src/app/landing-page/landing-page.component.html
+++ b/frontend/src/app/landing-page/landing-page.component.html
@@ -1,5 +1,5 @@
@if (isLoggedIn) {
-
+
} @else {
-
+
}
diff --git a/frontend/src/app/landing-page/landing-page.component.ts b/frontend/src/app/landing-page/landing-page.component.ts
index f5fee0c..3b6292b 100644
--- a/frontend/src/app/landing-page/landing-page.component.ts
+++ b/frontend/src/app/landing-page/landing-page.component.ts
@@ -1,13 +1,11 @@
import { Component, inject } from '@angular/core';
import { KeycloakService } from 'keycloak-angular';
-import {RouterLink} from "@angular/router";
+import { RouterLink } from '@angular/router';
@Component({
selector: 'app-landing-page',
standalone: true,
- imports: [
- RouterLink
- ],
+ imports: [RouterLink],
templateUrl: './landing-page.component.html',
})
export class LandingPageComponent {
--
2.47.2
From ab3bc5587eeed0197d4df7bb83410e196879be9f Mon Sep 17 00:00:00 2001
From: Phan Huy Tran
Date: Wed, 12 Feb 2025 12:33:52 +0100
Subject: [PATCH 016/176] refactor: remove oninit
---
frontend/src/app/landing-page/landing-page.component.ts | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/frontend/src/app/landing-page/landing-page.component.ts b/frontend/src/app/landing-page/landing-page.component.ts
index 3b6292b..1291434 100644
--- a/frontend/src/app/landing-page/landing-page.component.ts
+++ b/frontend/src/app/landing-page/landing-page.component.ts
@@ -9,12 +9,9 @@ import { RouterLink } from '@angular/router';
templateUrl: './landing-page.component.html',
})
export class LandingPageComponent {
- public isLoggedIn = false;
private keycloakService: KeycloakService = inject(KeycloakService);
- private ngOnInit() {
- this.isLoggedIn = this.keycloakService.isLoggedIn();
- }
+ public isLoggedIn = this.keycloakService.isLoggedIn();
public login() {
const baseUrl = window.location.origin;
--
2.47.2
From 177dd7859241e3d98349e5c45e807af0351a824f Mon Sep 17 00:00:00 2001
From: Constantin Simonis
Date: Thu, 13 Feb 2025 09:42:42 +0100
Subject: [PATCH 017/176] wip
---
backend/build.gradle.kts | 1 +
.../casino/deposit/DepositController.java | 48 +++++++++++++++++++
.../de/szut/casino/deposit/dto/AmountDto.java | 21 ++++++++
.../szut/casino/deposit/dto/SessionIdDto.java | 21 ++++++++
.../src/main/resources/application.properties | 2 +-
frontend/bun.lock | 3 ++
frontend/package.json | 1 +
frontend/src/app/app.routes.ts | 6 +++
.../src/app/deposit/deposit.component.css | 0
.../src/app/deposit/deposit.component.html | 14 ++++++
frontend/src/app/deposit/deposit.component.ts | 32 +++++++++++++
11 files changed, 148 insertions(+), 1 deletion(-)
create mode 100644 backend/src/main/java/de/szut/casino/deposit/DepositController.java
create mode 100644 backend/src/main/java/de/szut/casino/deposit/dto/AmountDto.java
create mode 100644 backend/src/main/java/de/szut/casino/deposit/dto/SessionIdDto.java
create mode 100644 frontend/src/app/deposit/deposit.component.css
create mode 100644 frontend/src/app/deposit/deposit.component.html
create mode 100644 frontend/src/app/deposit/deposit.component.ts
diff --git a/backend/build.gradle.kts b/backend/build.gradle.kts
index f10394a..565e524 100644
--- a/backend/build.gradle.kts
+++ b/backend/build.gradle.kts
@@ -24,6 +24,7 @@ repositories {
}
dependencies {
+ implementation("com.stripe:stripe-java:20.79.0")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-web")
compileOnly("org.projectlombok:lombok")
diff --git a/backend/src/main/java/de/szut/casino/deposit/DepositController.java b/backend/src/main/java/de/szut/casino/deposit/DepositController.java
new file mode 100644
index 0000000..c7c85a8
--- /dev/null
+++ b/backend/src/main/java/de/szut/casino/deposit/DepositController.java
@@ -0,0 +1,48 @@
+package de.szut.casino.deposit;
+
+import com.stripe.Stripe;
+import com.stripe.exception.StripeException;
+import com.stripe.model.checkout.Session;
+import com.stripe.param.InvoiceItemCreateParams;
+import com.stripe.param.PriceCreateParams;
+import com.stripe.param.checkout.SessionCreateParams;
+import de.szut.casino.deposit.dto.AmountDto;
+import de.szut.casino.deposit.dto.SessionIdDto;
+import org.springframework.boot.autoconfigure.cassandra.CassandraProperties;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+public class DepositController {
+ @PostMapping("/deposit/checkout")
+ public ResponseEntity extends Object> checkout(@RequestBody AmountDto amountDto) {
+ Stripe.apiKey = "sk_test_51QrePYIvCfqz7ANgqam8rEwWcMeKiLOof3j6SCMgu2sl4sESP45DJxca16mWcYo1sQaiBv32CMR6Z4AAAGQPCJo300ubuZKO8I";
+ try {
+ SessionCreateParams params = SessionCreateParams.builder()
+ .addLineItem(SessionCreateParams.LineItem.builder()
+ .setPriceData(InvoiceItemCreateParams.PriceData.builder()
+ .setCurrency("EUR")
+ .setUnitAmount(1L)
+ .build()
+ )
+ .build())
+ .setSuccessUrl("http://localhost:8080/deposit/success")
+ .setMode(SessionCreateParams.Mode.PAYMENT)
+ .build();
+ try {
+ Session session = Session.create(params);
+
+ return ResponseEntity.ok(new SessionIdDto(session.getId()));
+ } catch (StripeException e) {
+ return ResponseEntity.ok(e);
+ }
+ } catch (Exception e) {
+ return ResponseEntity.ok(e);
+ }
+
+ }
+}
+
diff --git a/backend/src/main/java/de/szut/casino/deposit/dto/AmountDto.java b/backend/src/main/java/de/szut/casino/deposit/dto/AmountDto.java
new file mode 100644
index 0000000..7996d85
--- /dev/null
+++ b/backend/src/main/java/de/szut/casino/deposit/dto/AmountDto.java
@@ -0,0 +1,21 @@
+package de.szut.casino.deposit.dto;
+
+public class AmountDto {
+ private double amount;
+
+ public AmountDto() {
+ }
+
+ public AmountDto(double amount) {
+ this.amount = amount;
+ }
+
+ public double getAmount() {
+ return amount;
+ }
+
+ public void setAmount(double amount) {
+ this.amount = amount;
+ }
+}
+
diff --git a/backend/src/main/java/de/szut/casino/deposit/dto/SessionIdDto.java b/backend/src/main/java/de/szut/casino/deposit/dto/SessionIdDto.java
new file mode 100644
index 0000000..67ade61
--- /dev/null
+++ b/backend/src/main/java/de/szut/casino/deposit/dto/SessionIdDto.java
@@ -0,0 +1,21 @@
+package de.szut.casino.deposit.dto;
+
+public class SessionIdDto {
+ private String sessionId;
+
+ public SessionIdDto() {
+ }
+
+ public SessionIdDto(String sessionId) {
+ this.sessionId = sessionId;
+ }
+
+ public String getSessionId() {
+ return sessionId;
+ }
+
+ public void setSessionId(String sessionId) {
+ this.sessionId = sessionId;
+ }
+}
+
diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties
index d668f7a..938ce25 100644
--- a/backend/src/main/resources/application.properties
+++ b/backend/src/main/resources/application.properties
@@ -1,4 +1,4 @@
-spring.datasource.url=jdbc:postgresql://${DB_HOST:-localhost}:5432/postgresdb
+spring.datasource.url=jdbc:postgresql://localhost:5432/postgresdb
spring.datasource.username=postgres_user
spring.datasource.password=postgres_pass
server.port=8080
diff --git a/frontend/bun.lock b/frontend/bun.lock
index 5011117..d2559e9 100644
--- a/frontend/bun.lock
+++ b/frontend/bun.lock
@@ -12,6 +12,7 @@
"@angular/platform-browser": "^18.2.0",
"@angular/platform-browser-dynamic": "^18.2.0",
"@angular/router": "^18.2.0",
+ "@stripe/stripe-js": "^5.6.0",
"@tailwindcss/postcss": "^4.0.3",
"keycloak-angular": "^16.0.1",
"keycloak-js": "^25.0.5",
@@ -489,6 +490,8 @@
"@socket.io/component-emitter": ["@socket.io/component-emitter@3.1.2", "", {}, "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA=="],
+ "@stripe/stripe-js": ["@stripe/stripe-js@5.6.0", "", {}, "sha512-w8CEY73X/7tw2KKlL3iOk679V9bWseE4GzNz3zlaYxcTjmcmWOathRb0emgo/QQ3eoNzmq68+2Y2gxluAv3xGw=="],
+
"@tailwindcss/node": ["@tailwindcss/node@4.0.3", "", { "dependencies": { "enhanced-resolve": "^5.18.0", "jiti": "^2.4.2", "tailwindcss": "4.0.3" } }, "sha512-QsVJokOl0pJ4AbJV33D2npvLcHGPWi5MOSZtrtE0GT3tSx+3D0JE2lokLA8yHS1x3oCY/3IyRyy7XX6tmzid7A=="],
"@tailwindcss/oxide": ["@tailwindcss/oxide@4.0.3", "", { "optionalDependencies": { "@tailwindcss/oxide-android-arm64": "4.0.3", "@tailwindcss/oxide-darwin-arm64": "4.0.3", "@tailwindcss/oxide-darwin-x64": "4.0.3", "@tailwindcss/oxide-freebsd-x64": "4.0.3", "@tailwindcss/oxide-linux-arm-gnueabihf": "4.0.3", "@tailwindcss/oxide-linux-arm64-gnu": "4.0.3", "@tailwindcss/oxide-linux-arm64-musl": "4.0.3", "@tailwindcss/oxide-linux-x64-gnu": "4.0.3", "@tailwindcss/oxide-linux-x64-musl": "4.0.3", "@tailwindcss/oxide-win32-arm64-msvc": "4.0.3", "@tailwindcss/oxide-win32-x64-msvc": "4.0.3" } }, "sha512-FFcp3VNvRjjmFA39ORM27g2mbflMQljhvM7gxBAujHxUy4LXlKa6yMF9wbHdTbPqTONiCyyOYxccvJyVyI/XBg=="],
diff --git a/frontend/package.json b/frontend/package.json
index 962c3f0..4840fd1 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -20,6 +20,7 @@
"@angular/platform-browser": "^18.2.0",
"@angular/platform-browser-dynamic": "^18.2.0",
"@angular/router": "^18.2.0",
+ "@stripe/stripe-js": "^5.6.0",
"@tailwindcss/postcss": "^4.0.3",
"keycloak-angular": "^16.0.1",
"keycloak-js": "^25.0.5",
diff --git a/frontend/src/app/app.routes.ts b/frontend/src/app/app.routes.ts
index 02b958c..90b84b0 100644
--- a/frontend/src/app/app.routes.ts
+++ b/frontend/src/app/app.routes.ts
@@ -2,6 +2,7 @@ import { Routes } from '@angular/router';
import { LandingPageComponent } from './landing-page/landing-page.component';
import { HomepageComponent } from './homepage/homepage/homepage.component';
import { authGuard } from './auth.guard';
+import { DepositComponent } from './deposit/deposit.component';
export const routes: Routes = [
{
@@ -13,4 +14,9 @@ export const routes: Routes = [
component: HomepageComponent,
canActivate: [authGuard],
},
+ {
+ path: 'deposit',
+ component: DepositComponent,
+ canActivate: [authGuard],
+ }
];
diff --git a/frontend/src/app/deposit/deposit.component.css b/frontend/src/app/deposit/deposit.component.css
new file mode 100644
index 0000000..e69de29
diff --git a/frontend/src/app/deposit/deposit.component.html b/frontend/src/app/deposit/deposit.component.html
new file mode 100644
index 0000000..f3bbbb2
--- /dev/null
+++ b/frontend/src/app/deposit/deposit.component.html
@@ -0,0 +1,14 @@
+
diff --git a/frontend/src/app/deposit/deposit.component.ts b/frontend/src/app/deposit/deposit.component.ts
new file mode 100644
index 0000000..f28c694
--- /dev/null
+++ b/frontend/src/app/deposit/deposit.component.ts
@@ -0,0 +1,32 @@
+import { Component, OnInit } from '@angular/core';
+import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
+import { loadStripe, Stripe } from '@stripe/stripe-js';
+
+@Component({
+ selector: 'app-deposit',
+ standalone: true,
+ imports: [
+ ReactiveFormsModule,
+ ],
+ templateUrl: './deposit.component.html',
+ styleUrl: './deposit.component.css'
+})
+export class DepositComponent implements OnInit{
+ protected form = new FormGroup({amount: new FormControl(50, [Validators.min(50)])});
+ private stripe: Stripe | null;
+
+ async ngOnInit() {
+ this.stripe = await loadStripe('pk_test_51');
+ }
+
+ submit() {
+ if (this.stripe) {
+ fetch('/backend/deposit/checkout', {
+ method: 'POST',
+ body: JSON.stringify(this.form.value),
+ }).then(response => response.json()).then(response => {
+ this.stripe?.redirectToCheckout({sessionId: response.sessionId});
+ });
+ }
+ }
+}
--
2.47.2
From 1d0162d250e132eaab746f5bc71222376b30aa48 Mon Sep 17 00:00:00 2001
From: Constantin Simonis
Date: Thu, 13 Feb 2025 10:22:33 +0100
Subject: [PATCH 018/176] feat: make stripe functional
---
.../casino/deposit/DepositController.java | 44 +++++++++----------
.../de/szut/casino/deposit/dto/AmountDto.java | 26 +++++------
.../src/main/resources/application.properties | 2 +-
.../src/app/deposit/deposit.component.html | 9 ----
frontend/src/app/deposit/deposit.component.ts | 16 +++----
frontend/src/app/service/deposit.service.ts | 15 +++++++
6 files changed, 56 insertions(+), 56 deletions(-)
create mode 100644 frontend/src/app/service/deposit.service.ts
diff --git a/backend/src/main/java/de/szut/casino/deposit/DepositController.java b/backend/src/main/java/de/szut/casino/deposit/DepositController.java
index c7c85a8..965946c 100644
--- a/backend/src/main/java/de/szut/casino/deposit/DepositController.java
+++ b/backend/src/main/java/de/szut/casino/deposit/DepositController.java
@@ -8,6 +8,8 @@ import com.stripe.param.PriceCreateParams;
import com.stripe.param.checkout.SessionCreateParams;
import de.szut.casino.deposit.dto.AmountDto;
import de.szut.casino.deposit.dto.SessionIdDto;
+import jakarta.validation.Valid;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.cassandra.CassandraProperties;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
@@ -17,32 +19,28 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
public class DepositController {
+
+ @Value("${stripe.secret.key}")
+ private String stripeKey;
+
@PostMapping("/deposit/checkout")
- public ResponseEntity extends Object> checkout(@RequestBody AmountDto amountDto) {
- Stripe.apiKey = "sk_test_51QrePYIvCfqz7ANgqam8rEwWcMeKiLOof3j6SCMgu2sl4sESP45DJxca16mWcYo1sQaiBv32CMR6Z4AAAGQPCJo300ubuZKO8I";
- try {
- SessionCreateParams params = SessionCreateParams.builder()
- .addLineItem(SessionCreateParams.LineItem.builder()
- .setPriceData(InvoiceItemCreateParams.PriceData.builder()
- .setCurrency("EUR")
- .setUnitAmount(1L)
- .build()
- )
- .build())
- .setSuccessUrl("http://localhost:8080/deposit/success")
- .setMode(SessionCreateParams.Mode.PAYMENT)
- .build();
- try {
- Session session = Session.create(params);
+ public ResponseEntity checkout(@RequestBody @Valid AmountDto amountDto) throws StripeException {
+ Stripe.apiKey = stripeKey;
- return ResponseEntity.ok(new SessionIdDto(session.getId()));
- } catch (StripeException e) {
- return ResponseEntity.ok(e);
- }
- } catch (Exception e) {
- return ResponseEntity.ok(e);
- }
+ SessionCreateParams params = SessionCreateParams.builder()
+ .addLineItem(SessionCreateParams.LineItem.builder()
+ .setAmount((long) amountDto.getAmount() * 100)
+ .setCurrency("EUR")
+ .setQuantity(1L)
+ .setName("Einzahlung")
+ .build())
+ .setSuccessUrl("http://localhost:8080/deposit/success")
+ .setMode(SessionCreateParams.Mode.PAYMENT)
+ .build();
+ Session session = Session.create(params);
+
+ return ResponseEntity.ok(new SessionIdDto(session.getId()));
}
}
diff --git a/backend/src/main/java/de/szut/casino/deposit/dto/AmountDto.java b/backend/src/main/java/de/szut/casino/deposit/dto/AmountDto.java
index 7996d85..1f1708e 100644
--- a/backend/src/main/java/de/szut/casino/deposit/dto/AmountDto.java
+++ b/backend/src/main/java/de/szut/casino/deposit/dto/AmountDto.java
@@ -1,21 +1,17 @@
package de.szut.casino.deposit.dto;
+import jakarta.validation.constraints.Min;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Setter
+@Getter
+@AllArgsConstructor
+@NoArgsConstructor
public class AmountDto {
+ @Min(50)
private double amount;
-
- public AmountDto() {
- }
-
- public AmountDto(double amount) {
- this.amount = amount;
- }
-
- public double getAmount() {
- return amount;
- }
-
- public void setAmount(double amount) {
- this.amount = amount;
- }
}
diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties
index 938ce25..7f00727 100644
--- a/backend/src/main/resources/application.properties
+++ b/backend/src/main/resources/application.properties
@@ -3,7 +3,7 @@ spring.datasource.username=postgres_user
spring.datasource.password=postgres_pass
server.port=8080
spring.jpa.hibernate.ddl-auto=create-drop
-
+stripe.secret.key=sk_test_51QrePYIvCfqz7ANgqam8rEwWcMeKiLOof3j6SCMgu2sl4sESP45DJxca16mWcYo1sQaiBv32CMR6Z4AAAGQPCJo300ubuZKO8I
spring.application.name=lf12_starter
#client registration configuration
diff --git a/frontend/src/app/deposit/deposit.component.html b/frontend/src/app/deposit/deposit.component.html
index f3bbbb2..7476f8e 100644
--- a/frontend/src/app/deposit/deposit.component.html
+++ b/frontend/src/app/deposit/deposit.component.html
@@ -1,14 +1,5 @@
diff --git a/frontend/src/app/deposit/deposit.component.ts b/frontend/src/app/deposit/deposit.component.ts
index f28c694..6667dcd 100644
--- a/frontend/src/app/deposit/deposit.component.ts
+++ b/frontend/src/app/deposit/deposit.component.ts
@@ -1,6 +1,7 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, inject, OnInit } from '@angular/core';
import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
import { loadStripe, Stripe } from '@stripe/stripe-js';
+import { DepositService } from '../service/deposit.service';
@Component({
selector: 'app-deposit',
@@ -13,19 +14,18 @@ import { loadStripe, Stripe } from '@stripe/stripe-js';
})
export class DepositComponent implements OnInit{
protected form = new FormGroup({amount: new FormControl(50, [Validators.min(50)])});
- private stripe: Stripe | null;
+ private stripe: Stripe | null = null;
+ private service: DepositService = inject(DepositService);
async ngOnInit() {
- this.stripe = await loadStripe('pk_test_51');
+ this.stripe = await loadStripe('pk_test_51QrePYIvCfqz7ANgMizBorPpVjJ8S6gcaL4yvcMQnVaKyReqcQ6jqaQEF7aDZbDu8rNVsTZrw8ABek4ToxQX7KZe00jpGh8naG');
}
submit() {
if (this.stripe) {
- fetch('/backend/deposit/checkout', {
- method: 'POST',
- body: JSON.stringify(this.form.value),
- }).then(response => response.json()).then(response => {
- this.stripe?.redirectToCheckout({sessionId: response.sessionId});
+ console.log(JSON.stringify(this.form.value.amount as number));
+ this.service.handleDeposit(this.form.value.amount as number).subscribe(({sessionId}) => {
+ this.stripe?.redirectToCheckout({sessionId});
});
}
}
diff --git a/frontend/src/app/service/deposit.service.ts b/frontend/src/app/service/deposit.service.ts
new file mode 100644
index 0000000..7dd8b78
--- /dev/null
+++ b/frontend/src/app/service/deposit.service.ts
@@ -0,0 +1,15 @@
+import { inject, Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { Observable } from 'rxjs';
+
+
+@Injectable({
+ providedIn: 'root'
+})
+export class DepositService {
+ private http: HttpClient = inject(HttpClient);
+
+ handleDeposit(amount: number): Observable<{ sessionId: string }> {
+ return this.http.post<{sessionId: string}>('/backend/deposit/checkout', {amount});
+ }
+}
--
2.47.2
From 6ba4937538b102a2e4b9cb2c730c3dbc7f4a1e11 Mon Sep 17 00:00:00 2001
From: Constantin Simonis
Date: Thu, 13 Feb 2025 10:29:08 +0100
Subject: [PATCH 019/176] feat: add form validation
---
.../src/app/deposit/deposit.component.html | 3 ++
frontend/src/app/deposit/deposit.component.ts | 39 ++++++++++++++-----
2 files changed, 33 insertions(+), 9 deletions(-)
diff --git a/frontend/src/app/deposit/deposit.component.html b/frontend/src/app/deposit/deposit.component.html
index 7476f8e..a24f3b3 100644
--- a/frontend/src/app/deposit/deposit.component.html
+++ b/frontend/src/app/deposit/deposit.component.html
@@ -1,4 +1,7 @@
diff --git a/frontend/src/app/deposit/deposit.component.ts b/frontend/src/app/deposit/deposit.component.ts
index db6d41a..0da8395 100644
--- a/frontend/src/app/deposit/deposit.component.ts
+++ b/frontend/src/app/deposit/deposit.component.ts
@@ -7,9 +7,7 @@ import { debounceTime } from 'rxjs';
@Component({
selector: 'app-deposit',
standalone: true,
- imports: [
- ReactiveFormsModule,
- ],
+ imports: [ReactiveFormsModule],
templateUrl: './deposit.component.html',
styleUrl: './deposit.component.css',
changeDetection: ChangeDetectionStrategy.OnPush,
@@ -25,15 +23,15 @@ export class DepositComponent implements OnInit {
amount: new FormControl(50, [Validators.min(50)]),
});
- this.form.controls['amount'].valueChanges
- .pipe(debounceTime(1000))
- .subscribe((value) => {
- if (value < 50) {
- this.errorMsg = 'Minimum Einzahlungsbetrag ist 50€';
- }
- });
+ this.form.controls['amount'].valueChanges.pipe(debounceTime(1000)).subscribe((value) => {
+ if (value < 50) {
+ this.errorMsg = 'Minimum Einzahlungsbetrag ist 50€';
+ }
+ });
- this.stripe = await loadStripe('pk_test_51QrePYIvCfqz7ANgMizBorPpVjJ8S6gcaL4yvcMQnVaKyReqcQ6jqaQEF7aDZbDu8rNVsTZrw8ABek4ToxQX7KZe00jpGh8naG');
+ this.stripe = await loadStripe(
+ 'pk_test_51QrePYIvCfqz7ANgMizBorPpVjJ8S6gcaL4yvcMQnVaKyReqcQ6jqaQEF7aDZbDu8rNVsTZrw8ABek4ToxQX7KZe00jpGh8naG'
+ );
}
submit() {
diff --git a/frontend/src/app/service/deposit.service.ts b/frontend/src/app/service/deposit.service.ts
index 7dd8b78..02c8ea1 100644
--- a/frontend/src/app/service/deposit.service.ts
+++ b/frontend/src/app/service/deposit.service.ts
@@ -2,14 +2,13 @@ import { inject, Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
-
@Injectable({
- providedIn: 'root'
+ providedIn: 'root',
})
export class DepositService {
private http: HttpClient = inject(HttpClient);
handleDeposit(amount: number): Observable<{ sessionId: string }> {
- return this.http.post<{sessionId: string}>('/backend/deposit/checkout', {amount});
+ return this.http.post<{ sessionId: string }>('/backend/deposit/checkout', { amount });
}
}
--
2.47.2
From 9a63954e4bd787615c3436646ae80dca16be5789 Mon Sep 17 00:00:00 2001
From: Jan Klattenhoff
Date: Thu, 13 Feb 2025 10:30:46 +0100
Subject: [PATCH 021/176] build: update release configuration for plugins and
rules
---
release.config.cjs | 75 ++++++++++++++++++++++++++++++++++++++--------
1 file changed, 62 insertions(+), 13 deletions(-)
diff --git a/release.config.cjs b/release.config.cjs
index e09738f..b6f007d 100644
--- a/release.config.cjs
+++ b/release.config.cjs
@@ -1,15 +1,64 @@
module.exports = {
-
- branches: ['main'],
- plugins: [
- '@semantic-release/commit-analyzer',
- '@semantic-release/release-notes-generator',
- '@semantic-release/changelog',
- ["@saithodev/semantic-release-gitea", {
- "giteaUrl": "https://git.simonis.lol"
- }],
+ branches: ["main"],
+ plugins: [
+ [
+ "@semantic-release/commit-analyzer",
+ {
+ preset: "angular",
+ releaseRules: [
+ { type: "feat", release: "minor" },
+ { type: "fix", release: "patch" },
+ { type: "perf", release: "patch" },
+ { type: "docs", release: "patch" },
+ { type: "style", release: "patch" },
+ { type: "refactor", release: "patch" },
+ { type: "test", release: "patch" },
+ { type: "chore", release: "patch" },
+ { type: "ci", release: "patch" },
+ { type: "build", release: "patch" },
+ { type: "revert", release: "patch" },
+ ],
+ },
],
- };
-
-
-
\ No newline at end of file
+ [
+ "@semantic-release/release-notes-generator",
+ {
+ preset: "conventionalcommits",
+ presetConfig: {
+ types: [
+ { type: "feat", section: "Features", hidden: false },
+ { type: "fix", section: "Bug Fixes", hidden: false },
+ {
+ type: "perf",
+ section: "Performance Improvements",
+ hidden: false,
+ },
+ { type: "docs", section: "Documentation", hidden: false },
+ { type: "style", section: "Code Style", hidden: false },
+ { type: "refactor", section: "Code Refactoring", hidden: false },
+ { type: "test", section: "Tests", hidden: false },
+ { type: "chore", section: "Chores", hidden: false },
+ { type: "ci", section: "Continuous Integration", hidden: false },
+ { type: "build", section: "Build System", hidden: false },
+ { type: "revert", section: "Reverts", hidden: false },
+ ],
+ },
+ parserOpts: {
+ noteKeywords: ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"],
+ },
+ },
+ ],
+ [
+ "@semantic-release/changelog",
+ {
+ changelogFile: "CHANGELOG.md",
+ },
+ ],
+ [
+ "@saithodev/semantic-release-gitea",
+ {
+ giteaUrl: "https://git.simonis.lol",
+ },
+ ],
+ ],
+};
--
2.47.2
From c4252c97e7d60702b635ac67102d4919466ed5f4 Mon Sep 17 00:00:00 2001
From: Constantin Simonis
Date: Thu, 13 Feb 2025 10:33:06 +0100
Subject: [PATCH 022/176] refactor: refactor application.properties
---
backend/src/main/resources/application.properties | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties
index 7f00727..268279f 100644
--- a/backend/src/main/resources/application.properties
+++ b/backend/src/main/resources/application.properties
@@ -1,9 +1,9 @@
-spring.datasource.url=jdbc:postgresql://localhost:5432/postgresdb
+spring.datasource.url=jdbc:postgresql://${DB_HOST:localhost}:5432/postgresdb
spring.datasource.username=postgres_user
spring.datasource.password=postgres_pass
server.port=8080
spring.jpa.hibernate.ddl-auto=create-drop
-stripe.secret.key=sk_test_51QrePYIvCfqz7ANgqam8rEwWcMeKiLOof3j6SCMgu2sl4sESP45DJxca16mWcYo1sQaiBv32CMR6Z4AAAGQPCJo300ubuZKO8I
+stripe.secret.key=${STRIPE_SECRET_KEY:sk_test_51QrePYIvCfqz7ANgqam8rEwWcMeKiLOof3j6SCMgu2sl4sESP45DJxca16mWcYo1sQaiBv32CMR6Z4AAAGQPCJo300ubuZKO8I}
spring.application.name=lf12_starter
#client registration configuration
--
2.47.2
From 704cc22858953f7babb5f906c3436c294024f93f Mon Sep 17 00:00:00 2001
From: Phan Huy Tran
Date: Thu, 13 Feb 2025 10:29:13 +0100
Subject: [PATCH 023/176] refactor: Redirect to orginal route after login,
restructure project files
---
frontend/src/app/app.routes.ts | 8 ++++----
frontend/src/app/auth.guard.ts | 14 +++++++++++---
.../home/home.component.html} | 0
.../home/home.component.ts} | 4 ++--
.../landing/landing.component.html} | 0
.../landing/landing.component.ts} | 6 +++---
6 files changed, 20 insertions(+), 12 deletions(-)
rename frontend/src/app/{homepage/homepage/homepage.component.html => feature/home/home.component.html} (100%)
rename frontend/src/app/{homepage/homepage/homepage.component.ts => feature/home/home.component.ts} (85%)
rename frontend/src/app/{landing-page/landing-page.component.html => feature/landing/landing.component.html} (100%)
rename frontend/src/app/{landing-page/landing-page.component.ts => feature/landing/landing.component.ts} (80%)
diff --git a/frontend/src/app/app.routes.ts b/frontend/src/app/app.routes.ts
index 02b958c..73ed20c 100644
--- a/frontend/src/app/app.routes.ts
+++ b/frontend/src/app/app.routes.ts
@@ -1,16 +1,16 @@
import { Routes } from '@angular/router';
-import { LandingPageComponent } from './landing-page/landing-page.component';
-import { HomepageComponent } from './homepage/homepage/homepage.component';
+import { LandingComponent } from './feature/landing/landing.component';
+import { HomeComponent } from './feature/home/home.component';
import { authGuard } from './auth.guard';
export const routes: Routes = [
{
path: '',
- component: LandingPageComponent,
+ component: LandingComponent,
},
{
path: 'home',
- component: HomepageComponent,
+ component: HomeComponent,
canActivate: [authGuard],
},
];
diff --git a/frontend/src/app/auth.guard.ts b/frontend/src/app/auth.guard.ts
index cb2cbe9..0743ff6 100644
--- a/frontend/src/app/auth.guard.ts
+++ b/frontend/src/app/auth.guard.ts
@@ -1,8 +1,11 @@
-import { CanActivateFn } from '@angular/router';
+import { ActivatedRouteSnapshot, CanActivateFn, RouterStateSnapshot } from '@angular/router';
import { inject } from '@angular/core';
import { KeycloakService } from 'keycloak-angular';
-export const authGuard: CanActivateFn = async () => {
+export const authGuard: CanActivateFn = async (
+ route: ActivatedRouteSnapshot,
+ state: RouterStateSnapshot
+) => {
const keycloakService = inject(KeycloakService);
const isLoggedIn = keycloakService.isLoggedIn();
@@ -10,6 +13,11 @@ export const authGuard: CanActivateFn = async () => {
return true;
}
- keycloakService.login();
+ const baseurl = window.location.origin;
+
+ keycloakService.login({
+ redirectUri: `${baseurl}${state.url}`,
+ });
+
return false;
};
diff --git a/frontend/src/app/homepage/homepage/homepage.component.html b/frontend/src/app/feature/home/home.component.html
similarity index 100%
rename from frontend/src/app/homepage/homepage/homepage.component.html
rename to frontend/src/app/feature/home/home.component.html
diff --git a/frontend/src/app/homepage/homepage/homepage.component.ts b/frontend/src/app/feature/home/home.component.ts
similarity index 85%
rename from frontend/src/app/homepage/homepage/homepage.component.ts
rename to frontend/src/app/feature/home/home.component.ts
index ff894dc..06aa423 100644
--- a/frontend/src/app/homepage/homepage/homepage.component.ts
+++ b/frontend/src/app/feature/home/home.component.ts
@@ -5,10 +5,10 @@ import { KeycloakService } from 'keycloak-angular';
selector: 'app-homepage',
standalone: true,
imports: [],
- templateUrl: './homepage.component.html',
+ templateUrl: './home.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
-export class HomepageComponent {
+export class HomeComponent {
private keycloakService: KeycloakService = inject(KeycloakService);
logout() {
diff --git a/frontend/src/app/landing-page/landing-page.component.html b/frontend/src/app/feature/landing/landing.component.html
similarity index 100%
rename from frontend/src/app/landing-page/landing-page.component.html
rename to frontend/src/app/feature/landing/landing.component.html
diff --git a/frontend/src/app/landing-page/landing-page.component.ts b/frontend/src/app/feature/landing/landing.component.ts
similarity index 80%
rename from frontend/src/app/landing-page/landing-page.component.ts
rename to frontend/src/app/feature/landing/landing.component.ts
index 1291434..d2e28c0 100644
--- a/frontend/src/app/landing-page/landing-page.component.ts
+++ b/frontend/src/app/feature/landing/landing.component.ts
@@ -3,12 +3,12 @@ import { KeycloakService } from 'keycloak-angular';
import { RouterLink } from '@angular/router';
@Component({
- selector: 'app-landing-page',
+ selector: 'app-landing',
standalone: true,
imports: [RouterLink],
- templateUrl: './landing-page.component.html',
+ templateUrl: './landing.component.html',
})
-export class LandingPageComponent {
+export class LandingComponent {
private keycloakService: KeycloakService = inject(KeycloakService);
public isLoggedIn = this.keycloakService.isLoggedIn();
--
2.47.2
From da01e272d71857fc5c447c9b47ad1c6aa7a1177c Mon Sep 17 00:00:00 2001
From: Constantin Simonis
Date: Thu, 13 Feb 2025 10:38:32 +0100
Subject: [PATCH 024/176] refactor: outsource stripe key to environment
---
frontend/src/app/deposit/deposit.component.ts | 5 ++---
frontend/src/environments/environment.ts | 3 +++
2 files changed, 5 insertions(+), 3 deletions(-)
create mode 100644 frontend/src/environments/environment.ts
diff --git a/frontend/src/app/deposit/deposit.component.ts b/frontend/src/app/deposit/deposit.component.ts
index 0da8395..e07ee85 100644
--- a/frontend/src/app/deposit/deposit.component.ts
+++ b/frontend/src/app/deposit/deposit.component.ts
@@ -3,6 +3,7 @@ import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angula
import { loadStripe, Stripe } from '@stripe/stripe-js';
import { DepositService } from '../service/deposit.service';
import { debounceTime } from 'rxjs';
+import { environment } from '../../environments/environment';
@Component({
selector: 'app-deposit',
@@ -29,9 +30,7 @@ export class DepositComponent implements OnInit {
}
});
- this.stripe = await loadStripe(
- 'pk_test_51QrePYIvCfqz7ANgMizBorPpVjJ8S6gcaL4yvcMQnVaKyReqcQ6jqaQEF7aDZbDu8rNVsTZrw8ABek4ToxQX7KZe00jpGh8naG'
- );
+ this.stripe = await loadStripe(environment.STRIPE_KEY);
}
submit() {
diff --git a/frontend/src/environments/environment.ts b/frontend/src/environments/environment.ts
new file mode 100644
index 0000000..f0dc69d
--- /dev/null
+++ b/frontend/src/environments/environment.ts
@@ -0,0 +1,3 @@
+export const environment = {
+ STRIPE_KEY: 'pk_test_51QrePYIvCfqz7ANgMizBorPpVjJ8S6gcaL4yvcMQnVaKyReqcQ6jqaQEF7aDZbDu8rNVsTZrw8ABek4ToxQX7KZe00jpGh8naG',
+}
--
2.47.2
From cd6ace28f4a7d0df485c964d8d90c3ab4ec693ec Mon Sep 17 00:00:00 2001
From: Constantin Simonis
Date: Thu, 13 Feb 2025 10:42:39 +0100
Subject: [PATCH 025/176] style: style form
---
.../src/app/deposit/deposit.component.html | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/frontend/src/app/deposit/deposit.component.html b/frontend/src/app/deposit/deposit.component.html
index cac83b2..9a0be93 100644
--- a/frontend/src/app/deposit/deposit.component.html
+++ b/frontend/src/app/deposit/deposit.component.html
@@ -1,8 +1,12 @@
-
--
2.47.2
From 7b020aee759f14308b4ab112368a6da0c56a2dae Mon Sep 17 00:00:00 2001
From: Constantin Simonis
Date: Thu, 13 Feb 2025 10:42:53 +0100
Subject: [PATCH 026/176] refactor: run prettier
---
frontend/src/app/deposit/deposit.component.html | 13 +++++++++++--
frontend/src/environments/environment.ts | 5 +++--
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/frontend/src/app/deposit/deposit.component.html b/frontend/src/app/deposit/deposit.component.html
index 9a0be93..1bdaf6e 100644
--- a/frontend/src/app/deposit/deposit.component.html
+++ b/frontend/src/app/deposit/deposit.component.html
@@ -4,9 +4,18 @@
-
+
-