Skip to content

Mishra-Manit/bedathon

Repository files navigation

Bed-A-Thon ๐Ÿ 

Roommates and Housing Matching for Virginia Tech

Bed-A-Thon helps VT students find compatible roommates and discover apartments that fit their preferences (budget, bedrooms, distance, amenities). It combines a modern Next.js frontend with a FastAPI backend, Supabase integration, and a local SQLite fallback for development.


โœจ Key Features

  • ๐Ÿ”— Roommate matching based on lifestyle preferences, budget, year, and major
  • ๐Ÿ˜ Apartment matching by distance to VT, bedrooms, budget fit, and amenity overlap
  • ๐ŸŽจ Clean, responsive UI built with Shadcn UI + Tailwind CSS
  • ๐Ÿ”‘ OAuth sign-in with Google (via Supabase Auth)
  • ๐Ÿ—„ Supabase profiles with optional local SQLite for development
  • ๐Ÿ“ž Voice call integration (optional) to โ€œget the latest infoโ€ from an apartment

๐Ÿ— Architecture

Frontend (frontend/)

  • Framework: Next.js (App Router), React, TypeScript
  • Styling: Tailwind CSS + Shadcn UI
  • Auth: Supabase Auth

Backend (backend/)

  • Framework: FastAPI (Uvicorn)
  • Data: Supabase (production) or SQLite (development fallback)
  • Matching: Python algorithms for roommates and apartments

Data Sources

  • Apartment data: imported from VT JSON sources or Supabase DB
  • Profiles: stored in Supabase profiles table via backend APIs

๐Ÿงฎ Matching Algorithms

Roommate Matching (default weights)

  • Lifestyle vector (cleanliness, noise, study, social, sleep): 50%
  • Budget proximity: 25%
  • Year match: 10%
  • Major similarity: 15%

Formula:
score = 0.50*lifestyle + 0.25*budget + 0.10*year + 0.15*major

Apartment Matching (default weights)

  • Price fit: 35% (best within ยฑ10% of budget)
  • Distance to VT: 30% (best near 0.5 miles)
  • Amenity overlap: 20% (Laundry, Parking, WiFi bonuses)
  • Study-friendliness: 10% (WiFi + no pool if study-focused)
  • Parking: 5%

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18+
  • Python 3.10+
  • Supabase project (optional for local dev; required for full profiles)
  • macOS/Linux recommended

Environment Variables

Create:

  • frontend/.env.local
  • backend/.env

๐Ÿ’ก For local dev, omit DATABASE_URL to use sqlite:///./bedathon.db.

Install and Run

Backend

cd backend
pip install -r requirements.txt
uvicorn main:app --reload

Frontend

cd frontend
npm install
npm run dev

๐ŸŒฑ Seeding Apartment Data (local dev)

cd backend
python import_apartments_to_db.py

๐Ÿ”‘ Sign-in and Profiles

  1. Click "Sign in with Google" on the landing page
  2. Complete onboarding form (budget, bedrooms, preferences)
  3. Backend creates/updates Supabase profile
  4. Access Roommate Matches and Apartment Matches tabs

๐Ÿ”Œ API Overview (Backend)

Base URL: http://localhost:8000

Core Endpoints

  • GET /health โ†’ Health check
  • POST /profiles โ†’ Create/update profile
  • GET /profiles/me โ†’ Fetch current profile
  • PUT /profiles/me โ†’ Update profile

Matching Endpoints

  • POST /matching/roommate-preferences โ†’ Save preferences
  • POST /matching/roommate-matches โ†’ Get roommate matches
  • POST /matching/apartment-matches-for-preferences โ†’ Get apartment matches
  • GET /matching/apartment-matches/{profile_id}?limit=100 โ†’ Matches for profile
  • GET /matching/apartments โ†’ All apartments

Note: Voice call endpoint exists in codebase but may be disabled.

๐Ÿค– AI Agent - Apartment Information Service

HokieNest includes an intelligent AI agent that streamlines the apartment hunting process:

  • Automated Calling โ†’ Agent calls apartments that roommates have selected
  • Information Gathering โ†’ Collects current pricing, bedroom availability, amenities, and lease terms
  • Summary Generation โ†’ Creates comprehensive email summaries with all collected details
  • Real-time Updates โ†’ Ensures apartment information is current and accurate

The AI agent eliminates the need for students to make multiple phone calls, saving time and providing standardized information across all potential housing options.

๐ŸŽจ Frontend Walkthrough

  • Onboarding โ†’ Form for budget, bedrooms, lifestyle preferences
  • Roommate Matches โ†’ Grid with compatibility badges
  • Apartment Matches โ†’ Price, distance, amenity badges + "why it matches" reasons

๐Ÿ›  Development Tips

Port Management

  • Next.js auto-increments ports (3000 โ†’ 3001โ€ฆ)
  • Ensure NEXT_PUBLIC_BACKEND_URL matches backend (default: 8000)

Database Options

  • SQLite: Omit DATABASE_URL for local SQLite
  • Reset: Delete/recreate bedathon.db if errors occur
  • Supabase Postgres: Use actual DB credentials, not service role key

Authentication

  • If /profiles returns 401, re-login and check Bearer token is sent

๐Ÿ“œ Scripts & Utilities

Script Purpose
backend/import_apartments_to_db.py Import JSON apartments
backend/comprehensive_data_scraper.py Scrape VT housing data
backend/update_apartments_from_vt_sheet.py Sync from sheet
backend/test_matching_api.py Sample API calls

๐Ÿ—บ Roadmap

  • Save/Like apartments and roommate profiles
  • Group-based housing recommendations
  • Map view with filters by distance/amenities
  • Availability and contact integration per apartment

๐Ÿ“ธ Screenshots

Add screenshots to frontend/public/ and embed them here:

![Landing Page](frontend/public/screenshots/landing.png)
![Onboarding](frontend/public/screenshots/onboarding.png)
![Roommate Matches](frontend/public/screenshots/roommate-matches.png)
![Apartment Matches](frontend/public/screenshots/apartment-matches.png)

๐Ÿค Contributing

  1. Fork this repo
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Run linters/tests before pushing
  4. Open a PR with description + screenshots if UI changes

๐Ÿ“ License

MIT (or your preferred license)

๐Ÿ™ Acknowledgments


Built with โค๏ธ for the Virginia Tech community

Go Hokies! ๐Ÿฆƒ

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •