Open source file-system and knowledge based agent template. Build AI agents that stay up to date with your knowledge base
improve login page
Hugo Richard25e9cd58fe01
diff --git a/apps/chat/app/assets/css/main.css b/apps/chat/app/assets/css/main.cssindex 81b5125..7f52828 100644--- a/apps/chat/app/assets/css/main.css+++ b/apps/chat/app/assets/css/main.css@@ -10,7 +10,7 @@--color-primary-100: #C2CDF3;--color-primary-200: #99ABEA;--color-primary-300: #6B85E0;- --color-primary-400: #4766D8;+ --color-primary-400: #1444d4;--color-primary-500: #0035D0;--color-primary-600: #002EB8;--color-primary-700: #00259E;@@ -22,6 +22,8 @@:root {--ui-container: var(--container-3xl);--ui-radius: 0.15rem;++ overscroll-behavior: none;}html {diff --git a/apps/chat/app/components/UserMenu.vue b/apps/chat/app/components/UserMenu.vueindex 7b54975..abe40ab 100644--- a/apps/chat/app/components/UserMenu.vue+++ b/apps/chat/app/components/UserMenu.vue@@ -36,7 +36,7 @@ const items = computed<DropdownMenuItem[][]>(() => {icon: 'i-lucide-log-out',async onSelect() {await signOut()- navigateTo('/login', { replace: true })+ await navigateTo('/login', { replace: true, external: true })}}])diff --git a/apps/chat/app/pages/login.vue b/apps/chat/app/pages/login.vueindex 24b9c86..aa7589c 100644--- a/apps/chat/app/pages/login.vue+++ b/apps/chat/app/pages/login.vue@@ -1,27 +1,67 @@<script setup lang="ts">-definePageMeta({ layout: false, auth: 'guest' })+import { z } from 'zod'+import { Circle, DotGrid, Glow, Godrays, ProgressiveBlur, Saturation, Shader, SolidColor } from 'shaders/vue'+definePageMeta({ layout: false, auth: 'guest' })useSeoMeta({ title: 'Sign in' })+const route = useRoute()const mode = ref<'signin' | 'signup'>('signin')const loading = ref(false)+const githubLoading = ref(false)const error = ref('')+const { signIn, signUp } = useUserSession()++const oauthErrors: Record<string, string> = {+ access_denied: 'Access denied by GitHub.',+ server_error: 'GitHub encountered an error. Please try again.',+ temporarily_unavailable: 'GitHub is temporarily unavailable. Please try again later.',+}-const name = ref('')-const email = ref('')-const password = ref('')+const shaderColors = reactive({ solid: '', circle: '', dots: '', rays: '' })-const { signIn, signUp } = useUserSession()+function primary(shade: number) {+ return getComputedStyle(document.documentElement).getPropertyValue(`--color-primary-${shade}`).trim()+}++onMounted(() => {+ Object.assign(shaderColors, {+ solid: primary(600),+ circle: primary(100),+ dots: primary(300),+ rays: primary(500),+ })++ const queryError = route.query.error as string | undefined+ if (queryError) {+ error.value = oauthErrors[queryError] || `Authentication error: ${queryError}`+ }+})++const state = reactive({ name: '', email: '', password: '' })++const signInSchema = z.object({+ name: z.string().optional(),+ email: z.email('Invalid email address'),+ password: z.string().min(8, 'Password must be at least 8 characters'),+})++const signUpSchema = z.object({+ name: z.string().min(1, 'Name is required'),+ email: z.email('Invalid email address'),+ password: z.string().min(8, 'Password must be at least 8 characters'),+})++const schema = computed(() => mode.value === 'signup' ? signUpSchema : signInSchema)async function onSubmit() {loading.value = trueerror.value = ''-try {if (mode.value === 'signup') {- await signUp.email({ name: name.value, email: email.value, password: password.value })+ await signUp.email({ name: state.name, email: state.email, password: state.password })} else {- await signIn.email({ email: email.value, password: password.value })+ await signIn.email({ email: state.email, password: state.password })}await navigateTo('/', { replace: true })} catch (e: any) {@@ -32,55 +72,39 @@ async function onSubmit() {}function onGitHub() {+ githubLoading.value = truesignIn.social({ provider: 'github' })}</script><template>- <div class="login-page bg-default min-h-dvh flex flex-col items-center justify-center px-4 overflow-hidden relative">- <div class="dot-grid absolute inset-0 pointer-events-none select-none" />-- <div class="absolute -top-40 left-1/2 -translate-x-1/2 w-[500px] h-[400px] bg-primary-500/15 rounded-full blur-[250px] pointer-events-none select-none animate-glow" />- <div class="absolute -top-20 left-1/2 -translate-x-1/2 w-[300px] h-[250px] bg-primary-400/10 rounded-full blur-[180px] pointer-events-none select-none" />+ <div class="flex min-h-dvh bg-default">+ <div class="w-full lg:w-1/2 flex items-center justify-center p-8">+ <div class="w-full max-w-sm">+ <div class="text-center mb-8">+ <div class="inline-flex items-center justify-center mb-4">+ <UIcon name="i-custom-savoir" class="size-10 text-primary" />+ </div>+ <h1 class="text-2xl font-semibold text-highlighted">+ {{ mode === 'signin' ? 'Welcome back' : 'Create your account' }}+ </h1>+ <p class="mt-1.5 text-sm text-muted">+ {{ mode === 'signin' ? 'Sign in to your Savoir account.' : 'Get started with Savoir.' }}+ </p>+ </div>- <div class="relative z-10 flex flex-col items-center gap-3 mb-10">- <div class="relative">- <div class="absolute inset-0 bg-primary-500/20 rounded-full blur-xl scale-150" />- <UIcon name="i-custom-savoir" class="relative size-12 text-primary" />- </div>- <h1 class="text-3xl font-bold font-pixel tracking-wide text-highlighted">- Savoir- </h1>- <p class="text-muted text-sm/6 text-center max-w-xs">- Your intelligent AI assistant for knowledge and insights.- </p>- </div>+ <UButton+ label="Continue with GitHub"+ icon="i-simple-icons-github"+ color="neutral"+ variant="outline"+ block+ size="lg"+ :loading="githubLoading"+ @click="onGitHub"+ />- <div class="relative z-10 w-full max-w-sm">- <span class="cross absolute -top-px -left-px size-px" />- <span class="cross absolute -top-px -right-px size-px" />- <span class="cross absolute -bottom-px -left-px size-px" />- <span class="cross absolute -bottom-px -right-px size-px" />-- <div class="relative overflow-hidden ring ring-default bg-elevated/50 backdrop-blur-md p-8 space-y-5">- <div class="absolute inset-x-4 top-0 h-px bg-linear-to-r from-transparent via-primary-500/40 to-transparent" />-- <div class="flex bg-default/80 p-1 gap-1">- <button- class="flex-1 text-sm font-medium py-2 transition-all duration-200 cursor-pointer relative"- :class="mode === 'signin' ? 'bg-elevated text-highlighted shadow-xs' : 'text-muted hover:text-dimmed'"- @click="mode = 'signin'"- >- Sign in- </button>- <button- class="flex-1 text-sm font-medium py-2 transition-all duration-200 cursor-pointer relative"- :class="mode === 'signup' ? 'bg-elevated text-highlighted shadow-xs' : 'text-muted hover:text-dimmed'"- @click="mode = 'signup'"- >- Sign up- </button>- </div>+ <USeparator label="or" class="my-6" /><UAlertv-if="error"@@ -89,31 +113,16 @@ function onGitHub() {:title="error"icon="i-lucide-circle-alert":close="{ color: 'error', variant: 'link' }"+ class="mb-4"@close="error = ''"/>- <UButton- label="Continue with GitHub"- icon="i-simple-icons-github"- color="neutral"- variant="subtle"- block- size="lg"- @click="onGitHub"- />-- <div class="flex items-center gap-3">- <div class="flex-1 h-px bg-accented" />- <span class="text-xs text-muted select-none whitespace-nowrap">or with email</span>- <div class="flex-1 h-px bg-accented" />- </div>-- <form class="space-y-4" @submit.prevent="onSubmit">+ <UForm :schema :state class="space-y-4" @submit="onSubmit"><div class="name-field-wrapper" :class="mode === 'signup' ? 'expanded' : 'collapsed'"><div class="name-field-inner">- <UFormField label="Name">+ <UFormField label="Name" name="name"><UInput- v-model="name"+ v-model="state.name"placeholder="Your name"size="lg"class="w-full"@@ -123,26 +132,12 @@ function onGitHub() {</div></div>- <UFormField label="Email">- <UInput- v-model="email"- type="email"- placeholder="[email protected]"- required- size="lg"- class="w-full"- />+ <UFormField label="Email" name="email">+ <UInput v-model="state.email" type="email" placeholder="[email protected]" size="lg" class="w-full" /></UFormField>- <UFormField label="Password">- <UInput- v-model="password"- type="password"- placeholder="••••••••"- required- size="lg"- class="w-full"- />+ <UFormField label="Password" name="password">+ <UInput v-model="state.password" type="password" placeholder="••••••••" size="lg" class="w-full" /></UFormField><UButton@@ -151,48 +146,69 @@ function onGitHub() {blocksize="lg":loading+ class="text-white"/>- </form>+ </UForm>++ <p class="mt-6 text-center text-sm text-muted">+ <template v-if="mode === 'signin'">+ Don't have an account?+ <button class="text-primary font-medium hover:underline cursor-pointer" @click="mode = 'signup'">+ Sign up+ </button>+ </template>+ <template v-else>+ Already have an account?+ <button class="text-primary font-medium hover:underline cursor-pointer" @click="mode = 'signin'">+ Sign in+ </button>+ </template>+ </p>++ <p class="mt-4 text-center text-xs text-muted/60">+ By continuing, you agree to our terms of service.+ </p></div></div>- <p class="relative z-10 mt-8 text-xs text-muted/60">- By continuing, you agree to our terms of service.- </p>+ <div class="hidden lg:block w-1/2 relative overflow-hidden">+ <ClientOnly>+ <Shader class="absolute inset-0 size-full">+ <Glow :intensity="2.69" :size="27.5" :threshold="0.37">+ <Saturation :intensity="1.13">+ <SolidColor :color="shaderColors.solid" />+ </Saturation>+ <Circle+ blend-mode="normal-oklch"+ :center="{ x: 0.5, y: 1 }"+ :color="shaderColors.circle"+ :radius="1.03"+ :softness="0.57"+ />+ <ProgressiveBlur :angle="270" blend-mode="linearDodge" :center="{ x: 0.5, y: 0.5 }" :intensity="5">+ <DotGrid :color="shaderColors.dots" :density="160" :dot-size="0.22" :twinkle="1" />+ </ProgressiveBlur>+ <Godrays+ blend-mode="linearDodge"+ :center="{ x: 0.5, y: 1 }"+ :density="0.1"+ :intensity="0.55"+ :ray-color="shaderColors.rays"+ :speed="1.82"+ :spotty="0.14"+ />+ </Glow>+ </Shader>+ </ClientOnly>+ </div></div></template><style scoped>-.dot-grid {- background-image: radial-gradient(circle, var(--ui-border-muted) 1px, transparent 1px);- background-size: 24px 24px;- mask-image: radial-gradient(ellipse 50% 60% at 50% 40%, black 20%, transparent 70%);-}--.cross::before,-.cross::after {- content: '';- position: absolute;-}--.cross::before {- top: -4px;- width: 1px;- height: 9px;- background: var(--ui-border-accented);-}--.cross::after {- left: -4px;- width: 9px;- height: 1px;- background: var(--ui-border-accented);-}--/* Name field smooth expand/collapse with CSS grid trick */+/* CSS grid trick for smooth name field expand/collapse */.name-field-wrapper {display: grid;- transition: grid-template-rows 250ms ease, opacity 250ms ease;+ transition: grid-template-rows 300ms ease, opacity 200ms ease;}.name-field-wrapper.expanded {@@ -208,21 +224,4 @@ function onGitHub() {.name-field-inner {overflow: hidden;}--.name-field-wrapper.collapsed .name-field-inner {- padding-bottom: 0;-}--.name-field-wrapper.expanded .name-field-inner {- padding-bottom: 0;-}--@keyframes glow-pulse {- 0%, 100% { opacity: 1; }- 50% { opacity: 0.6; }-}--.animate-glow {- animation: glow-pulse 6s ease-in-out infinite;-}</style>diff --git a/apps/chat/app/pages/settings/index.vue b/apps/chat/app/pages/settings/index.vueindex b044e48..d1ba370 100644--- a/apps/chat/app/pages/settings/index.vue+++ b/apps/chat/app/pages/settings/index.vue@@ -125,7 +125,7 @@ async function deleteAccount() {try {await client!.deleteUser()await signOut()- navigateTo('/login')+ await navigateTo('/login', { replace: true, external: true })} catch (e: any) {toast.add({ title: 'Error', description: e?.data?.message || e?.message || 'Failed to delete account', color: 'error', icon: 'i-lucide-alert-circle' })isDeletingAccount.value = falsediff --git a/apps/chat/package.json b/apps/chat/package.jsonindex 023f9f7..27062db 100644--- a/apps/chat/package.json+++ b/apps/chat/package.json@@ -50,6 +50,7 @@"nuxt": "^4.3.1","nuxt-charts": "^2.1.2","pathe": "^2.0.3",+ "shaders": "^2.3.63","sharp": "^0.34.5","shiki-stream": "^0.1.4","workflow": "4.1.0-beta.54",diff --git a/bun.lock b/bun.lockindex 32c3565..bd3bd95 100644--- a/bun.lock+++ b/bun.lock@@ -45,6 +45,7 @@"nuxt": "^4.3.1","nuxt-charts": "^2.1.2","pathe": "^2.0.3",+ "shaders": "^2.3.63","sharp": "^0.34.5","shiki-stream": "^0.1.4","workflow": "4.1.0-beta.54",@@ -3352,6 +3353,8 @@"setprototypeof": ["[email protected]", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="],+ "shaders": ["[email protected]", "", { "dependencies": { "three": "^0.182.0" } }, "sha512-QfKQYG+6MF+9DuLrDwPOd4n4sufO+JheKb3260ccpB11LVqELGUlE/uJ1w8l/9zvDW5G0lJuws8vIdgaQx/MXw=="],+"sharp": ["[email protected]", "", { "dependencies": { "@img/colour": "^1.0.0", "detect-libc": "^2.1.2", "semver": "^7.7.3" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.34.5", "@img/sharp-darwin-x64": "0.34.5", "@img/sharp-libvips-darwin-arm64": "1.2.4", "@img/sharp-libvips-darwin-x64": "1.2.4", "@img/sharp-libvips-linux-arm": "1.2.4", "@img/sharp-libvips-linux-arm64": "1.2.4", "@img/sharp-libvips-linux-ppc64": "1.2.4", "@img/sharp-libvips-linux-riscv64": "1.2.4", "@img/sharp-libvips-linux-s390x": "1.2.4", "@img/sharp-libvips-linux-x64": "1.2.4", "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", "@img/sharp-libvips-linuxmusl-x64": "1.2.4", "@img/sharp-linux-arm": "0.34.5", "@img/sharp-linux-arm64": "0.34.5", "@img/sharp-linux-ppc64": "0.34.5", "@img/sharp-linux-riscv64": "0.34.5", "@img/sharp-linux-s390x": "0.34.5", "@img/sharp-linux-x64": "0.34.5", "@img/sharp-linuxmusl-arm64": "0.34.5", "@img/sharp-linuxmusl-x64": "0.34.5", "@img/sharp-wasm32": "0.34.5", "@img/sharp-win32-arm64": "0.34.5", "@img/sharp-win32-ia32": "0.34.5", "@img/sharp-win32-x64": "0.34.5" } }, "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg=="],"shebang-command": ["[email protected]", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="],@@ -3508,7 +3511,7 @@"text-decoder": ["[email protected]", "", { "dependencies": { "b4a": "^1.6.4" } }, "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA=="],- "three": ["[email protected]", "", {}, "sha512-kuEpuuxRzLv0MDsXai9huCxOSQPZ4vje6y0gn80SRmQvgz6/+rI0NAvCRAw56zYaWKMGMfqKWsxF9Qa2Z9xymQ=="],+ "three": ["[email protected]", "", {}, "sha512-GbHabT+Irv+ihI1/f5kIIsZ+Ef9Sl5A1Y7imvS5RQjWgtTPfPnZ43JmlYI7NtCRDK9zir20lQpfg8/9Yd02OvQ=="],"throttle-debounce": ["[email protected]", "", {}, "sha512-B71/4oyj61iNH0KeCamLuE2rmKuTO5byTOSVwECM5FA7TiAiAW+UqTKZ9ERueC4qvgSttUhdmq1mXC3kJqGX7A=="],@@ -4188,6 +4191,8 @@"@unhead/vue/hookable": ["[email protected]", "", {}, "sha512-uKGyY8BuzN/a5gvzvA+3FVWo0+wUjgtfSdnmjtrOVwQCZPHpHDH2WRO3VZSOeluYrHoDCiXFffZXs8Dj1ULWtw=="],+ "@unovis/ts/three": ["[email protected]", "", {}, "sha512-kuEpuuxRzLv0MDsXai9huCxOSQPZ4vje6y0gn80SRmQvgz6/+rI0NAvCRAw56zYaWKMGMfqKWsxF9Qa2Z9xymQ=="],+"@unovis/ts/typescript": ["[email protected]", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg=="],"@unrs/resolver-binding-wasm32-wasi/@napi-rs/wasm-runtime": ["@napi-rs/[email protected]", "", { "dependencies": { "@emnapi/core": "^1.4.3", "@emnapi/runtime": "^1.4.3", "@tybys/wasm-util": "^0.10.0" } }, "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ=="],