How yutomi141/paper_lens works
Paper Lens is a local academic-paper reader: users upload and read PDFs, then use AI explanations, translation, and Q&A alongside notes, references, and vocabulary tools. The backend exposes separate paper, AI, and domain-data routes, stores state in SQLite, and uses a local Ollama service for model work. The graph includes documented product capabilities even where their implementation was not sampled; those components have few or no inferred connections. Unsampled source limits evidence for several frontend-to-backend and route relationships.
Main entry points: database.py SQLite Database · main.py FastAPI App · papers.py Paper Routes · SidePanel.tsx AI Side Panel
Components 25
PDF Reading
- Paper Reader
frontend/pages/reader/[id].tsx - PDF Viewer
frontend/components/PDFViewer.tsx - Text Selection
frontend/components/SelectionMenu.tsx - Paper Routes
backend/routers/papers.py - PDF Extraction
backend/services/pdf_extractor.py
AI Assistance
- AI Side Panel
frontend/components/SidePanel.tsx - Translation View
frontend/components/TranslationPanel.tsx - Streaming Renderer
frontend/components/StreamingText.tsx - AI Routes
backend/routers/ai.py - Prompt Builder
backend/services/prompt_manager.py - Full-Text Translation
backend/services/translation_job.py - Local Ollama
Study Tools
- Q&A Chat
frontend/components/ChatPanel.tsx - Notes Panel
frontend/components/NotePanel.tsx - References Panel
frontend/components/ReferencesPanel.tsx - Notes Routes
backend/routers/notes.py - Chat Routes
backend/routers/chat.py - Reference Routes
backend/routers/references.py - Vocabulary Routes
backend/routers/words.py - Vocabulary Page
frontend/pages/words.tsx
Application Core
- Settings Page
frontend/pages/settings.tsx - FastAPI App
backend/main.py - SQLite Database
backend/db/database.py - Domain Models
backend/db/models.py
Other components
- Reader
Connections 29
- Reader → Paper Reader: opens
README.md - Reader → Paper Routes: uploads PDF
README.md - AI Side Panel → AI Routes: streams requests
frontend/components/SidePanel.tsx - AI Side Panel → Translation View: renders
frontend/components/SidePanel.tsx - AI Side Panel → References Panel: renders
frontend/components/SidePanel.tsx - AI Side Panel → Notes Panel: renders
frontend/components/SidePanel.tsx - AI Side Panel → Q&A Chat: renders
frontend/components/SidePanel.tsx - AI Routes → Prompt Builder: builds prompts
backend/routers/ai.py - AI Routes → Local Ollama: requests generation
backend/routers/ai.py - Paper Routes → PDF Extraction: extracts PDF text
backend/routers/papers.py - Paper Routes → Local Ollama: generates summary
backend/routers/papers.py - Paper Routes → Full-Text Translation: starts jobs
backend/routers/papers.py - FastAPI App → Paper Routes: registers
backend/main.py - FastAPI App → AI Routes: registers
backend/main.py - FastAPI App → Notes Routes: registers
backend/main.py - FastAPI App → Chat Routes: registers
backend/main.py - FastAPI App → Reference Routes: registers
backend/main.py - FastAPI App → Vocabulary Routes: registers
backend/main.py - Paper Routes → SQLite Database: reads and writes
backend/routers/papers.py - AI Routes → SQLite Database: reads and writes
backend/routers/ai.py - Notes Routes → SQLite Database: reads and writes
backend/routers/notes.py - Chat Routes → SQLite Database: reads and writes
backend/routers/chat.py - Reference Routes → SQLite Database: reads and writes
backend/routers/references.py - Vocabulary Routes → SQLite Database: reads and writes
backend/routers/words.py - Full-Text Translation → SQLite Database: tracks chunks
backend/services/translation_job.py - Full-Text Translation → PDF Extraction: extracts pages
backend/services/translation_job.py - Full-Text Translation → Local Ollama: translates chunks
backend/services/translation_job.py - Vocabulary Routes → Local Ollama: generates meanings
backend/routers/words.py - Domain Models → SQLite Database: uses base
backend/db/models.py