This is a fullstack Q&A app that answers question based on the text documents provided to it. It uses LangChain to communicate with OpenAI API to interpret questions and give answers.
- Auth0
Create a Single Page Application in Auth0.com > grab application's domain and cleint ID. - MongoDB
Create a MongoDB Atlas project > grab connection string and admin password. - OpenAI
Create an OpenAI account > grab your API key. - in the server directory create a .env file and set these values:
ISSUER = {AUTH0-APPLICATION-DOMAIN}
OPENAI_API_KEY = {YOUR-OPENAI-API-KEY}
MONGOPASSWORD = {YOUR-MONGODB-PASSWORD}
- in the client directory create a .env file and set these values
VITE_DOMAIN = {AUTH0-APPLICATION-DOMAIN}
VITE_CLIENT_ID = {AUTH0-APPLICATION-CLIENT-ID}
cd server
npm start
then, in a new terminal,
cd client
npm run dev
The app currently reads from two provided sample documents about Spinosaurus (of course). Namely, "about.txt" and "description.txt". You can replace your own documents and change the corresponding paths in server/src/AI/QA.ts, so that it gives answers according to your documents.
