Skip to content

Latest commit

 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BondUForward

🔥 Tinder for DSA - A real-time matchmaking system that pairs students based on their problem-solving level and learning goals.

React Node.js PostgreSQL Socket.io

✨ Features

  • LeetCode Integration: Fetches verified problem-solving statistics via GraphQL API
  • Weighted Scoring Algorithm: Calculates compatibility using complementary skills, skill gap, goal alignment, and learning style
  • Real-time Matchmaking: Socket.io powered instant notifications when matches are found
  • Tinder-style UI: Swipe right to like, left to pass, see compatibility breakdown
  • Real-time Chat: Message your matches instantly with typing indicators

🛠️ Tech Stack

Layer Technology
Frontend React 18, TypeScript, Vite, React Router
Backend Node.js, Express, TypeScript
Database PostgreSQL 15
Real-time Socket.io

🧮 Matching Algorithm

The weighted scoring algorithm uses core data structures to rank user compatibility:

Component Weight Description
Complementary Skills 35% Set intersection of strong topics ↔ learning goals
Skill Gap 25% Users within 15 skill points for peer learning
Goal Alignment 20% Similar difficulty preferences & daily commitment
Learning Style 10% Visual, practice, or collaborative match
Language Match 10% Common programming languages

Uses a Priority Queue (Max-Heap) to efficiently retrieve top 10 matches.

🚀 Quick Start

Prerequisites

  • Node.js 20+
  • PostgreSQL 15+

Setup

# Clone the repository
git clone https://github.com/Aryaneefds/BONDUFORWARD.git
cd BONDUFORWARD

# Setup Backend
cd backend
npm install
cp .env.example .env
# Edit .env with your database credentials
npm run dev

# Setup Frontend (new terminal)
cd frontend
npm install
cp .env.example .env
npm run dev

Database Setup

# Create database and user
sudo -u postgres psql -p 5433 -c "CREATE USER bondu WITH PASSWORD 'bondupassword';"
sudo -u postgres psql -p 5433 -c "CREATE DATABASE bonduforward OWNER bondu;"

# Initialize schema
psql -h localhost -p 5433 -U bondu -d bonduforward -f backend/src/db/schema.sql

Access the app at http://localhost:5173

📁 Project Structure

BondUForward/
├── backend/
│   ├── src/
│   │   ├── server.ts           # Express + Socket.io server
│   │   ├── config/             # Database configuration
│   │   ├── controllers/        # Auth, Profile, Match handlers
│   │   ├── matchmaking/        # Scoring algorithm & priority queue
│   │   ├── services/           # LeetCode API integration
│   │   └── socket/             # Real-time event handlers
└── frontend/
    └── src/
        ├── pages/              # Landing, Auth, Discover, Matches
        ├── components/         # DiscoverCard, Navbar
        ├── hooks/              # useSocket
        └── context/            # AuthContext

🔒 API Endpoints

Authentication

  • POST /api/auth/register - Register with LeetCode username
  • POST /api/auth/login - Login
  • GET /api/auth/me - Get current user

Profile

  • POST /api/profile/sync-leetcode - Sync LeetCode stats
  • PUT /api/profile/dsa-preferences - Update learning preferences
  • GET /api/profile/:userId - Get user profile

Matches

  • GET /api/matches/discover - Get potential matches (scored)
  • POST /api/matches/swipe - Record swipe action
  • GET /api/matches - Get user's matches
  • GET /api/matches/:matchId/messages - Get chat messages

📡 Socket Events

Event Direction Description
new_match Server → Client Mutual match notification
new_message Server → Client New chat message
user_typing Server → Client Typing indicator
send_message Client → Server Send chat message
join_match Client → Server Join chat room

📊 Performance

  • 25% reduction in rematching attempts through:
    • Event-driven architecture with instant Socket.io broadcasts
    • Client-side caching of swipe actions
    • Debounced swipe batching

📄 License

MIT License - see LICENSE for details.


Built with ❤️ for the coding community

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages