GradGather’s people recommender is a standalone Flask microservice that runs alongside the main Node.js application. It analyses shared interests across alumni and student profiles and returns ranked connection suggestions based on cosine similarity scores. While the main app handles authentication, profiles, and messaging on port 3000, this Python microservice runs independently on port 5000, exposing a single REST endpoint that the frontend queries directly via JavaScript.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/meenalsingh0/GradGather/llms.txt
Use this file to discover all available pages before exploring further.
How It Works
The recommender uses a straightforward three-step process: load a structured dataset, compute pairwise similarity across all profiles, then serve ranked suggestions on demand.Load the Interest Dataset
At startup, the microservice reads a CSV file where each row represents a person and each column after the first is a binary interest flag —
1 means the person has that interest or skill, 0 means they do not. This matrix is loaded once into a pandas DataFrame and held in memory.Compute the Cosine Similarity Matrix
sklearn.metrics.pairwise.cosine_similarity computes a pairwise similarity score between every combination of person-vectors. The result is wrapped in a pandas DataFrame indexed by person name so that lookups are O(1) label-based slices.1.0; people with no overlapping interests produce 0.0. All other profiles fall somewhere in between.Interest Categories
The recommender’s matching logic is built on eleven binary skill/interest columns defined intempelates/people_recommender_dataset.csv.
| Column | Type | Description |
|---|---|---|
Person | string | Full name of the alumni or student |
Machine Learning | 0 / 1 | Interest in ML concepts and frameworks |
Data Science | 0 / 1 | Data analysis, statistics, and visualisation |
Python | 0 / 1 | Python programming |
Web Development | 0 / 1 | General full-stack or backend web work |
JavaScript | 0 / 1 | JavaScript (front or back end) |
React | 0 / 1 | React.js library |
HTML | 0 / 1 | HTML mark-up |
CSS | 0 / 1 | CSS styling |
AI | 0 / 1 | Artificial intelligence |
Natural Language Processing | 0 / 1 | NLP techniques |
Deep Learning | 0 / 1 | Deep learning and neural networks |
Dataset
The primary dataset used by the microservice intempelates/recom.py is people_recommender_dataset.csv. The alternative version in people/shreyas/recom.py points to people/database.csv, which holds 19 real GradGather team member profiles and includes the extra Mysql column.
Below is an excerpt of people/database.csv:
The
people_recommender_dataset.csv file in tempelates/ uses 11 interest columns (no Mysql) and contains a larger set of synthetic profiles. Both datasets share the same schema pattern — Person name first, then binary interest flags — so the same microservice code works with either file by changing only the pd.read_csv(...) path.Running the Microservice
The recommender runs as a separate process from the main Node.js application. You will need two terminal sessions open during development.Navigate to the microservice directory
Use the
tempelates/ directory for the synthetic dataset, or people/shreyas/ for the version backed by real team member data.Start the Flask server
http://localhost:5000. You should see output similar to:CORS is enabled on the Flask server via
flask_cors.CORS(app). This is required because the browser frontend is served from localhost:3000 and makes cross-origin requests to localhost:5000. Without it, browsers would block the fetch call under the Same-Origin Policy.Full Microservice Source
Below is the complete source oftempelates/recom.py exactly as it appears in the repository.
Frontend Integration
The recommender ships with a dedicated frontend page attempelates/recom.html — a minimal form that accepts a person name, calls the Flask API, and renders ranked results in the browser.
tempelates/recom.js drives all interactivity. When the user clicks Get Recommendations, it reads the name input, calls http://localhost:5000/recom with CORS mode enabled, and iterates over the returned JSON object to render each match with its similarity score:
n parameter is not exposed in the default HTML form — the frontend always fetches the default 5 recommendations. You can add an n field to the form or pass it programmatically when integrating the endpoint elsewhere in the app.