How giridharrnair/profstatsutd works
Project Type and Purpose
• It’s a full-stack project with a Chrome extension frontend (React built with Vite) and a Golang backend.
• The extension is used to present course/professor information to students by merging rating data and grade distributions. The data is sourced from CSV files (raw_data) and loaded into a SQLite database created/populated via Python scripts.
File Structure – Key Components
• Frontend: Located primarily in the "src" folder, with components such as course-info.jsx, grades-graph.jsx, lookup-form.jsx, and professor-info.jsx. There’s an index.html at the root, with Vite configuration provided.
• Backend API: Contained in the "api" folder. You have:
• Controllers (e.g., course_information.go, professor_information.go, search_suggestions.go) for handling HTTP requests.
• Specific modules for courses, professors, and database operations (API/db, API/course, API/professor).
• Tests for these controllers and modules indicate a layered and testable design.
• The “api/Dockerfile” indicates containerization for deployment on Azure.
• Database: Instead of a separate database configuration file, SQLite is used. The initialization and population are handled by Python scripts in the "db_setup" folder, which processes CSV files in the "raw_data" directory.
• Development and Deployment: GitHub workflows and related CI/CD configurations in the ".github" folder and package files (package.json, package-lock.json) ensure that deployment (e.g., Chrome Web Store deployments) and code quality (ESLint, Prettier, etc.) are maintained.
Main Components and Their Relationships
a. Frontend (Chrome Extension User Interface)
• Component: React application built with Vite (located in src/).
• Role: Handles user interactions, displays course and professor details, and gathers student queries.
• Interaction: Sends HTTP requests (REST API) to the backend for data such as course information or rating searches.
b. Backend API Server
• Component: Golang service (located in the api/ folder with controllers, course, professor, and database modules).
• Role: Processes requests coming from the frontend, handles business logic, interacts with the database, and returns data.
• Pattern: Follows RESTful design with endpoints grouped in controllers.
• Containerization: Runs inside a Docker container (evident from the Dockerfile) and deployed on Azure Web App.
c. Database and Data Pipeline
• Component: SQLite database that is built and populated by Python scripts (db_setup folder).
• Role: Stores course, professor, and related grade information.
• Data Ingestion: CSV files (raw_data directory) are processed to fill the database.
• Interaction: The backend Golang API interacts with this database through defined DB methods (e.g., get_course_suggestions.go, init_db_conn.go).
d. CI/CD and Deployment Pipelines
• Components: GitHub workflows (in .github/workflows) including deployments to the Chrome Web Store, linting, and testing workflows.
• Role: Automation and continuous deployment/integration ensuring code quality and smooth deployment cycles.
Architectural Patterns and Design Principles
• Separation of Concerns: Clear division between frontend (user interface in React) and backend (Golang API).
• RESTful API: Controllers handle discrete API endpoints.
• Containerization: Use of Docker for easier, isolated deployment, especially on Azure.
• Data Processing Pipeline: Python scripts are used to set up and maintain the database based on CSV input.
• Testing: Directory structure indicates that testing is integral to both the API (controllerstest) and individual modules (course_test.go, professor_test.go).