From 86c50dfdb08f7ade7dc951b883a17958a8407aaf Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Thu, 14 Mar 2024 23:53:21 +0100 Subject: [PATCH] migrated to nuxt --- .pre-commit-config.yaml | 5 +- webclient/.dockerignore | 9 +- webclient/.eslintrc.cjs | 2 - webclient/.gitignore | 2 + webclient/.prettierignore | 3 + webclient/App.vue | 30 - webclient/Dockerfile | 18 +- webclient/components/AppFooter.vue | 59 +- webclient/components/AppNavHeader.vue | 10 +- webclient/components/AppSearchBar.vue | 100 +- webclient/components/BreadcrumbList.vue | 4 +- webclient/components/Btn.vue | 6 +- .../DetailsBuildingOverviewSection.vue | 25 +- .../components/DetailsFeedbackButton.vue | 18 +- .../components/DetailsImageSlideshowModal.vue | 12 +- webclient/components/DetailsInfoSection.vue | 10 +- .../components/DetailsInteractiveMap.vue | 17 +- webclient/components/DetailsPropertyTable.vue | 5 +- .../components/DetailsRoomOverviewSection.vue | 5 +- webclient/components/DetailsRoomfinderMap.vue | 6 +- webclient/components/DetailsSources.vue | 3 +- webclient/components/ManyChangesToast.vue | 20 +- webclient/components/Modal.vue | 2 - webclient/components/PreferencesPopup.vue | 30 +- .../components/RoomfinderImageLocation.vue | 13 +- webclient/components/ShareButton.vue | 19 +- webclient/components/SwaggerUI.vue | 34 + webclient/components/TinyModal.vue | 3 - .../components/feedback/FeedbackModal.vue | 18 +- .../components/feedback/TokenBasedModal.vue | 39 +- .../{modules => composables}/FloorControl.ts | 7 +- .../{modules => composables}/autocomplete.ts | 3 +- webclient/composables/feedback.ts | 12 + webclient/composables/feedbackToken.ts | 6 +- webclient/composables/fetch.ts | 31 - .../outdatedBrowser.ts | 0 webclient/composables/persistance.ts | 4 - .../md => content/about}/datenschutz.md | 0 .../{assets/md => content/about}/impressum.md | 0 .../{assets/md => content/about}/ueber-uns.md | 0 .../md => content/en/about}/about-us.md | 0 .../md => content/en/about}/imprint.md | 0 .../md => content/en/about}/privacy.md | 77 +- webclient/env/.env | 1 - webclient/env/.env.production | 1 - webclient/index.html | 84 - webclient/layouts/default.vue | 43 + webclient/main.ts | 31 - webclient/md.d.ts | 13 - webclient/nginx.conf | 113 - webclient/nuxt.config.ts | 112 + webclient/package.json | 38 +- webclient/pages/[...slug].vue | 27 +- webclient/pages/{view => [view]}/[id].vue | 134 +- webclient/pages/about/[name].vue | 48 +- webclient/pages/api.vue | 38 +- webclient/pages/index.vue | 51 +- webclient/pages/search.vue | 75 +- webclient/pnpm-lock.yaml | 7593 +++++++++++++++-- webclient/postcss.config.js | 7 - webclient/public/.well-known/robots.txt | 4 +- webclient/public/health | 1 + .../{assets => public}/logos/tum_dark_de.svg | 0 .../{assets => public}/logos/tum_dark_en.svg | 0 .../{assets => public}/logos/tum_light_de.svg | 0 .../{assets => public}/logos/tum_light_en.svg | 0 webclient/router.ts | 76 - webclient/stores/global.ts | 28 - webclient/tailwind.config.ts | 4 +- webclient/tsconfig.json | 10 +- webclient/vite.config.ts | 57 - 71 files changed, 7508 insertions(+), 1748 deletions(-) delete mode 100644 webclient/App.vue create mode 100644 webclient/components/SwaggerUI.vue rename webclient/{modules => composables}/FloorControl.ts (99%) rename webclient/{modules => composables}/autocomplete.ts (98%) create mode 100644 webclient/composables/feedback.ts delete mode 100644 webclient/composables/fetch.ts rename webclient/{modules => composables}/outdatedBrowser.ts (100%) delete mode 100644 webclient/composables/persistance.ts rename webclient/{assets/md => content/about}/datenschutz.md (100%) rename webclient/{assets/md => content/about}/impressum.md (100%) rename webclient/{assets/md => content/about}/ueber-uns.md (100%) rename webclient/{assets/md => content/en/about}/about-us.md (100%) rename webclient/{assets/md => content/en/about}/imprint.md (100%) rename webclient/{assets/md => content/en/about}/privacy.md (76%) delete mode 100644 webclient/env/.env delete mode 100644 webclient/env/.env.production delete mode 100644 webclient/index.html create mode 100644 webclient/layouts/default.vue delete mode 100644 webclient/main.ts delete mode 100644 webclient/md.d.ts delete mode 100644 webclient/nginx.conf create mode 100644 webclient/nuxt.config.ts rename webclient/pages/{view => [view]}/[id].vue (74%) delete mode 100644 webclient/postcss.config.js create mode 100644 webclient/public/health rename webclient/{assets => public}/logos/tum_dark_de.svg (100%) rename webclient/{assets => public}/logos/tum_dark_en.svg (100%) rename webclient/{assets => public}/logos/tum_light_de.svg (100%) rename webclient/{assets => public}/logos/tum_light_en.svg (100%) delete mode 100644 webclient/router.ts delete mode 100644 webclient/stores/global.ts delete mode 100644 webclient/vite.config.ts diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 070d0ba54..aeaef077d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,6 +9,7 @@ repos: - --allow-multiple-documents exclude: "(data/data_format_geo-entry.yaml)|(deployment/k3s/.*)|(webclient/pnpm-lock.yaml)" - id: check-json + exclude: "(webclient/tsconfig.json)" - id: check-executables-have-shebangs - id: check-shebang-scripts-are-executable - id: check-case-conflict @@ -57,8 +58,8 @@ repos: rev: 1.7.7 hooks: - id: bandit - args: ["-c", "pyproject.toml"] - additional_dependencies: ["bandit[toml]"] + args: [ "-c", "pyproject.toml" ] + additional_dependencies: [ "bandit[toml]" ] # markdown - repo: https://github.com/DavidAnson/markdownlint-cli2 rev: v0.9.2 diff --git a/webclient/.dockerignore b/webclient/.dockerignore index 1992b6ab8..547277021 100644 --- a/webclient/.dockerignore +++ b/webclient/.dockerignore @@ -1,4 +1,5 @@ -node_modules/* -dist/* -cdn/* -.vscode/* +node_modules +dist +cdn +.output +.nuxt diff --git a/webclient/.eslintrc.cjs b/webclient/.eslintrc.cjs index b34daa501..128333065 100644 --- a/webclient/.eslintrc.cjs +++ b/webclient/.eslintrc.cjs @@ -1,6 +1,4 @@ /* eslint-env node */ -require("@rushstack/eslint-patch/modern-module-resolution"); - module.exports = { root: true, extends: [ diff --git a/webclient/.gitignore b/webclient/.gitignore index 01814ae6d..f01bc4f86 100644 --- a/webclient/.gitignore +++ b/webclient/.gitignore @@ -12,6 +12,8 @@ dist dist-ssr coverage *.local +.nuxt +.output # Editor directories and files .vscode/* diff --git a/webclient/.prettierignore b/webclient/.prettierignore index 15231cfea..b1b163f5e 100644 --- a/webclient/.prettierignore +++ b/webclient/.prettierignore @@ -1 +1,4 @@ tsconfig.json +.output +.nuxt +node_modules diff --git a/webclient/App.vue b/webclient/App.vue deleted file mode 100644 index 5fe63c3b2..000000000 --- a/webclient/App.vue +++ /dev/null @@ -1,30 +0,0 @@ - - - diff --git a/webclient/Dockerfile b/webclient/Dockerfile index a2af89f0d..668cb4031 100644 --- a/webclient/Dockerfile +++ b/webclient/Dockerfile @@ -12,15 +12,19 @@ ARG GIT_COMMIT_SHA ENV GIT_COMMIT_SHA=${GIT_COMMIT_SHA} ARG GIT_COMMIT_MESSAGE ENV GIT_COMMIT_MESSAGE=${GIT_COMMIT_MESSAGE} -RUN npm run build-only -RUN gzip --force --keep --recursive ./dist +RUN NITRO_PRESET=deno-server pnpm run build -FROM nginx:1.25 as production-stage -COPY nginx.conf /etc/nginx/nginx.conf -RUN mkdir /app && apt update && apt upgrade -y -COPY --from=build-stage /app/dist /app +FROM denoland/deno:alpine as production-stage +RUN apk update --no-progress --quiet && apk add curl --no-progress --quiet +COPY --from=build-stage /app/.output /app/.output +COPY --from=build-stage /app/node_modules /app/node_modules +COPY --from=build-stage /app/.nuxt /app/.nuxt + +ENV NUXT_HOST=0.0.0.0 +ENV NUXT_PORT=3000 EXPOSE 3000 + HEALTHCHECK CMD curl --fail localhost:3000/health || exit 1 -CMD sh -c "sed -i 's|TILESERVER_URL|${TILESERVER_URL}|g' /etc/nginx/nginx.conf && sed -i 's|CDN_URL|${CDN_URL}|g' /etc/nginx/nginx.conf && sed -i 's|MAIN_API_URL|${MAIN_API_URL}|g' /etc/nginx/nginx.conf && sed -i 's|FEEDBACK_API_URL|${FEEDBACK_API_URL}|g' /etc/nginx/nginx.conf && nginx -g 'daemon off;'" +CMD deno run --unstable --allow-net --allow-read --allow-env /app/.output/server/index.mjs diff --git a/webclient/components/AppFooter.vue b/webclient/components/AppFooter.vue index ed74bb253..ab2816ac0 100644 --- a/webclient/components/AppFooter.vue +++ b/webclient/components/AppFooter.vue @@ -1,16 +1,10 @@