Skip to content

Commit cd33758

Browse files
author
Christoph Henrici
committed
Tenant capability reviewed
1 parent 718ce51 commit cd33758

34 files changed

+551
-328
lines changed

.github/workflows/deploy-cloudrun.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
--allow-unauthenticated
6767
--memory=512Mi
6868
--max-instances=1
69-
--set-env-vars=SPRING_PROFILES_ACTIVE=demo
69+
--set-env-vars=SPRING_PROFILES_ACTIVE=prod
7070
7171
- name: Display Cloud Run URL
7272
run: |

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,5 @@ FROM gcr.io/distroless/java21-debian12
3131
WORKDIR /app
3232
COPY --from=build /app/target/*-SNAPSHOT.jar /app/app.jar
3333
EXPOSE 8080
34-
ENV SPRING_PROFILES_ACTIVE=demo
3534
USER nonroot:nonroot
3635
ENTRYPOINT ["java","-jar","/app/app.jar"]

frontend/.env.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
VITE_USE_MOCK=true
1+
VITE_USE_MOCK=false
22
# If you want real backend in dev, flip to false and (optionally) set:
33
VITE_BACKEND_URL=http://localhost:8080

frontend/src/api/clients.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export type Client = v.InferOutput<typeof Client>
1010
const Clients = v.array(Client)
1111

1212
export async function getClients() {
13-
const response = await fetch('/clients', {credentials: 'include'})
13+
const response = await fetch('/api/clients', {credentials: 'include'})
1414
if (!response.ok) {
1515
throw new Error('Failed to fetch Clients')
1616
}

frontend/src/api/tenantInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const TenantInfo = v.object({
77
export type TenantInfo = v.InferOutput<typeof TenantInfo>
88

99
export async function getTenantInfo() {
10-
const res = await fetch('/tenantInfo', { credentials: 'include' })
10+
const res = await fetch('/api/tenantInfo', { credentials: 'include' })
1111
if (!res.ok) throw new Error(`Tenant load failed: ${res.status}`)
1212
return v.parse(TenantInfo, await res.json())
1313
}

frontend/src/components/ImageAttribution.tsx

Lines changed: 0 additions & 14 deletions
This file was deleted.

frontend/src/mocks/handlers.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ import clients from './data/clients.json' with {type: 'json'}
33

44

55
export const handlers = [
6-
http.get('/clients', async () => {
6+
http.get('/api/clients', async () => {
77
await delay('real')
88
return HttpResponse.json(clients)
99
}),
10-
http.get('/tenantInfo', async () => {
10+
http.get('/api/tenantInfo', async () => {
1111
await delay('real')
1212
return HttpResponse.json({
1313
tenantDisplay: getMockTenantDisplay(),
14-
createdAt: new Date().toISOString(),
15-
clientCount: 3 // or compute from your mock clients.json length
14+
clientCount: 3 // or compute from more mock clients.json length
1615
})
1716
})
1817
]

frontend/vite.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ export default defineConfig(({ mode }) => {
2222
/**
2323
* Dev server
2424
* - If USE_MOCK=true → no proxy (api served from mocks)
25-
* - If USE_MOCK=false → proxy /clients to Spring Boot (:8080 by default)
25+
* - If USE_MOCK=false → proxy to Spring Boot (:8080 by default)
2626
*/
2727
server: {
2828
port: 5173,
2929
...(USE_MOCK
3030
? {}
3131
: {
3232
proxy: {
33-
'/clients': {
33+
'/api/clients': {
3434
target: BACKEND_URL,
3535
changeOrigin: true,
3636
},
37-
'/tenantInfo': {
37+
'/api/tenantInfo': {
3838
target: BACKEND_URL,
3939
changeOrigin: true,
4040
},

pom.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@
4949
<artifactId>h2</artifactId>
5050
<scope>runtime</scope>
5151
</dependency>
52+
<dependency>
53+
<groupId>org.mapstruct</groupId>
54+
<artifactId>mapstruct</artifactId>
55+
<version>1.6.2</version>
56+
</dependency>
57+
<dependency>
58+
<groupId>org.mapstruct</groupId>
59+
<artifactId>mapstruct-processor</artifactId>
60+
<version>1.6.2</version>
61+
<scope>provided</scope>
62+
</dependency>
5263
<dependency>
5364
<groupId>org.springframework.boot</groupId>
5465
<artifactId>spring-boot-starter-test</artifactId>
@@ -62,6 +73,22 @@
6273
<groupId>org.springframework.boot</groupId>
6374
<artifactId>spring-boot-maven-plugin</artifactId>
6475
</plugin>
76+
<plugin>
77+
<groupId>org.apache.maven.plugins</groupId>
78+
<artifactId>maven-compiler-plugin</artifactId>
79+
<version>3.11.0</version>
80+
<configuration>
81+
<source>17</source>
82+
<target>17</target>
83+
<annotationProcessorPaths>
84+
<path>
85+
<groupId>org.mapstruct</groupId>
86+
<artifactId>mapstruct-processor</artifactId>
87+
<version>1.6.2</version>
88+
</path>
89+
</annotationProcessorPaths>
90+
</configuration>
91+
</plugin>
6592
</plugins>
6693
</build>
6794

src/main/java/ch/henr/reactboot/TenantContext.java

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)