diff --git a/README.md b/README.md index 3b65418..ed398b1 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Full-featured AI Chatbot Nuxt application with authentication, chat history, mul - ⚡️ **Streaming AI messages** powered by the [AI SDK v5](https://sdk.vercel.ai) - 🤖 **Multiple model support** via various AI providers with built-in AI Gateway support - 🔐 **Authentication** via [nuxt-auth-utils](https://github.com/atinux/nuxt-auth-utils) -- 💾 **Chat history persistence** using PostgreSQL database and [Drizzle ORM](https://orm.drizzle.team) +- 💾 **Chat history persistence** using SQLite database (Turso in production) and [Drizzle ORM](https://orm.drizzle.team) - 🚀 **Easy deploy** to Vercel with zero configuration ## Quick Start @@ -31,7 +31,7 @@ npm create nuxt@latest -- -t ui/chat ## Deploy your own -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-name=chat&repository-url=https%3A%2F%2Fgithub.com%2Fnuxt-ui-templates%2Fchat&env=NUXT_SESSION_PASSWORD,NUXT_OAUTH_GITHUB_CLIENT_ID,NUXT_OAUTH_GITHUB_CLIENT_SECRET&products=%5B%7B%22type%22%3A%22integration%22%2C%22group%22%3A%22postgres%22%7D%5D&demo-image=https%3A%2F%2Fui.nuxt.com%2Fassets%2Ftemplates%2Fnuxt%2Fchat-dark.png&demo-url=https%3A%2F%2Fchat-template.nuxt.dev%2F&demo-title=Nuxt%20Chat%20Template&demo-description=An%20AI%20chatbot%20template%20to%20build%20your%20own%20chatbot%20powered%20by%20Nuxt%20MDC%20and%20Vercel%20AI%20SDK.) +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-name=chat&repository-url=https%3A%2F%2Fgithub.com%2Fnuxt-ui-templates%2Fchat&env=NUXT_SESSION_PASSWORD,NUXT_OAUTH_GITHUB_CLIENT_ID,NUXT_OAUTH_GITHUB_CLIENT_SECRET&products=%5B%7B%22type%22%3A%22integration%22%2C%22protocol%22%3A%22storage%22%2C%22productSlug%22%3A%22database%22%2C%22integrationSlug%22%3A%22tursocloud%22%7D%5D&demo-image=https%3A%2F%2Fui.nuxt.com%2Fassets%2Ftemplates%2Fnuxt%2Fchat-dark.png&demo-url=https%3A%2F%2Fchat-template.nuxt.dev%2F&demo-title=Nuxt%20Chat%20Template&demo-description=An%20AI%20chatbot%20template%20to%20build%20your%20own%20chatbot%20powered%20by%20Nuxt%20MDC%20and%20Vercel%20AI%20SDK.) ## Setup diff --git a/app/composables/useChats.ts b/app/composables/useChats.ts index 5c7c037..38ec744 100644 --- a/app/composables/useChats.ts +++ b/app/composables/useChats.ts @@ -1,20 +1,20 @@ import { isToday, isYesterday, subMonths } from 'date-fns' -interface Chat { +export interface UIChat { id: string label: string icon: string createdAt: string } -export function useChats(chats: Ref) { +export function useChats(chats: Ref) { const groups = computed(() => { // Group chats by date - const today: Chat[] = [] - const yesterday: Chat[] = [] - const lastWeek: Chat[] = [] - const lastMonth: Chat[] = [] - const older: Record = {} + const today: UIChat[] = [] + const yesterday: UIChat[] = [] + const lastWeek: UIChat[] = [] + const lastMonth: UIChat[] = [] + const older: Record = {} const oneWeekAgo = subMonths(new Date(), 0.25) // ~7 days ago const oneMonthAgo = subMonths(new Date(), 1) @@ -56,7 +56,7 @@ export function useChats(chats: Ref) { const formattedGroups = [] as Array<{ id: string label: string - items: Array + items: Array }> // Add groups that have chats diff --git a/app/layouts/default.vue b/app/layouts/default.vue index 4cf32e2..ff2bfd4 100644 --- a/app/layouts/default.vue +++ b/app/layouts/default.vue @@ -1,5 +1,6 @@