Skip to content

JaineelVora08/Beacon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”¦ BEACON

Peer Mentoring Platform for Students

Connecting students with experienced seniors through intelligent matching, trust-scored advice, and AI-augmented query resolution.

Django React Neo4j Gemini


πŸ“Œ Problem Statement

Students entering college often struggle to find reliable, domain-specific guidance. Traditional mentoring programs suffer from poor matching, inconsistent quality, and information overload. Beacon solves this by building an intelligent, trust-scored peer mentoring network β€” where seniors' advice is weighted by verified achievements and past track records, queries are augmented by AI, and conflicts across multiple mentors are surfaced transparently.


✨ Key Features

Feature Description
πŸ” Google OAuth + JWT Auth Secure sign-in with Google, role-based access (Student / Senior), refresh-token rotation with blacklisting
πŸ‘€ Rich User Profiles Achievement tracking, domain tagging, experience levels, and availability management
🧠 AI-Powered Query Pipeline Submit questions β†’ get instant provisional answers from Google Gemini β†’ route to matched seniors β†’ synthesise final advice
🀝 Intelligent Mentor Matching 2-hop graph traversal on Neo4j + Pinecone embedding similarity to surface the best-fit seniors and peers
βš–οΈ Trust Score Engine Multi-factor trust score (consistency, alignment, follow-through, achievement weight) to rank advice quality
βš”οΈ Conflict Detection Automatically detects disagreements across senior responses and highlights areas of consensus
πŸ’¬ Direct Messaging Real-time 1-on-1 conversations between students and seniors with request/accept flow
πŸ“… Adaptive Scheduler Celery-powered load balancing, cold-start broadcasting, and fair query distribution
🌐 Domain Graph Neo4j-backed knowledge graph of academic/career domains with embedding-based linking via Pinecone

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        React 18 + Vite                          β”‚
β”‚               Zustand State β”‚ React Router β”‚ Axios              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚  REST API (JWT)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Django 4.2 + DRF Backend                        β”‚
β”‚                                                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ Auth       β”‚ β”‚ User Profile β”‚ β”‚ Domain Management         β”‚   β”‚
β”‚  β”‚ Service    β”‚ β”‚ Service      β”‚ β”‚ Service (Neo4j + Pinecone)β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ Mentor Matchingβ”‚ β”‚ Trust Score  β”‚ β”‚ Query Orchestrator     β”‚  β”‚
β”‚  β”‚ Service        β”‚ β”‚ Service      β”‚ β”‚ + AI Services (Gemini) β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ Direct Messaging   β”‚ β”‚ Adaptive Scheduler (Celery+Redis) β”‚   β”‚
β”‚  β”‚ Service            β”‚ β”‚                                    β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚              β”‚               β”‚
    β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”
    β”‚ SQLite β”‚    β”‚  Neo4j   β”‚    β”‚ Pinecone β”‚
    β”‚ / PgSQLβ”‚    β”‚  Aura    β”‚    β”‚ (Vector) β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Tech Stack

Layer Technology
Frontend React 18, Vite 5, Zustand, React Router 6, Axios
Backend Django 4.2, Django REST Framework, SimpleJWT
Graph DB Neo4j 5 Aura (via neomodel)
Vector DB Pinecone
SQL DB SQLite (dev) / PostgreSQL 15 (prod)
Task Queue Celery 5 + Redis
AI / LLM Google Gemini (via google-genai)
Auth Google OAuth 2.0, JWT (access + refresh)
Embeddings Sentence Transformers

πŸ“ Project Structure

beacon/
β”œβ”€β”€ backend/                        # Django project root
β”‚   β”œβ”€β”€ beacon/                     # Project settings, URLs, WSGI
β”‚   β”‚   β”œβ”€β”€ settings.py
β”‚   β”‚   β”œβ”€β”€ urls.py
β”‚   β”‚   └── wsgi.py
β”‚   β”œβ”€β”€ apps/                       # Microservice-style Django apps
β”‚   β”‚   β”œβ”€β”€ auth_service/           # User registration, Google OAuth, JWT
β”‚   β”‚   β”œβ”€β”€ user_profile_service/   # Profiles, achievements, experience levels
β”‚   β”‚   β”œβ”€β”€ domain_management_service/  # Neo4j domain graph + Pinecone embeddings
β”‚   β”‚   β”œβ”€β”€ mentor_matching_service/    # 2-hop graph matching engine
β”‚   β”‚   β”œβ”€β”€ trust_score_service/    # Multi-factor trust scoring
β”‚   β”‚   β”œβ”€β”€ query_orchestrator/     # Query lifecycle management
β”‚   β”‚   β”œβ”€β”€ ai_services/           # Gemini RAG engine, conflict detection
β”‚   β”‚   β”œβ”€β”€ adaptive_scheduler_service/ # Celery load-balancing tasks
β”‚   β”‚   └── direct_messaging_service/   # 1-on-1 DM with request/accept
β”‚   β”œβ”€β”€ manage.py
β”‚   β”œβ”€β”€ requirements.txt
β”‚   └── seed_neo4j.py              # Graph database seeding script
β”œβ”€β”€ frontend/                       # React + Vite SPA
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ api/                   # Axios API modules (auth, query, messaging…)
β”‚   β”‚   β”œβ”€β”€ store/                 # Zustand stores (authStore, queryStore)
β”‚   β”‚   β”œβ”€β”€ pages/                 # Route-level views
β”‚   β”‚   β”‚   β”œβ”€β”€ AuthPage.jsx       # Login / Register
β”‚   β”‚   β”‚   β”œβ”€β”€ StudentDashboard.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ SeniorDashboard.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ProfilePage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ QueryPage.jsx      # AI-powered Q&A interface
β”‚   β”‚   β”‚   β”œβ”€β”€ MentorMatchPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ MessagingPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ SeniorInboxPage.jsx
β”‚   β”‚   β”‚   └── SeniorOnboardingPage.jsx
β”‚   β”‚   └── components/            # Reusable UI components
β”‚   β”‚       β”œβ”€β”€ Navbar.jsx
β”‚   β”‚       β”œβ”€β”€ QueryCard.jsx
β”‚   β”‚       β”œβ”€β”€ MentorCard.jsx
β”‚   β”‚       β”œβ”€β”€ PeerCard.jsx
β”‚   β”‚       β”œβ”€β”€ TrustScoreBadge.jsx
β”‚   β”‚       β”œβ”€β”€ ConflictAlert.jsx
β”‚   β”‚       β”œβ”€β”€ ProvisionalAnswerBox.jsx
β”‚   β”‚       └── Aurora.jsx         # Background visual effects
β”‚   β”œβ”€β”€ package.json
β”‚   └── vite.config.js
└── shared/
    └── schemas.md                 # JSON API contracts

