Frontend web application for ScholarLens, a paper reading assistant service
- Provides UI for paper upload/analysis/viewing based on Next.js (App Router)
- Visualizes summary/Q&A/translation/highlight results by integrating with ScholarLens backend API
| Category | Technology |
|---|---|
| Framework | Next.js (App Router) |
| Language | TypeScript |
| Styling | Tailwind CSS |
| UI Components | shadcn/ui |
| Deployment | Docker, Docker Compose |
- Drag & Drop Upload: Easy PDF file upload
- PDF Viewer: Renders uploaded papers page by page
- Interactive UI: Section-wise summaries, translation, and highlight display
- Summary: Section-wise key content summarization
- Q&A: Context-based conversational questions and answers
- Translation: Korean translation of selected sections or text
- Highlights: Automatic extraction and display of important sentences
- Node.js 18+
- npm or pnpm
- Backend server running (
http://localhost:8000)
# Clone repository
git clone https://github.com/ScholarLensAI/scholarlensAI-FE.git
cd scholarlensAI-FE
# Run with Docker Compose
docker compose up --build
# Run in background
docker compose up -d
# Stop
docker compose down# Clone repository
git clone https://github.com/ScholarLensAI/scholarlensAI-FE.git
cd scholarlensAI-FE
# Install dependencies
npm install
# Run development server
npm run dev
# To run on a different port
npm run dev -- -p 3001- Frontend: http://localhost:3000
- Backend: http://localhost:8000 (needs to be run separately)
By default, it uses the configuration values in lib/config.ts (http://localhost:8000) and can run without additional setup.
To change the backend URL, create a .env.local file:
NEXT_PUBLIC_BACKEND_URL=http://localhost:8000
BACKEND_API_URL=http://localhost:8000| Environment Variable | Default | Description |
|---|---|---|
NEXT_PUBLIC_BACKEND_URL |
http://localhost:8000 |
Backend address to be called from client |
BACKEND_API_URL |
http://localhost:8000 |
Backend address to be called from server side |
BACKEND_INTERNAL_URL |
BACKEND_API_URL |
Backend address for Docker internal network |
scholarlensAI-FE/
βββ app/ # Next.js App Router
β βββ api/ # Proxy/Backend integration API Routes
β β βββ chat/route.ts # Q&A requests
β β βββ highlights/route.ts # Highlight queries
β β βββ translate/route.ts # Translation requests
β β βββ upload/route.ts # File upload requests
β βββ reader/page.tsx # Document upload page
β βββ viewer/ # Viewer page
β β βββ loading.tsx # Loading UI
β β βββ page.tsx
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Main page
β
βββ components/ # React components
β βββ pdf/pdf-viewer.tsx # pdf-viewer component
β βββ ui/ # UI components (shadcn/ui)
β β βββ button.tsx
β β βββ card.tsx
β β βββ input.tsx
β β βββ tabs.tsx
β β βββ textarea.tsx
β βββ theme-provider.tsx # Theme provider
β
βββ lib/ # Utility functions
β βββ config.ts # Common utilities
β βββ utils.ts # Common utilities
β
βββ public/ # Static files
βββ styles/ # Global styles
βββ .eslintrc.js
βββ .gitignore
βββ .dockerignore
βββ docker-compose.yml # Docker execution settings
βββ Dockerfile
βββ components.json # shadcn/ui configuration
βββ next.config.mjs # Next.js configuration
βββ package-lock.json
βββ package.json
βββ postcss.config.mjs # PostCSS configuration
βββ README.md
βββ tsconfig.json # TypeScript configuration
- Project introduction and key features overview
- Entry point to upload page
- PDF file upload UI (Drag & Drop support)
- Automatically navigates to viewer page upon successful upload
- PDF rendering and navigation
- Tab interface:
- Summary: View section-wise summaries
- Q&A: Understand papers through AI conversation
- Translation: Translate selected text
- Highlights: Sentence highlights
- Verify that
.env.localfile is in the project root - Check for
NEXT_PUBLIC_prefix - Restart development server
npm run dev -- -p 3001rm -rf node_modules package-lock.json
npm installrm -rf .next
npm run builddocker compose down
docker system prune -a
docker compose up --build- Verify that backend server (
http://localhost:8000) is running - Check backend URL in
.env.local - Verify network/firewall settings