This project is bootstrapped with create-next-app.
This project provides an interactive application that integrates reviews from Rate My Professor using a combination of web scraping and AI-based query processing. Utilizing Next.js, this application allows users to search for professor reviews and interact with an AI assistant to receive personalized recommendations.
- Rate My Professor Integration: The application allows you to fetch and display reviews for professors using the
scrapegraphailibrary. It leverages a Pinecone vector database for semantic search and retrieval. - Chat Interface: The application includes a chat interface powered by OpenAI's GPT-4o-mini model. You can type in your professor-related questions, and the AI will respond with recommendations based on the reviews.
- Customizable System Prompt: The system prompt provides the AI with clear instructions on how to behave, including specific examples of questions to address, how to retrieve information, and how to format its responses.
To install the project and its dependencies, follow these steps:
- Clone the repository.
- Navigate into the project directory.
- Install the required dependencies:
npm install- Set up environment variables by creating a
.envfile and including yourOPENAI_API_KEY,PINECONE_API_KEY, and other relevant configuration parameters just follow the.env.examplefile.
To run the application in development mode, execute the following command:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
Use the chat interface to ask questions about professors and fetch reviews by entering the desired professor’s Rate My Professor link into the input field.
/api/scrape: This route is used to fetch and display reviews from Rate My Professor. It sends a POST request with a URL to ratemyprofessor.com. The API call is asynchronous and utilizes ascrapegraphaiscript to parse the reviews and return results.
The project is designed to be deployed using Vercel. Follow the deployment guide on the Vercel platform to set up production hosting.