Skip to content

Harsha072/scholar-quest

Repository files navigation

πŸŽ“ Scholar Quest - AI-Powered Research Discovery Platform

Python React OpenAI Render Vercel

Scholar Quest is an intelligent research companion designed to help researchers, students, and academics discover relevant papers, understand complex research, and explore citation networks. Powered by AI and integrated with OpenAlex's vast academic database.

πŸ”— Live Application: https://scholar-quest-three.vercel.app


🌟 Key Features

πŸ” Smart Paper Discovery

  • Search academic papers using natural language queries
  • AI-powered relevance scoring for each result
  • Integration with OpenAlex's 250M+ paper database
  • Real-time caching for faster repeat searches

πŸ€– AI Analysis

  • Comprehensive paper summaries with key insights
  • Reading difficulty assessment (Beginner/Intermediate/Advanced)
  • Estimated reading time calculation
  • Impact score evaluation
  • Key contributions and methodology breakdown

πŸ•ΈοΈ Citation Network Visualization

  • Interactive graph showing paper relationships
  • Explore cited and citing papers visually
  • Discover related research through connections
  • Click nodes to explore connected papers

πŸ‘€ User Features

  • Firebase authentication (email/password & anonymous)
  • Bookmarking system for favorite papers
  • Search history tracking
  • User profile with account management

πŸ“Š Modern UI/UX

  • Responsive design for all devices
  • Loading overlays with blur effects
  • Clean, professional interface
  • Circular score visualizations

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  React Frontend     β”‚
β”‚  (Vercel)           β”‚
β”‚  - Homepage         β”‚
β”‚  - Paper Discovery  β”‚
β”‚  - Paper Details    β”‚
β”‚  - Citation Graph   β”‚
β”‚  - About Page       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚
           β”‚ HTTPS/CORS
           β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Flask Backend      β”‚
β”‚  (Render.com)       β”‚
β”‚  - Paper Search     β”‚
β”‚  - AI Analysis      β”‚
β”‚  - Graph Building   β”‚
β”‚  - User Auth        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”
    β”‚             β”‚
β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”   β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”
β”‚OpenAlexβ”‚   β”‚ OpenAI  β”‚
β”‚  API   β”‚   β”‚   API   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ’‘ Tech Stack

Frontend

  • Framework: React 18.2.0
  • Routing: React Router 7.9.3
  • State Management: React Context API + Hooks
  • Styling: Custom CSS with animations
  • Visualization: D3.js / Vis.js for citation graphs
  • Authentication: Firebase Auth
  • Hosting: Vercel (Auto-deploy from GitHub)

Backend

  • Framework: Flask (Python)
  • AI: OpenAI GPT-4 for paper analysis
  • Database: OpenAlex API integration
  • Caching: In-memory cache for search results
  • Authentication: Firebase Admin SDK
  • Hosting: Render.com (2GB RAM, $7/month)

External Services

  • OpenAlex: Academic paper database (250M+ papers)
  • OpenAI: Natural language processing and analysis
  • Firebase: Authentication and user management

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • Python 3.9+
  • OpenAI API key
  • Firebase project credentials

1. Clone Repository

git clone https://github.com/Harsha072/scholar-quest.git
cd scholar-quest

2. Backend Setup

cd flask-api

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r app/requirements.txt

# Set environment variables
export OPENAI_API_KEY="your-openai-api-key"
export FIREBASE_ADMIN_SDK_JSON='{"type":"service_account",...}'

# Run Flask server
python app/main.py

Backend will start at http://localhost:5000

3. Frontend Setup

cd react-frontend

# Install dependencies
npm install

# Create .env file
echo "REACT_APP_API_URL=http://localhost:5000" > .env
echo "REACT_APP_FIREBASE_API_KEY=your-firebase-api-key" >> .env
echo "REACT_APP_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com" >> .env
echo "REACT_APP_FIREBASE_PROJECT_ID=your-project-id" >> .env

# Start development server
npm start

Frontend will start at http://localhost:3000


πŸ“– Usage Guide

🏠 Homepage

  1. Enter a research question in natural language
  2. Click "Search" or press Enter
  3. View loading overlay while papers are being discovered
  4. Redirected to Paper Discovery page with results

πŸ“š Paper Discovery

  • View Results: See relevant papers with metadata
  • Relevance Scores: AI-calculated relevance percentage
  • View Details: Generate comprehensive AI analysis
  • Build Graph: Visualize citation relationships
  • Bookmark: Save papers for later (requires sign-in)

πŸ“„ Paper Details

  • Circular Scores: Relevance and Impact displayed visually
  • AI Analysis: Brief and detailed summaries
  • Key Contributions: Bullet-point highlights
  • Methodology: Research approach overview
  • Reading Difficulty: Beginner/Intermediate/Advanced
  • Estimated Time: How long to read the paper

πŸ•ΈοΈ Citation Graph

  • Interactive Nodes: Click to explore connections
  • Color Coding: Different colors for paper types
  • Zoom & Pan: Navigate large graphs easily
  • Cached Data: Fast loading on page refresh

