AI-powered scientific literature analysis assistant with comprehensive library management, community sharing, and multi-modal PDF parsing capabilities.
- PDF Upload & Parsing - Upload PDF papers with automatic text extraction
- Multi-Model AI Analysis - Support for 19+ LLM providers (Gemini, GPT, DeepSeek, Kimi, Claude, etc.)
- Real-time Streaming - Live streaming responses with heartbeat mechanism
- Multiple Analysis Modes - Deep dive, quick summary, multi-PDF comparison, image report, critique
- Custom Prompts - Create and manage your own analysis prompts
- Folder System - Organize papers into custom folders (Want to read, Reading, Completed, etc.)
- File Preview - Quick preview panel with expandable view
- Grid/List View - Toggle between different view modes
- Search - Search across your library
- Batch Operations - Manage multiple documents
- Public Sessions - Share your analysis with others
- Discover - Browse public literature analyses
- Copy/Fork - Copy public sessions to your library
- View/Copy Counts - Track engagement metrics
- MinerU Integration - High-quality PDF parsing with figure extraction (图文解析)
- Figure-Aware Markdown - Render figures inline with AI responses
- URL Import - Direct import from arXiv, OpenReview, Nature
- Notes - Add personal notes to sessions
- Message Editing - Edit and resend messages
- Multi-format Download - Download as Markdown, PDF, or MinerU format
- Theme Toggle - Light/Dark mode support
- Drag & Drop - Drag files to upload
- Google OAuth 2.0 - Secure authentication
- JWT Tokens - Stateless API authentication
- Node.js 20+
- npm or yarn
- Google Cloud project (for OAuth)
cd literature-assistant-standalone
npm run setup # Install dependencies for root, backend, and frontendcp .env.example .envEdit .env with your configuration:
# ==================== Authentication ====================
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
GOOGLE_CALLBACK_URL=http://localhost:3000/api/auth/google/callback
JWT_SECRET=your-random-jwt-secret-32-chars-minimum
SESSION_SECRET=your-random-session-secret-32-chars-minimum
FRONTEND_URL=http://localhost:5173
# ==================== LLM Providers ====================
# Option 1: JXTANG API Gateway (supports multiple models)
JXTANG_BASE_URL=https://your-api-gateway/v1/chat/completions
JXTANG_API_KEY=your-api-key
# Option 2: Direct Provider APIs
GEMINI_API_KEY=your-gemini-api-key
OPENAI_API_KEY=your-openai-api-key
DEEPSEEK_API_KEY=your-deepseek-api-key
# ==================== Optional Services ====================
# MinerU - PDF image extraction (图文解析)
MINERU_API_TOKEN=your-mineru-token
# DNS servers for MinerU CDN (optional)
DNS_SERVERS=8.8.8.8,1.1.1.1,114.114.114.114- Go to Google Cloud Console
- Create a new project or select existing
- Navigate to APIs & Services → OAuth consent screen
- User Type: External
- Fill required fields (App name, emails)
- Navigate to APIs & Services → Credentials
- Click + Create Credentials → OAuth client ID
- Application type: Web application
- Authorized JavaScript origins:
http://localhost:3000,http://localhost:5173 - Authorized redirect URIs:
http://localhost:3000/api/auth/google/callback
- Copy Client ID and Client Secret to
.env
Edit backend/config/llm-providers.json to enable/disable providers:
{
"defaultProvider": "gemini-3-pro-preview",
"providers": {
"gemini-3-pro-preview": {
"name": "JXTANG",
"baseUrlEnv": "JXTANG_BASE_URL",
"apiKeyEnv": "JXTANG_API_KEY",
"model": "gemini-3-pro-preview",
"maxTokens": 32000,
"multimodal": true,
"enabled": true
}
}
}npm run dev- Frontend: http://localhost:5173
- Backend: http://localhost:3000
docker-compose up -d
docker-compose logs -fnpm run build
NODE_ENV=production npm start- Push code to GitHub
- Create project on Zeabur
- Configure environment variables (change URLs to production domain)
- Add production redirect URI to Google OAuth
- Add Persistent Storage for
/app/data
literature-assistant-standalone/
├── frontend/ # React + Vite + TypeScript
│ ├── src/
│ │ ├── pages/
│ │ │ └── LiteratureAssistant.tsx # Main page (5600+ lines)
│ │ ├── components/
│ │ │ ├── ui/ # shadcn/ui components
│ │ │ ├── layout/ # Layout components
│ │ │ ├── literature-assistant/
│ │ │ │ └── FigureAwareMarkdown.tsx
│ │ │ └── MermaidChart.tsx
│ │ ├── stores/
│ │ │ └── literature-assistant-store.ts
│ │ ├── services/
│ │ │ ├── api.ts # API client
│ │ │ └── auth.ts # Auth service
│ │ └── hooks/
│ │ └── useTheme.ts # Theme hook
│ └── ...
├── backend/ # Express + SQLite
│ ├── api/
│ │ ├── auth-routes.js # OAuth routes
│ │ ├── session-routes.js # Session CRUD
│ │ ├── document-routes.js # Document & figure routes
│ │ └── analysis-routes.js # AI analysis, downloads, community
│ ├── lib/
│ │ ├── database.js # SQLite wrapper
│ │ └── mineru-service.js # MinerU integration
│ ├── middleware/
│ │ └── auth.js # JWT middleware
│ └── config/
│ ├── llm-providers.json # LLM configuration
│ └── prompts.json # Analysis prompts
├── data/ # Data directory
│ ├── database/ # SQLite database
│ ├── uploads/ # PDF files
│ └── figures/ # Extracted images
└── docker/ # Docker configs
GET /api/auth/google- Initiate OAuthGET /api/auth/google/callback- OAuth callbackGET /api/auth/me- Get current userPOST /api/auth/logout- Logout
GET /api/sessions- List sessionsGET /api/sessions/:id- Get session with documents & messagesPOST /api/sessions- Create sessionPATCH /api/sessions/:id- Update sessionDELETE /api/sessions/:id- Delete sessionPATCH /api/sessions/:id/public- Toggle public status
POST /api/documents- Upload documentGET /api/documents/:id- Download documentDELETE /api/documents/:id- Delete documentPOST /api/documents/:id/parse-images- Trigger MinerU parsingGET /api/documents/:id/figures- Get document figuresGET /api/documents/:id/figures/by-label/:label- Get figure by label
POST /api/analyze- Stream AI analysisDELETE /api/messages/:id- Delete messagePOST /api/upload-from-url- Import from URL (arXiv, OpenReview, Nature)
GET /api/download/availability/:sessionId- Check download optionsGET /api/download/ai-response/:messageId- Download as MarkdownGET /api/download/original-pdf/:documentId- Download original PDFGET /api/download/mineru-markdown/:documentId- Download MinerU MarkdownGET /api/download/mineru-folder/:documentId- Download MinerU ZIP
GET /api/community/sessions- List public sessionsPOST /api/community/copy/:sessionId- Copy public sessionPOST /api/community/view/:sessionId- Record viewGET /api/community/settings- Get share settingsPOST /api/community/settings- Update share settings
GET /api/custom-prompts- List custom promptsPOST /api/custom-prompts- Create custom promptDELETE /api/custom-prompts/:id- Delete custom prompt
| Variable | Description | Required |
|---|---|---|
GOOGLE_CLIENT_ID |
Google OAuth Client ID | Yes |
GOOGLE_CLIENT_SECRET |
Google OAuth Client Secret | Yes |
GOOGLE_CALLBACK_URL |
OAuth callback URL | Yes |
JWT_SECRET |
Secret for JWT tokens (32+ chars) | Yes |
SESSION_SECRET |
Secret for sessions (32+ chars) | Yes |
FRONTEND_URL |
Frontend URL for CORS | Yes |
JXTANG_BASE_URL |
API gateway base URL | At least one LLM |
JXTANG_API_KEY |
API gateway key | At least one LLM |
GEMINI_API_KEY |
Direct Gemini API key | Optional |
OPENAI_API_KEY |
Direct OpenAI API key | Optional |
DEEPSEEK_API_KEY |
Direct DeepSeek API key | Optional |
MINERU_API_TOKEN |
MinerU token for image parsing | Optional |
DNS_SERVERS |
DNS servers for MinerU CDN | Optional |
- React 18 + TypeScript
- Vite
- Zustand (state management)
- Tailwind CSS + shadcn/ui
- Framer Motion (animations)
- React Markdown + KaTeX + Mermaid
- Recharts (analytics)
- Express 5
- SQLite3
- Passport.js (Google OAuth)
- JWT authentication
- pdf-parse (text extraction)
- MinerU API (image extraction)
- Sharp (image processing)
npm install # In root directorynpm run setup # Reinstall all dependencies- Verify redirect URI in Google Console matches exactly
- Check http vs https, correct port (3000 not 5173)
- Verify
MINERU_API_TOKENis set - Check network connectivity to mineru.net
- Try configuring
DNS_SERVERSif CDN is blocked
- Check file size (max 150MB)
- Ensure
data/uploadsdirectory is writable
MIT