Beavs AI is an application that provides an AI Chatbot that is knowledgeable about OSU's courses. It allows OSU students to interact with an AI agent that can answer course-specific questions.
- Node: You should install the latest version of Node
- Docker: The download link is here, make sure to choose the correct operating system.
-
Clone the repository:
git clone https://github.com/OSU-App-Club/beavsai.git
-
Navigate to the project directory:
cd beavsai
-
Install all the required dependencies to run our Next.js App
npm install
Note
You may come across an peer dependency error when running this command, try npm install --legacy-peer-deps
-
Copy the
.env.example
file to.env.local
:cp .env.example .env.local
-
Message @nyumat on Discord to get the required credentials for the
.env.local
file.
Warning
Do not share these credentials with anyone else. Additionally, you will not be able to run the application without them.
-
Create an AUTH_SECRET environment variable
npx auth secret
-
Start a local instance of our PostgreSQL database using Docker:
docker-compose up -d
Note
Doing this in VSCode's terminal may present you with an error like:
Error: P1010: User postgres
was denied access on the database postgres
.
To fix this, use your system's terminal to run the command.
- Run the Next.js App
npm run dev
Script | Description |
---|---|
dev |
Runs database generation, migration, and starts the Next.js dev server with Turbopack enabled. |
build |
Builds the Next.js application for production. |
start |
Starts the Next.js application in production mode. |
lint |
Runs ESLint to check for code quality issues. |
format |
Formats the codebase with Prettier. |
check-format |
Checks code formatting without making changes. |
type-check |
Runs TypeScript type checks based on the configuration in tsconfig.json . |
db:generate |
Generates Prisma client based on schema and .env.local configuration. |
db:migrate |
Applies migrations for development using .env.local configuration. |
db:studio |
Opens Prisma Studio for database management. |
db:seed |
Seeds the database with initial data. |
If you encounter any issues while running the application, please refer to the following troubleshooting steps:
-
Database Connection Issues: If you are unable to connect to the database, ensure that the Docker container is running. You can check the status of the container by running the following command:
docker ps
If the container is not running, you can start it using the following command:
docker-compose up -d
-
Environment Variables: Ensure that you have copied the
.env.example
file to.env.local
and have filled in the required credentials. If you are missing any credentials, please message @nyumat on Discord. -
Prisma Client Generation: If you are encountering issues with the Prisma client, you can regenerate it by running the following command:
npm run db:generate
If you are new to web development, git, or any of the tools mentioned above, don't worry! We have a few resources to help you get started:
- Web Development 101
- Git Handbook
- Node.js Documentation
- Docker Documentation
- Next.js Documentation
- Prisma Documentation
- PostgreSQL Documentation
- TypeScript Documentation
- ESLint Documentation
- Prettier Documentation
No one is born a master, so don't be afraid to ask questions!
Choose tasks aligned with your skill level to contribute effectively to Beavs AI:
- Frontend: Build UI components for displaying syllabus content, style the interface to align with OSU branding, or implement basic API calls to fetch syllabus data.
- Backend: Create straightforward API endpoints for querying file content, validate and handle basic user inputs, or manage simple data interactions with PostgreSQL.
- Frontend: Implement interactive UI components for search functionality, handle input validation for queries, or manage component state effectively with React hooks.
- Backend: Integrate with Pinecone for semantic search, manage user sessions with secure practices, or develop API endpoints that retrieve and format contextually relevant content for RAG responses.
- Frontend: Optimize the rendering of search results for low-latency response times, implement advanced state management for caching syllabus queries, or introduce features that enhance user experience (e.g., query history, autocomplete).
- Backend: Optimize Pinecone and database queries for speed and scalability, implement complex business logic for query preprocessing and RAG workflows, or enhance backend efficiency by streamlining Langchain workflows to dynamically handle complex queries with large language models.