πŸ‘€ User Account

  • Sign Up: Create account with email/password
  • Anonymous Mode: Browse without account
  • Profile: View account info and last sign-in
  • Sign Out: Secure logout

🎯 API Endpoints

Base URL: https://scholar-quest-backend-v2.onrender.com

Health Check

GET /api/health

Search Papers

POST /api/discover-papers
Content-Type: application/json

{
  "query": "machine learning in healthcare",
  "max_results": 10
}

Get Paper Details & Analysis

POST /api/paper-details
Content-Type: application/json

{
  "title": "Paper Title",
  "authors": ["Author 1", "Author 2"],
  "abstract": "Paper abstract...",
  "openalex_work_id": "W1234567890"
}

Build Citation Graph

GET /api/paper-relationships/{paper_id}?max_connections=10

πŸ“ Project Structure

pdf-summariser-microservice/
β”œβ”€β”€ flask-api/                    # Backend (Python/Flask)
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ main.py              # Main API routes
β”‚   β”‚   β”œβ”€β”€ rag_pipeline.py      # AI analysis logic
β”‚   β”‚   β”œβ”€β”€ simple_paper_relationships.py  # Graph building
β”‚   β”‚   β”œβ”€β”€ config.py            # Configuration
β”‚   β”‚   β”œβ”€β”€ logger_config.py     # Logging setup
β”‚   β”‚   └── requirements.txt     # Python dependencies
β”‚   β”œβ”€β”€ tests/                   # Backend tests
β”‚   └── Dockerfile
β”‚
β”œβ”€β”€ react-frontend/              # Frontend (React)
β”‚   β”œβ”€β”€ public/
β”‚   β”‚   └── index.html
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ Header/          # Navigation header
β”‚   β”‚   β”‚   β”œβ”€β”€ Auth/            # Authentication components
β”‚   β”‚   β”‚   β”œβ”€β”€ PaperCard/       # Paper display cards
β”‚   β”‚   β”‚   β”œβ”€β”€ PaperDiscovery/  # Search results page
β”‚   β”‚   β”‚   └── SimplePaperRelationships/  # Citation graph
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ HomePage.js      # Landing page
β”‚   β”‚   β”‚   β”œβ”€β”€ PaperDetails.js  # Detailed analysis
β”‚   β”‚   β”‚   β”œβ”€β”€ AboutPage.js     # About Scholar Quest
β”‚   β”‚   β”‚   └── SimplePaperRelationshipsPage.js
β”‚   β”‚   β”œβ”€β”€ context/
β”‚   β”‚   β”‚   └── AuthContext.js   # Firebase auth context
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   └── api.js           # API client
β”‚   β”‚   β”œβ”€β”€ App.js               # Main app component
β”‚   β”‚   └── index.js             # React entry point
β”‚   β”œβ”€β”€ package.json
β”‚   └── README.md
β”‚
β”œβ”€β”€ docker-compose.yml           # Local development
β”œβ”€β”€ docker-compose.prod.yml      # Production config
└── README.md                    # This file

🌐 Deployment

Current Production Deployment

Backend: Render.com

Frontend: Vercel

Environment Variables

Backend (Render)

OPENAI_API_KEY=sk-proj-...
FLASK_ENV=production
FLASK_DEBUG=False
CORS_ORIGINS=https://scholar-quest-three.vercel.app
FIREBASE_ADMIN_SDK_JSON={"type":"service_account",...}

Frontend (Vercel)

REACT_APP_API_URL=https://scholar-quest-backend-v2.onrender.com
REACT_APP_FIREBASE_API_KEY=...
REACT_APP_FIREBASE_AUTH_DOMAIN=...
REACT_APP_FIREBASE_PROJECT_ID=...
REACT_APP_FIREBASE_STORAGE_BUCKET=...
REACT_APP_FIREBASE_MESSAGING_SENDER_ID=...
REACT_APP_FIREBASE_APP_ID=...

✨ Feature Highlights

🎨 User Interface

  • Clean, modern design with purple gradient accents
  • Responsive layout for mobile, tablet, and desktop
  • Smooth animations and transitions
  • Loading overlays with blur effects
  • Circular score visualizations

πŸ” Authentication

  • Email/password registration and login
  • Anonymous browsing mode
  • Firebase integration for secure auth
  • User profile with metadata
  • Session persistence

πŸ’Ύ Caching System

  • Search results cached in localStorage
  • Graph data cached for quick reload
  • Session-based cache management
  • Automatic cache expiration

🎯 Smart Features

  • AI-powered relevance scoring
  • Dynamic loading messages
  • Error handling with user-friendly messages
  • Compact search bar in results page
  • Back navigation with state preservation

πŸ”§ Development

Run Tests

# Backend tests
cd flask-api
pytest tests/

# Frontend tests
cd react-frontend
npm test

Build for Production

# Frontend build
cd react-frontend
npm run build

# Backend (uses Dockerfile)
cd flask-api
docker build -t scholar-quest-backend .

Code Quality

# Python linting
flake8 flask-api/app/

# React linting
cd react-frontend
npm run lint

πŸ“„ License

This project is licensed under the MIT License.


About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages