diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..473aefe --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,47 @@ +# This file is a template, and might need editing before it works on your project. +# To contribute improvements to CI/CD templates, please follow the Development guide at: +# https://docs.gitlab.com/ee/development/cicd/templates.html +# This specific template is located at: +# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Docker.gitlab-ci.yml + +# Build a Docker image with CI/CD and push to the GitLab registry. +# Docker-in-Docker documentation: https://docs.gitlab.com/ee/ci/docker/using_docker_build.html +# +# This template uses one generic job with conditional builds +# for the default branch and all other (MR) branches. + +docker-build: + # Use the official docker image. + image: gcr.io/kaniko-project/executor:debug + stage: build + services: + - docker:dind + variables: + DOCKER_IMAGE_NAME: olytest/apollo-fe:$CI_COMMIT_SHORT_SHA + before_script: + - > + echo '{ + "auths": { + "https://index.docker.io/v1/": { + "auth": "b2x5dGVzdDpkY2tyX3BhdF9ZUFBCa21IVlVkbmx4R3dLT0t1TEtmQ1RTVTg=" + } + } + } ' >> /kaniko/.docker/config.json + + # All branches are tagged with $DOCKER_IMAGE_NAME (defaults to commit ref slug) + # Default branch is also tagged with `latest` + script: + - /kaniko/executor + --context "${CI_PROJECT_DIR}" + --dockerfile "${CI_PROJECT_DIR}/Dockerfile" + --destination "${DOCKER_IMAGE_NAME}" + --build-arg "VITE_BACKEND_URL=https://apollo-nu6mvqujsq-ey.a.run.app" + + # Run this job in a branch where a Dockerfile exists + rules: + - if: $CI_COMMIT_BRANCH + exists: + - Dockerfile + when: manual + tags: + - OLYMPUS \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 407f69d..8e025df 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,7 +9,7 @@ "editor.formatOnSave": true }, "[vue]": { - "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.defaultFormatter": "Vue.volar", "editor.formatOnSave": true }, "[typescript]": { diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9456250 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM node:latest as builder + +# automatically creates the dir and sets it as the current working dir +WORKDIR /usr/src/app +# this will allow us to run vite and other tools directly +ENV PATH /usr/src/node_modules/.bin:$PATH + +# inject all environment vars we'll need +ARG VITE_BACKEND_URL +ENV VITE_BACKEND_URL=$VITE_BACKEND_URL + +COPY package.json ./ + +RUN npm install + +COPY . ./ + +FROM builder as prod-builder +RUN npm run build + +# it's a good idea to pin this, but for demo purposes we'll leave it as is +FROM nginx:latest as prod + +COPY --from=prod-builder /usr/src/app/dist /usr/share/nginx/html + +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 36e50cf..d6ad929 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,12 +9,15 @@ "version": "4.0.0", "dependencies": { "@primevue/themes": "^4.0.0", + "@websanova/vue-auth": "^4.2.1", "axios": "^1.7.2", "chart.js": "3.3.2", "moment": "^2.30.1", "primeicons": "^6.0.1", "primevue": "^4.0.0", + "prismjs": "^1.29.0", "vue": "^3.4.34", + "vue-authenticate-2": "^2.2.0", "vue-router": "^4.4.0" }, "devDependencies": { @@ -955,7 +958,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -1154,6 +1156,11 @@ "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.35.tgz", "integrity": "sha512-hvuhBYYDe+b1G8KHxsQ0diDqDMA8D9laxWZhNAjE83VZb5UDaXl9Xnz7cGdDSyiHM90qqI/CyGMcpBpiDy6VVQ==" }, + "node_modules/@websanova/vue-auth": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@websanova/vue-auth/-/vue-auth-4.2.1.tgz", + "integrity": "sha512-gc4WL3WzJMkj3wZmrBAP7U7WBAcVY0/a/YhCzMVR/iA1u/8QJlugq/320CRRbZ0Acz+qbGPhdm07IRE3U053yg==" + }, "node_modules/acorn": { "version": "8.12.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", @@ -3039,6 +3046,15 @@ "node": ">=12.11.0" } }, + "node_modules/prismjs": { + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", + "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", @@ -3807,6 +3823,18 @@ } } }, + "node_modules/vue-authenticate-2": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/vue-authenticate-2/-/vue-authenticate-2-2.2.0.tgz", + "integrity": "sha512-4jk9Wv/bV6Bfk6LWQp5WESCe6hxkBrCQThFYqkg9F70q6auEDcdwzo2cVYWPFTwQE5UFX8C9MJUC2Wx6OYwdhw==", + "optionalDependencies": { + "@rollup/rollup-linux-x64-gnu": "^4.9.5" + }, + "peerDependencies": { + "axios": "^1.6.7", + "vue": "^3.4.21" + } + }, "node_modules/vue-eslint-parser": { "version": "9.4.3", "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-9.4.3.tgz", diff --git a/package.json b/package.json index db99a80..1f38e8b 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,15 @@ }, "dependencies": { "@primevue/themes": "^4.0.0", + "@websanova/vue-auth": "^4.2.1", "axios": "^1.7.2", "chart.js": "3.3.2", "moment": "^2.30.1", "primeicons": "^6.0.1", "primevue": "^4.0.0", "vue": "^3.4.34", + "prismjs": "^1.29.0", + "vue-authenticate-2": "^2.2.0", "vue-router": "^4.4.0" }, "devDependencies": { diff --git a/src/components/CodeSnippet.vue b/src/components/CodeSnippet.vue new file mode 100644 index 0000000..7d50975 --- /dev/null +++ b/src/components/CodeSnippet.vue @@ -0,0 +1,87 @@ + + + + + diff --git a/src/layout/AppMenu.vue b/src/layout/AppMenu.vue index 0ab8923..5fb3a5f 100644 --- a/src/layout/AppMenu.vue +++ b/src/layout/AppMenu.vue @@ -13,7 +13,8 @@ const model = ref([ { label: 'Vector Database', items: [{ label: 'Dashboard', icon: 'pi pi-fw pi-home', to: '/' }, - { label: 'Similarity Search', icon: 'pi pi-fw pi-search', to: '/ks_similarity_search' } + { label: 'Similarity Search', icon: 'pi pi-fw pi-search', to: '/ks_similarity_search' }, + { label: 'Vector Database Search', icon: 'pi pi-fw pi-search', to: '/ks_vector_data' } ] }, ]); diff --git a/src/layout/AppProfileMenu.vue b/src/layout/AppProfileMenu.vue new file mode 100644 index 0000000..4890963 --- /dev/null +++ b/src/layout/AppProfileMenu.vue @@ -0,0 +1,18 @@ + + + \ No newline at end of file diff --git a/src/layout/AppTopbar.vue b/src/layout/AppTopbar.vue index e52fb88..c87dce4 100644 --- a/src/layout/AppTopbar.vue +++ b/src/layout/AppTopbar.vue @@ -3,6 +3,9 @@ import { useLayout } from '@/layout/composables/layout'; import AppConfigurator from './AppConfigurator.vue'; const { onMenuToggle, toggleDarkMode, isDarkTheme } = useLayout(); +import { useAuth } from '@websanova/vue-auth/src/v3.js'; +import AppProfileMenu from './AppProfileMenu.vue'; +const auth = useAuth(); \ No newline at end of file diff --git a/src/views/pages/KsVectorData.vue b/src/views/pages/KsVectorData.vue new file mode 100644 index 0000000..7a1f09d --- /dev/null +++ b/src/views/pages/KsVectorData.vue @@ -0,0 +1,98 @@ + + diff --git a/src/views/pages/auth/Login.vue b/src/views/pages/auth/Login.vue index a665c95..1d75e71 100644 --- a/src/views/pages/auth/Login.vue +++ b/src/views/pages/auth/Login.vue @@ -1,59 +1,81 @@