πŸš€ Quick Start

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • Redis (for Celery)
  • Neo4j Aura instance (or local Neo4j 5)
  • Pinecone account
  • Google Cloud project (for OAuth + Gemini API key)

1. Clone & Configure

git clone https://github.com/your-org/beacon.git
cd beacon
cp .env.example .env
# Fill in: SECRET_KEY, NEO4J_*, PINECONE_API_KEY, GEMINI_API_KEY, GOOGLE_OAUTH_CLIENT_ID

2. Backend Setup

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

python manage.py migrate
python seed_neo4j.py            # Seed the domain graph
python manage.py runserver

3. Frontend Setup

cd frontend
npm install
npm run dev                     # Starts at http://localhost:5173

4. Celery Worker (for Adaptive Scheduler)

cd backend
celery -A beacon worker --loglevel=info

πŸ”— API Endpoints

Prefix Service Description
api/auth/ Auth Service Register, login, Google OAuth, token refresh
api/profile/ User Profile CRUD profiles, achievements, experience levels
api/domains/ Domain Management Domain graph queries, embedding-based linking
api/ Mentor Matching Find mentors & peers (graph + vector search)
api/query/ Query Orchestrator Submit queries, track status, get AI answers
api/scheduler/ Adaptive Scheduler Load balancing, cold-start broadcast
api/dm/ Direct Messaging Send/receive messages, manage conversations
internal/trust-score/ Trust Score Internal trust score computation
internal/users/ Internal Auth Service-to-service user lookups
internal/profile/ Internal Profile Service-to-service profile lookups

Full JSON schemas for all requests/responses are documented in shared/schemas.md.


πŸ§ͺ Testing

cd backend

# AI services tests
python -m pytest test_ai_services.py -v

# Neo4j integration tests
python -m pytest test_neo4j.py -v

# Query orchestrator tests
python -m pytest test_query_orchestrator.py -v

# User profile service tests
python -m pytest test_user_profile_service.py -v

πŸ” Environment Variables

Variable Description
SECRET_KEY Django secret key
DEBUG Enable debug mode (True / False)
NEO4J_HOST Neo4j Aura hostname
NEO4J_USERNAME Neo4j username
NEO4J_PASSWORD Neo4j password
PINECONE_API_KEY Pinecone API key
PINECONE_INDEX Pinecone index name (default: beacon-domains)
GEMINI_API_KEY Google Gemini API key
GOOGLE_OAUTH_CLIENT_ID Google OAuth client ID
REDIS_URL Redis connection URL (for Celery)
POSTGRES_DB / POSTGRES_USER / POSTGRES_PASSWORD PostgreSQL credentials (prod)
INTERNAL_SECRET Shared secret for service-to-service auth

πŸ› οΈ How It Works

Query Lifecycle

sequenceDiagram
    participant S as Student
    participant QO as Query Orchestrator
    participant AI as AI Services (Gemini)
    participant MM as Mentor Matching
    participant Sr as Senior(s)
    participant TS as Trust Score

    S->>QO: Submit query
    QO->>AI: Generate provisional answer (RAG)
    AI-->>QO: Provisional answer + follow-up questions
    QO->>MM: Find matching seniors
    MM-->>QO: Matched senior list
    QO->>Sr: Route query to seniors
    Sr->>QO: Submit advice + follow-up answers
    QO->>TS: Fetch trust scores
    TS-->>QO: Senior weights
    QO->>AI: Synthesise final answer (conflict detection)
    AI-->>QO: Final answer + agreements/disagreements
    QO-->>S: Deliver final advice
Loading

Mentor Matching Algorithm

  1. Domain Linking β€” Student's query domain is embedded via Sentence Transformers and matched against the Pinecone vector index
  2. Graph Traversal β€” 2-hop traversal on the Neo4j domain graph to find seniors with related expertise
  3. Trust-Weighted Ranking β€” Candidates are ranked by composite trust score (consistency Γ— alignment Γ— follow-through Γ— achievement weight)
  4. Load Balancing β€” Adaptive scheduler ensures fair distribution; cold-start broadcasting is used when no seniors are immediately available

πŸ‘₯ Roles

Role Capabilities
Student Ask questions, view AI answers, browse mentors/peers, message seniors, track profile
Senior Receive routed queries, submit advice, manage availability, onboard with domains, accept DM requests

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors