Spaces:
Sleeping

MingruiZhang commited on
Commit
5ec491a
·
unverified ·
1 Parent(s): 09e5d25

feat: Setup postgres and prisma (#50)

Browse files

https://vercel.com/landing-platform/~/stores/postgres/store_kmMuRzKbVnJ5IGpL/guides

<img width="311" alt="image"
src="https://github.com/landing-ai/vision-agent-ui/assets/5669963/2bceb4d8-cbfd-45ea-a98e-97220f718d70">

**Server function to migrate**

- [DONE] Create user
- [DONE] Logout user create Chat with init message
- [DONE] Logout out user create message into existing chat
- [DONE] Login user show chat history
- [DONE] Login user create message into existing chat
- [DONE] Delete Chat

25 files changed +589 -302
Files changed (25)
app/all/chat/[id]/page.tsx+7-5
app/all/layout.tsx+26-26
app/api/auth/[...nextauth]/route.ts+1-1
app/api/upload/route.ts → app/api/chat/create/route.tsRenamed+11-26
app/api/vision-agent/route.ts+3-3
app/chat/[id]/page.tsx+6-3
app/chat/layout.tsx+4-4
app/chat/page.tsx+8-6
app/project/layout.tsx+2-2
auth.ts+31-13
components/Header.tsx+4-4
components/chat-sidebar/ChatCard.tsx+7-8
components/chat-sidebar/ChatListSidebar.tsx+2-2
components/chat/ImageSelector.tsx+3-2
components/chat/index.tsx+4-4
components/project/ProjectChat.tsx+37-39
components/ui/Icons.tsx+2-2
lib/db/functions.tsAdded+145
lib/db/prisma.tsAdded+5
lib/db/types.tsAdded+8
lib/hooks/useVisionAgent.ts+27-32
lib/kv/chat.ts+118-118
package.json+5-2
pnpm-lock.yaml+64
prisma/schema.prismaAdded+59