Skip to content

Latest commit

 

History

History
102 lines (77 loc) · 2.8 KB

README.md

File metadata and controls

102 lines (77 loc) · 2.8 KB

AIDe- full stack AI document chatting app

A fullstack app to allow users to upload files (PDF/DOCX/TXT) and start chatting with the contents of the files with AI using the following stack:

  • Next.js
  • Prisma
  • Tailwind CSS
  • tRPC + Zod + TypeScript
  • React Query
  • LangChaing
  • OpenAI

Online platform used:

This app is based on the tutorial by Josh with lots of customizations and enhancements:

  • Visual design
    • customized branding
    • animated icon / preview / background
    • loading screens - for enhanced perceived responsiveness
  • Backend
    • Handle and process DOCX and TXT files - the original add only process PDF files
    • Vercel edge function - circumvents the limitations of Vercel free plan
    • Refactored codes - more readable and maintainable
  • Bug Fix
    • Filter Pinecone db with metadata - Pinecone free plan no longer supports namespace and this broke the whole app
    • React Query did not revalidate owing to mutation of the original values
    • Delete button didn't delete the associated stored file and Pinecone storage - the original app leaves out all the files / vectors on the web storage

Features of the AIDe App

  • Homepage homepage
  • Document Upload Document Upload
  • Video Upload Chatting

Installation

  1. Clone the project repository and pull to local environment

  2. Create a .env file in the root directory and add the following

/* Kinde */
KINDE_CLIENT_ID=
KINDE_CLIENT_SECRET=
KINDE_ISSUER_URL=
KINDE_SITE_URL=
KINDE_POST_LOGOUT_REDIRECT_URL=
KINDE_POST_LOGIN_REDIRECT_URL=

/* PlanetScale */
DATABASE_URL=

/* Uploadthing */
UPLOADTHING_SECRET=
UPLOADTHING_APP_ID=

/* Pinecone */
PINECONE_API_KEY=
PINECONE_ENVIRONMENT=gcp-starter

/* Openai */
OPENAI_SECRET_KEY=

/* Stripe */
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
  1. Set up the database
pnpm generate
pnpx prisma db:push
pnpx prisma postinstall

  1. Install dependencies and run the dev server
pnpm install
pnpm dev

  1. For the database client Prisma Studio, run the following command:
pnpx prisma studio