Skip to content

Commit 6c6f49a

Browse files
feat!: Prototype BFF (#108)
Co-authored-by: Moritz Reich <moritz.reich@sap.com>
1 parent 6f839e5 commit 6c6f49a

40 files changed

+3516
-1116
lines changed

.env.template

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# OpenID Connect Configuration for Onboarding API
2+
OIDC_ISSUER=
3+
OIDC_CLIENT_ID=
4+
OIDC_SCOPES=
5+
OIDC_REDIRECT_URI=http://localhost:5173
6+
7+
POST_LOGIN_REDIRECT=http://localhost:5173
8+
9+
10+
# Location of the API Backend
11+
API_BACKEND_URL=
12+
13+
14+
# Cookie Secret
15+
# Replace this value with a strong, randomly generated string (at least 32 characters).
16+
# Example for generation in Node.js: require('crypto').randomBytes(32).toString('hex')
17+
COOKIE_SECRET=

Dockerfile

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,26 @@ COPY package*.json ./
99
# Install dependencies
1010
RUN npm ci
1111

12-
# Build
12+
# Build
1313
ENV NODE_ENV=production
1414
COPY . .
1515
RUN npm run build
1616

17-
# Use the latest LTS version of Nginx as the serving image
18-
# https://hub.docker.com/_/nginx
19-
FROM nginx:1.28.0-alpine-slim@sha256:39a9a15e0a81914a96fa9ffa980cdfe08e2e5e73ae3424f341ad1f470147c413
17+
# The same image but now only install the production dependencies as the frontend is already built using vite in the build-stage
18+
FROM node:22-alpine3.20@sha256:686b8892b69879ef5bfd6047589666933508f9a5451c67320df3070ba0e9807b AS production
2019

21-
COPY nginx.conf /etc/nginx/templates/default.conf.template
22-
COPY --from=build-stage /usr/src/app/dist /usr/share/nginx/html
20+
WORKDIR /usr/src/app
21+
22+
# copy over package.json from the origin file system again so it can be done in parallel from docker (if configured)
23+
COPY package*.json ./
24+
# install only dependencies which are not marked as dev
25+
RUN npm ci --omit=dev
26+
27+
# copy over necessary files for the server
28+
COPY server.js ./
29+
COPY server server
30+
31+
# copy over precompiled frontend
32+
COPY --from=build-stage /usr/src/app/dist dist
33+
34+
CMD ["npm", "run", "start"]

frontend-config.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
{
2-
"backendUrl": "http://localhost:3000",
32
"gatewayUrl": "http://localhost:3000",
43
"landscape": "LOCAL",
5-
"documentationBaseUrl": "http://localhost:3000",
6-
"oidcConfig": {
7-
"clientId": "clientId",
8-
"issuerUrl": "issuer-url",
9-
"scopes": []
10-
}
4+
"documentationBaseUrl": "http://localhost:3000"
115
}

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<body>
1616
<div id="root"></div>
17-
<script type="module" src="/src/main.tsx"></script>
17+
<script type="module" src="/src/mount.ts"></script>
1818
</body>
1919

20-
</html>
20+
</html>

0 commit comments

Comments
 (0)