A web app that summarizes RateMyProfessor reviews with AI and indexes past instructors for any course to help students choose classes with confidence.
Check it out! https://ubcprofpilot.vercel.app
- β¨ Features
- π οΈ Tech Stack
- π Project Structure
- π Getting Started
- π³ Docker
- π’ Deployment
- π§ Configuration
- π‘ API Endpoints
- π Data Sources
- π License
- Professor Search: Search for UBC professors by name and view comprehensive ratings data
- AI-Powered Summaries: Get AI-generated summaries of professor ratings using Gemini API
- Course Search: Find all professors who have taught a specific course
- Real-time Progress Updates: Live progress tracking during data scraping via Socket.IO
- Modern UI: Responsive interface built with React and TailwindCSS
- Department Filtering: Support for 140+ UBC departments with RateMyProfessors integration
- Optimized Performance: Connection pooling, browser reuse, and efficient data fetching
- Framework: ReactJS
- Styling: TailwindCSS
- Bidirectional Communication: Socket.IO
- Runtime: Node.js
- Framework: Express.js
- Web Scraping:
- Playwright (Chromium browser)
- Cheerio (HTML parsing)
- API Integration: Gemini API (for summarizing ratings)
- Bidirectional Communication: Socket.IO (progress updates on searches)
UBC-ProfPilot/
βββ frontend/ # React frontend application
β βββ public/ # Static files
β β βββ ProfPilot_Icon.png
β β βββ index.html
β βββ src/
β βββ assets/ # Images and media files
β βββ components/ # React components
β β βββ circular-progress.js # Progress indicator component
β β βββ course-search.js # Course search interface
β β βββ prof-search.js # Professor search interface
β βββ app.js # Main application component
β βββ config.js # Configuration (university, departments, API URL)
β βββ index.css # Global styles
β βββ index.js # Application entry point
β
βββ backend/ # Node.js backend server
β βββ src/
β β βββ browser.js # Playwright browser automation
β β βββ course-data.js # Course data scraping logic
β β βββ index.js # Express server and Socket.IO setup
β β βββ prof-data.js # Professor data scraping and AI summary
β β βββ prof-url.js # Professor URL lookup
β βββ Dockerfile # Docker configuration for Playwright
β βββ package.json # Backend dependencies
- Node.js (v14 or higher recommended)
- npm (v6 or higher)
- Gemini API Key (required for professor rating summaries)
- Navigate to the
backenddirectory:cd backend - Install dependencies (this will also install Chromium browser via Playwright):
npm install
- Create a
.envfile in thebackenddirectory with the following variables:GEMINI_API_KEY=your_gemini_api_key_here # FRONTEND_URL is optional for local development # Only set it for production deployment # FRONTEND_URL=https://your-frontend-url.com
- Start the server:
The server will start on
npm start
http://localhost:3001
- Navigate to the
frontenddirectory:cd frontend - Install dependencies:
npm install
- Create a
.envfile in thefrontenddirectory with the following variable:# REACT_APP_BACKEND_URL is optional for local development # Only set it for production deployment # REACT_APP_BACKEND_URL=https://your-backend-url.com
- Start the development server:
The application will be available at
npm start
http://localhost:3000
The backend includes a Dockerfile that uses the official Playwright image to ensure all browser dependencies are properly installed. This is required for deployment environments.
Key Docker features:
- Based on
mcr.microsoft.com/playwright:v1.52.0-jammy - Installs Chromium browser with all system dependencies
- Direct Node.js execution (PID 1) for proper signal handling
- See more in
backend/Dockerfile
- Platform: Render Web Service
- Build Environment: Select Docker (required for Playwright Chromium)
- Configuration:
- Set root directory to
backend - Add environment variables:
GEMINI_API_KEY- Your Gemini API key for generating professor summariesFRONTEND_URL- Full URL of your deployed frontend (e.g.,https://your-frontend.vercel.app)
- Set root directory to
- Platform: Vercel (Recommended for fast cold starts and CDN distribution)
- Framework Preset: Select "Create React App"
- Configuration:
- Set root directory to
frontend - Add environment variable:
REACT_APP_BACKEND_URL- Full URL of your deployed backend (e.g.,https://your-backend.onrender.com)
- All other settings can be left as default
- Set root directory to
University configuration can be modified in frontend/src/config.js:
export const UNIVERSITY_CONFIG = {
name: "University of British Columbia",
shortName: "UBC",
number: "1413", // RateMyProfessors university ID
};The config.js file also contains mappings for 140+ UBC departments to their RateMyProfessors department IDs. These are used for course searches.
The backend provides the following REST API endpoints:
Search for a professor and get their ratings data.
Query Parameters:
fname- First namelname- Last nameuniversity- University number (e.g., '1413' for UBC)
Response:
{
"URL": "https://www.ratemyprofessors.com/professor/...",
"first_name": "John",
"last_name": "Doe",
"university": "University of British Columbia",
"would_take_again": 85.5,
"difficulty": 3.2,
"overall_quality": 4.5,
"ratings": [...],
"summary": "AI-generated summary..."
}Find all professors who have taught a specific course.
Query Parameters:
course_name- Course code (e.g., 'CPSC 110')department_number- Department ID from RateMyProfessorsuniversity_number- University ID (e.g., '1413')
Response:
{
"course_name": "CPSC 110",
"professors_count": 5,
"professors": [
{
"name": "John Doe",
"first_name": "John",
"last_name": "Doe",
"department": "Computer Science",
"profile_url": "https://...",
"num_ratings": 42
}
]
}The application uses Socket.IO for real-time communication and progress updates during searches:
Client β Server Events:
start-professor-search- Initiates a professor searchskip-ratings-load- Skips loading individual ratings during professor searchstart-course-search- Initiates a course searchskip-professors-load- Skips loading professor details during course searchstop-search- Cancels an ongoing search
Server β Client Events:
search-progress- Progress updates during professor searchsearch-error- Error notification for professor searchcourse-search-progress- Progress updates during course searchcourse-search-error- Error notification for course searchcourse-search-complete- Course search completionserver_shutdown- Server shutdown notification
All professor ratings and course information are sourced from RateMyProfessors.com. The application:
- Scrapes data in real-time (no database required)
- Uses Playwright for dynamic content loading
- Generates AI summaries using Google's Gemini models
This project is licensed under the GNU General Public License v3.0.