Alumni Mentorship Platform: MentorMatch
As Sherlock, I've deduced your request: Design and prototype a web-based platform connecting university alumni mentors with current students/mentees. Core focus: intelligent pairing (matching algorithm) and QA (Quality Assurance system for matches + Q&A forum for mentorship interactions). I'll provide a complete blueprint, including architecture, code prototypes, deployment guide, and testing plan.
This is a full-stack MVP (Minimum Viable Product) built for scalability. Estimated build time: 1-2 weeks for a dev team.
1. High-Level Architecture
code Copy code
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Frontend │ │ Backend │ │ Database │
│ (React/TS) │◄──►│ (Node.js/TS) │◄──►│ (PostgreSQL) │
│ - Dashboards │ │ - API/GraphQL │ │ - Users │
│ - Pairing UI │ │ - Matching AI │ │ - Profiles │
│ - Q&A Forum │ │ - Auth/JWT │ │ - Matches │
└─────────────────┘ │ - QA Validation │ │ - Q&A Threads │
└──────────────────┘ └─────────────────┘
│
┌──────────────────┐
│ ML Service │
│ (TensorFlow.js) │ ← Profile vectors
└──────────────────┘
Frontend : React + Tailwind CSS + Vite for fast UI.
Backend : Node.js + Express + TypeScript + Apollo Server (GraphQL).
Database : PostgreSQL (structured data) + pgvector extension for vector similarity.
Matching : Cosine similarity on TF-IDF vectorized profiles (skills, interests, goals).
QA Features :
Pairing QA : Automated match scoring, feedback loops, A/B testing.
Mentorship QA : Q&A forum with mentor responses, AI-moderation, satisfaction surveys.
Auth : JWT + OAuth (Google/University SSO).
Deployment : Vercel (frontend), Render/Heroku (backend), Neon (free Postgres).
2. Key Features
User Roles : Alumni (Mentors), Students (Mentees), Admins.
Profiles : Skills (tags), Interests, Career Goals, Availability, Location (geo-filter).
Pairing Dashboard : Suggest matches, accept/reject, chat initiation.
Q&A Forum : Threaded questions per pair or global, with upvoting/answers.
QA Tools : Match quality metrics (e.g., 85% similarity threshold), post-match surveys, analytics.
3. Database Schema (PostgreSQL)
sql Copy code
-- Run this in Neon/Supabase
CREATE EXTENSION vector;
CREATE TABLE users (
id SERIAL PRIMARY KEY,
email VARCHAR UNIQUE,
role ENUM('mentor', 'mentee', 'admin'),
profile_vector VECTOR(128) -- For matching
);
CREATE TABLE profiles (
id SERIAL PRIMARY KEY,
user_id INTEGER REFERENCES users(id),
skills TEXT[], -- e.g., ['Python', 'AI']
interests TEXT[],
goals TEXT,
location POINT, -- lat/long
availability JSONB -- e.g., {"mon": ["9-12"]}
);
CREATE TABLE matches (
id SERIAL PRIMARY KEY,
mentor_id INTEGER REFERENCES users(id),
mentee_id INTEGER REFERENCES users(id),
score FLOAT, -- 0-1 similarity
status ENUM('pending', 'accepted', 'rejected', 'completed'),
created_at TIMESTAMP DEFAULT NOW()
);
CREATE TABLE qa_threads (
id SERIAL PRIMARY KEY,
match_id INTEGER REFERENCES matches(id),
question TEXT,
answer TEXT,
upvotes INTEGER DEFAULT 0
);
4. Pairing Algorithm (Core Logic)
Rule-based + Vector Similarity:
Vectorize profiles: TF-IDF on skills/interests/goals.
Compute cosine similarity.
Filters: Location (<50km), Availability overlap, Role match.
QA: Only suggest >0.7 score; log for review.
Backend Code Prototype (Node.js/Express + TensorFlow.js) :
typescript Copy code
// backend/matching.ts
import { Client } from 'pg';
import * as tf from '@tensorflow/tfjs-node';
import { cosineSimilarity } from 'ml-distance-cosine'; // npm i ml-distance-cosine
const db = new Client({ connectionString: process.env.DATABASE_URL });
export async function findMatches(menteeId: number, limit = 5) {
const mentee = await db.query('SELECT profile_vector FROM profiles p JOIN users u ON p.user_id = u.id WHERE u.id = $1 AND u.role = $2', [menteeId, 'mentee']);
const mentors = await db.query(`
SELECT u.id, p.profile_vector, ST_Distance(p.location, m.location) as dist
FROM profiles p JOIN users u ON p.user_id = u.id
WHERE u.role = 'mentor' AND dist < 50000 -- 50km
`);
const matches: { id: number; score: number }[] = [];
for (const mentor of mentors.rows) {
const sim = cosineSimilarity(mentee.rows[0].profile_vector, mentor.profile_vector);
if (sim > 0.7) { // QA threshold
matches.push({ id: mentor.id, score: sim });
}
}
matches.sort((a, b) => b.score - a.score).slice(0, limit);
// Insert pending matches (QA-logged)
for (const match of matches) {
await db.query('INSERT INTO matches (mentor_id, mentee_id, score) VALUES ($1, $2, $3)', [match.id, menteeId, match.score]);
}
return matches;
}
// Vectorize on profile update
export async function vectorizeProfile(profileId: number, text: string) {
// Simple TF-IDF stub (use proper tokenizer in prod)
const vector = tf.tidy(() => {
// Embed text → 128-dim vector (use pre-trained model like USE)
return tf.randomNormal([128]); // Placeholder
});
const array = await vector.data();
await db.query('UPDATE profiles SET profile_vector = $1 WHERE id = $2', [Array.from(array), profileId]);
}
5. QA System
graphql Copy code
# backend/schema.graphql
type Query {
qaThreads(matchId: ID!): [QAThread]
}
type Mutation {
askQuestion(matchId: ID!, question: String!): QAThread
answerQuestion(threadId: ID!, answer: String!): QAThread
}
type QAThread {
id: ID!
question: String!
answer: String
upvotes: Int!
}
Frontend Q&A Component (React):
tsx Copy code
// frontend/src/components/QAForum.tsx
import { useQuery, useMutation } from '@apollo/client';
import { gql } from '@apollo/client';
const GET_THREADS = gql`query { qaThreads(matchId: $matchId) { id question answer } }`;
const ASK_QUESTION = gql`mutation { askQuestion(matchId: $matchId, question: $question) { id } }`;
function QAForum({ matchId }: { matchId: string }) {
const { data } = useQuery(GET_THREADS, { variables: { matchId } });
const [ask] = useMutation(ASK_QUESTION);
return (
<div className="p-4 bg-white rounded shadow">
<h2>Q&A</h2>
{data?.qaThreads.map(thread => (
<div key={thread.id} className="border p-2 mb-2">
<p>Q: {thread.question}</p>
{thread.answer && <p>A: {thread.answer}</p>}
</div>
))}
<input type="text" placeholder="Ask a question..." onKeyDown={(e) => {
if (e.key === 'Enter') ask({ variables: { matchId, question: e.currentTarget.value } });
}} />
</div>
);
}
6. Frontend Dashboard Wireframe (Text-Based)
code Copy code
Mentee Dashboard:
┌─────────────────────────────┐
│ Matches (Score: QA'd) │
│ - John (AI, 0.92) [Accept] │
│ - Jane (Data, 0.81) [Chat] │
└─────────────┬────────────────┘
│
┌─────────────────────────────┐
│ Q&A Forum │
│ Q: How to prep for FAANG? │
│ A: Focus on LeetCode... │
└─────────────────────────────┘
Full React app starter: GitHub Repo Template (clone & deploy).
7. Deployment & Testing (QA Plan)
Setup :
code Copy code
# Backend
npm init -y && npm i express apollo-server tfjs-node pg ml-distance-cosine
# Frontend
npm create vite@latest . -- --template react-ts && npm i @apollo/client graphql tailwindcss
Env Vars : DATABASE_URL, JWT_SECRET.
Deploy :
Frontend: vercel --prod
Backend: render.com (free tier).
QA Testing :
Test Case Steps Expected Pairing Accuracy Create 10 profiles, run matches >80% high-score pairs Q&A Flow Post Q → Answer → Upvote Real-time updates Edge Cases Low-similarity reject, geo-filter No invalid matches Use Cypress for E2E: npm i cypress.
Next Steps
Customize : University-specific (e.g., add LinkedIn import)?
Enhance : Add video chat (Twilio), ML embeddings (OpenAI API).
Launch : Seed with 100 fake profiles for demo.
Query me for code expansions, bug fixes, or iterations. Case closed? Or more clues? 🕵️♂️