Skip to content

munimthahmid/ScholarAI

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 

Repository files navigation

🧠 ScholarAI

Your intelligent research copilot, built to streamline and accelerate the research process with AI-powered assistance.


πŸ“š About ScholarAI

ScholarAI is a modular and scalable research assistant platform designed to automate time-consuming research tasks. It combines traditional backend services with AI agents for an efficient and intuitive experience.

This repository serves as the central hub. Use the links below to explore the different modules of ScholarAI.


πŸ—‚ Repository Structure

Module Description Tech Stack
πŸ”— ScholarAI-Backend-Springboot Core backend services β€” user auth, document & library management Java, Spring Boot
πŸ”— ScholarAI-Backend-FastAPI AI Agents for summarization, web scraping, gap analysis Python, FastAPI
πŸ”— ScholarAI-Frontend Web client with interactive UI and research workflows Next.js, Tailwind CSS, TypeScript
πŸ”— ScholarAI-Docs Developer & user documentation, API reference, onboarding Markdown, Docsify, mkdocs
πŸ”— ScholarAI πŸ’‘ You're here! This is the root overview repository.

βš™οΈ Features (Across All Modules)

  • πŸ” JWT-based Authentication & Authorization with Google/GitHub OAuth
  • πŸ“ Document Upload, Tagging, Library Search with Backblaze B2 Storage
  • βœ… Research Task & To-Do Tracker with Reading Lists
  • πŸ“„ AI Summarization & Gap Analysis with Multi-Agent Processing
  • πŸ“Š Paper Analysis with Academic Search Integration
  • πŸ”Ž Multi-Source Academic Search (ArXiv, PubMed, Semantic Scholar, etc.)
  • πŸ’‘ PDF Processing and Text Extraction
  • πŸ”„ Asynchronous Task Processing via RabbitMQ

πŸš€ Quick Start Guide

Prerequisites

Before setting up ScholarAI, ensure you have the following installed:

  • Docker & Docker Compose (v2.0+)
  • Git
  • Node.js (v20+) for frontend development
  • Java 21 for Spring Boot development
  • Python 3.10+ with Poetry for FastAPI development

Environment Setup

Each service requires a .env file. Copy the example files and configure them:

# Clone the main repository
git clone https://github.com/Tasriad/ScholarAI
cd ScholarAI

# Clone all sub-repositories
git clone https://github.com/Tasriad/ScholarAI-Backend-Springboot
git clone https://github.com/Tasriad/ScholarAI-Backend-FastAPI
git clone https://github.com/Tasriad/ScholarAI-Frontend

# Set up environment files
cp ScholarAI-Backend-Springboot/.env.example ScholarAI-Backend-Springboot/.env
cp ScholarAI-Backend-FastAPI/env.example ScholarAI-Backend-FastAPI/.env
cp ScholarAI-Frontend/env.example ScholarAI-Frontend/.env.local

Required Environment Variables

Core Infrastructure (.env for Spring Boot)

# Database Configuration
CORE_DB_USER=scholar_user
CORE_DB_PASSWORD=your_secure_password
CORE_DB_HOST=core-db
CORE_DB_NAME=coreDB

PAPER_DB_USER=paper_user
PAPER_DB_PASSWORD=your_secure_password
PAPER_DB_HOST=paper-db
PAPER_DB_NAME=paperDB

# RabbitMQ
RABBITMQ_USER=scholar_user
RABBITMQ_PASSWORD=your_secure_password

# Redis
REDIS_PASSWORD=your_secure_password

# JWT Configuration
JWT_SECRET=your_very_long_and_secure_jwt_secret_key_here
JWT_ACCESS_EXPIRATION_MS=900000
JWT_REFRESH_EXPIRATION_MS=604800000

# OAuth
SPRING_GOOGLE_CLIENT_ID=your_google_client_id
SPRING_GOOGLE_CLIENT_SECRET=your_google_client_secret
SPRING_GITHUB_CLIENT_ID=your_github_client_id
SPRING_GITHUB_CLIENT_SECRET=your_github_client_secret

# Environment
ENV=dev

FastAPI Service (.env for FastAPI)

# RabbitMQ
RABBITMQ_USER=scholar_user
RABBITMQ_PASSWORD=your_secure_password

# Academic APIs
CORE_API_KEY=your_core_api_key
UNPAYWALL_EMAIL=your.email@example.com

# PDF Storage (Backblaze B2)
B2_KEY_ID=your_b2_key_id
B2_APPLICATION_KEY=your_b2_application_key
B2_BUCKET_NAME=scholar-ai-papers

# Log Level
LOG_LEVEL=info

Frontend (.env.local for Next.js)

NEXT_PUBLIC_DEV_API_URL=http://localhost:8080
NEXT_PUBLIC_DOCKER_BACKEND_URL=http://docker-core-app-1:8080
NEXT_PUBLIC_API_BASE_URL=http://localhost:8080

NEXT_PUBLIC_GOOGLE_CLIENT_ID=your_google_client_id
NEXT_PUBLIC_GITHUB_CLIENT_ID=your_github_client_id

# PDF Storage
B2_KEY_ID=your_b2_key_id
B2_APPLICATION_KEY=your_b2_application_key
B2_BUCKET_NAME=scholar-ai-papers

# Environment
NEXT_PUBLIC_ENV=dev
ENV=dev

🐳 Docker Deployment (Recommended)

