Skip to content

HAMED707/Student-Hub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

88 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ Student Hub

The all-in-one platform for student housing in Egypt β€” find a room, match with the right roommate, and manage everything in one place.

Django DRF React Tailwind PostgreSQL License


πŸ“– Overview

Student Hub connects students with verified accommodation and compatible roommates. Property owners list rooms and manage bookings; students search by location, filter by budget, book a place, and get matched with potential roommates through an AI compatibility engine. The platform also bundles community groups, in-app messaging, reviews, payments, and real-time notifications into a single experience.

Built as a full-stack application with a Django REST backend and a React (Vite) frontend.


✨ Features

🏠 Accommodation

  • Browse and search student housing with map-based discovery (Leaflet).
  • Filter by city, university proximity, budget, and amenities.
  • Detailed property listings with image galleries.
  • Save favorites and revisit them later.

🀝 AI Roommate Matching

  • Build a roommate profile (lifestyle, study habits, cleanliness, budget, etc.).
  • Get ranked matches via scikit-learn cosine similarity β€” not naive field counting.
  • Discover compatible students filtered by university and city.
  • Send, accept, reject, and withdraw roommate requests.

πŸ“… Bookings & Payments

  • Request a booking and track its status (request β†’ deposit paid β†’ confirmed β†’ completed).
  • Stripe-powered deposit and payment flow with webhook handling.
  • Owner-side booking management and status updates.

πŸ’¬ Messaging & Community

  • Direct conversations between students and landlords.
  • Community groups and posts for student discussions.

⭐ Reviews & Notifications

  • Leave star ratings and reviews on properties and profiles.
  • Real-time notifications (booking updates, new messages, reviews) via Django Channels (WebSockets).

πŸ” Identity & Trust

  • JWT-based authentication with role separation (Student / Landlord).
  • KYC verification through Persona webhooks.
  • Document upload for landlord verification.

πŸ€– Extras

  • Built-in chatbot widget for support.
  • Services lookup directory.

πŸ› οΈ Tech Stack

Layer Technologies
Backend Django 6, Django REST Framework, SimpleJWT
Real-time Django Channels (ASGI), Redis
Database PostgreSQL
AI / ML scikit-learn (cosine similarity)
Payments Stripe
Identity Persona (KYC)
Frontend React, Vite, React Router v6, Tailwind CSS
UI / Maps Lucide icons, Leaflet / react-leaflet

πŸ—οΈ Architecture

The backend is organized into clean, domain-oriented apps, each exposing its own REST router:

/api
β”œβ”€β”€ auth/           β†’ accounts (registration, login, profiles, verification)
β”œβ”€β”€ properties/     β†’ listings, search, owner CRUD
β”œβ”€β”€ bookings/       β†’ booking lifecycle
β”œβ”€β”€ favorites/      β†’ saved properties
β”œβ”€β”€ reviews/        β†’ property & profile reviews
β”œβ”€β”€ roommates/      β†’ AI matching, requests
β”œβ”€β”€ community/      β†’ groups & posts
β”œβ”€β”€ messaging/      β†’ conversations & messages
β”œβ”€β”€ notifications/  β†’ real-time alerts (Channels)
β”œβ”€β”€ payments/       β†’ Stripe checkout + webhooks
β”œβ”€β”€ services/       β†’ services directory
β”œβ”€β”€ chatbot/        β†’ support assistant
└── kyc/            β†’ Persona identity verification

JWT tokens are obtained at /api/token/ and refreshed at /api/token/refresh/. Stripe and Persona events are handled at /api/webhooks/stripe/ and /api/webhooks/persona/.


πŸš€ Getting Started

Prerequisites

  • Python 3.11+
  • Node.js 18+
  • PostgreSQL
  • Redis (for Channels / real-time features)

1. Clone the repository

git clone <your-repo-url>
cd student-hub

2. Backend setup

cd backend
python -m venv venv
source venv/bin/activate        # Windows: venv\Scripts\activate
pip install -r requirements.txt

# Configure your .env (see below), then:
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver

3. Frontend setup

cd frontend
npm install
npm run dev

The frontend runs on Vite's dev server (default http://localhost:5173) and the API on http://localhost:8000.


πŸ”§ Environment Variables

Create a .env file in backend/ with at least:

SECRET_KEY=your-django-secret-key
DEBUG=True
DATABASE_URL=postgres://user:password@localhost:5432/studenthub
REDIS_URL=redis://localhost:6379/0

STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...

PERSONA_API_KEY=...
PERSONA_WEBHOOK_SECRET=...

🌱 Seed Data

Populate the database with realistic test data:

# Roommate test users (with varying AI match scores)
python manage.py seed_roommate_data
python manage.py seed_roommate_data --reset      # wipe and re-seed

# 40 properties across 10 landlords (with real images)
python manage.py seed_properties
python manage.py seed_properties --reset         # wipe and re-seed
python manage.py seed_properties --skip-images   # fast, no network needed

Test Accounts

Username Password Role Notes
test_student1 Test1234! Student Main test account (Cairo University)
seed_rm_ahmed_sayed Test1234! Student ~100% AI match with test_student1
seed_rm_mohamed_farouk Test1234! Student ~94% AI match
seed_rm_khaled_mostafa Test1234! Student ~84% AI match
seed_rm_amir_samir Test1234! Student ~49% AI match
seed_rm_tarek_nabil Test1234! Student ~29% AI match
seed_landlord_001–010 Pass1234! Landlord 10 landlords with 40 properties

A roommate profile must have is_active = True to appear in AI matching.


🎨 Design System

Token Value
Primary blue #155BC2
Dark navy #091E42
Neutrals Tailwind slate palette
Cards rounded-3xl
Icons lucide-react

πŸ“ Project Structure

student-hub/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ api/                  # DRF app routers (auth, properties, roommates, …)
β”‚   β”œβ”€β”€ accounts/             # User & profile models
β”‚   β”œβ”€β”€ properties/           # Property models + seed command
β”‚   β”œβ”€β”€ roommates/            # Roommate models + AI matching + seed command
β”‚   β”œβ”€β”€ postman/              # API collections
β”‚   └── manage.py
└── frontend/
    └── src/
        β”œβ”€β”€ pages/            # Home, FindRoom, Roommate, Messaging, Community, …
        β”œβ”€β”€ assets/components # Navbar, PropertyCard, ChatbotWidget, …
        β”œβ”€β”€ hooks/            # useMessagingInbox, …
        └── utils/            # properties helpers, …

πŸ—ΊοΈ Roadmap

  • Password recovery / reset flow
  • Send-message endpoint for ongoing conversations + WebSocket delivery
  • Community comments, likes, and shares
  • Full owner property CRUD with media management
  • Student payment-history screens
  • Production deployment & end-to-end QA

πŸ“„ License

Released under the MIT License.


About

A full-stack platform for expat students to find apartments, rooms, and compatible roommates, with location-based search, preferences, and social features.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors