diff --git a/README.md b/README.md index b94c58b..a29235e 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ yarn install # start nuxt frontend yarn client:startdev ``` + if you don't feel like running the yarn command to start the frontend: don't worry, I got you covered. simply run the Intellij [StartClient](.run/StartClient.run.xml) run config. diff --git a/client/Dockerfile b/client/Dockerfile index 9ebd334..63b3ae5 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -1,18 +1,18 @@ -FROM node:22.3.0-slim as base +FROM node:22.3.0-slim AS base EXPOSE 3000 ENV NODE_ENV=production WORKDIR /src #RUN npm install yarn -FROM base as build +FROM base AS build EXPOSE 3000 COPY . . RUN npm install --production=false RUN npm run build -FROM base as run +FROM base AS run ENV PORT=$PORT COPY --from=build /src/.output /src/.output -CMD [ "node", ".output/server/index.mjs" ] \ No newline at end of file +CMD [ "node", ".output/server/index.mjs" ] diff --git a/client/app.vue b/client/app.vue index 61a4eb2..2f86756 100644 --- a/client/app.vue +++ b/client/app.vue @@ -1,11 +1,12 @@ + diff --git a/client/components/Technologies.vue b/client/components/Technologies.vue index e56e44a..48886c1 100644 --- a/client/components/Technologies.vue +++ b/client/components/Technologies.vue @@ -1,27 +1,27 @@ - + diff --git a/client/components/WorkCard.vue b/client/components/WorkCard.vue index cd77289..efcce10 100644 --- a/client/components/WorkCard.vue +++ b/client/components/WorkCard.vue @@ -12,6 +12,4 @@ const props = defineProps(['title', 'text', 'timeframe', 'company']) - + diff --git a/client/middleware/auth.ts b/client/middleware/auth.ts new file mode 100644 index 0000000..458675c --- /dev/null +++ b/client/middleware/auth.ts @@ -0,0 +1,8 @@ +import { useAuthStore } from '~/store/auth'; + +export default defineNuxtRouteMiddleware((to, from) => { + const token = useAuthStore().token; + if (!token) { + return navigateTo('/') + } +}); diff --git a/client/nuxt.config.ts b/client/nuxt.config.ts index 435f075..744d03f 100644 --- a/client/nuxt.config.ts +++ b/client/nuxt.config.ts @@ -3,5 +3,8 @@ export default defineNuxtConfig({ compatibilityDate: '2024-04-03', devtools: {enabled: true}, modules: ["@nuxtjs/tailwindcss", "nuxt-aos", "@pinia/nuxt"], - telemetry: false + telemetry: false, + imports: { + dirs: ['common'], + } }) diff --git a/client/pages/about.vue b/client/pages/about.vue index 6dc5168..cffdf03 100644 --- a/client/pages/about.vue +++ b/client/pages/about.vue @@ -1,10 +1,10 @@