Option 1: Full Stack with Docker

  1. Start Core Infrastructure (Spring Boot):
cd ScholarAI-Backend-Springboot
./scripts/docker.sh build
./scripts/docker.sh start

This starts:

  • PostgreSQL (Core DB): localhost:5433
  • PostgreSQL (Paper DB): localhost:5434
  • RabbitMQ: localhost:5672 (Management UI: localhost:15672)
  • Redis: localhost:6379
  • Spring Boot API: localhost:8080
  1. Start FastAPI Service:
cd ../ScholarAI-Backend-FastAPI
./scripts/docker.sh build
./scripts/docker.sh start

This starts:

  • FastAPI Service: localhost:8000
  1. Start Frontend:
cd ../ScholarAI-Frontend
./scripts/docker.sh build
./scripts/docker.sh start

This starts:

  • Next.js Frontend: localhost:3000

Option 2: Individual Service Management

Each service can be managed independently:

# Spring Boot Backend
cd ScholarAI-Backend-Springboot
./scripts/docker.sh build          # Build image
./scripts/docker.sh start-svc      # Start only infrastructure services
./scripts/docker.sh start-app      # Start only the application
./scripts/docker.sh stop           # Stop everything

# FastAPI Backend
cd ScholarAI-Backend-FastAPI
./scripts/docker.sh build          # Build image
./scripts/docker.sh start          # Start service
./scripts/docker.sh stop           # Stop service
./scripts/docker.sh logs           # View logs

# Frontend
cd ScholarAI-Frontend
./scripts/docker.sh build          # Build image
./scripts/docker.sh start          # Start service
./scripts/docker.sh stop           # Stop service

πŸ’» Local Development Setup

Spring Boot Backend

cd ScholarAI-Backend-Springboot

# Install dependencies and build
./mvnw clean install

# Run tests
./mvnw test

# Start application (requires infrastructure services running)
./mvnw spring-boot:run

# Or use the helper script
./scripts/local.sh build          # Build JAR
./scripts/local.sh test           # Run tests
./scripts/local.sh run            # Run application

FastAPI Backend

cd ScholarAI-Backend-FastAPI

# Install dependencies
poetry install

# Set up environment
cp env.example .env
# Edit .env with your configuration

# Run application
poetry run uvicorn app.main:app --reload --port 8000

# Run tests
poetry run pytest

# Code formatting
poetry run black .
poetry run isort .
poetry run flake8

Frontend

cd ScholarAI-Frontend

# Install dependencies
npm install

# Set up environment
cp env.example .env.local
# Edit .env.local with your configuration

# Run development server
npm run dev

# Build for production
npm run build

# Run tests
npm run test        # Unit tests
npm run test:e2e    # E2E tests
npm run test:all    # All tests

πŸ”§ Service Architecture

Communication Flow

  1. Frontend (Next.js) β†’ HTTP requests β†’ Spring Boot API
  2. Spring Boot β†’ RabbitMQ messages β†’ FastAPI AI Agents
  3. FastAPI β†’ Academic APIs + PDF Processing + B2 Storage
  4. FastAPI β†’ RabbitMQ results β†’ Spring Boot
  5. Spring Boot β†’ Database updates + Frontend notifications

Key Services

  • PostgreSQL: Core data (users, projects, notes) + Paper metadata
  • RabbitMQ: Async message queue between Spring Boot ↔ FastAPI
  • Redis: Session storage and caching
  • Backblaze B2: PDF file storage
  • Academic APIs: ArXiv, PubMed, Semantic Scholar, OpenAlex, etc.

πŸ§ͺ Testing

Backend Testing

# Spring Boot
cd ScholarAI-Backend-Springboot
./mvnw test
./mvnw jacoco:report  # Coverage report

# FastAPI
cd ScholarAI-Backend-FastAPI
poetry run pytest
poetry run pytest tests/integration_test.py  # Integration tests

Frontend Testing

cd ScholarAI-Frontend
npm run test          # Jest unit tests
npm run test:e2e      # Playwright E2E tests

🌐 Live Deployment

Production Environment

ScholarAI is deployed on Azure VM with CI/CD pipeline:

API Documentation

  • Spring Boot API: http://4.247.29.26:8080/swagger-ui.html | Local
  • FastAPI Docs: http://4.247.29.26:8000/docs | Local
  • RabbitMQ Management: http://localhost:15672 (guest/guest) - Local only

CI/CD Pipeline

The project includes automated deployment using:

  • Azure DevOps: Continuous integration and deployment
  • Docker: Containerized deployment
  • Azure VM: Production hosting environment
  • Infrastructure as Code: Automated provisioning and configuration

πŸ”’ Security Notes

  • Keep your .env files secure and never commit them to version control
  • Use strong passwords for all services (minimum 16 characters)
  • Regularly rotate API keys and passwords
  • Set up OAuth applications for Google/GitHub authentication
  • Configure Backblaze B2 with appropriate bucket permissions

🚨 Troubleshooting

Common Issues

  1. Port conflicts: Ensure ports 3000, 8000, 8080, 5432, 5672, 6379, 15672 are available
  2. Environment variables: Double-check all required variables are set
  3. Docker network: Services communicate via docker_scholar-network
  4. Database connections: Wait for health checks to pass before starting dependent services

Health Checks

  • Spring Boot: http://localhost:8080/actuator/health
  • FastAPI: http://localhost:8000/health
  • Frontend: http://localhost:3000

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and formatting
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors