A React-based PDF reader application that uses OpenAI's API to analyze documents, generate summaries, extract keywords, and create mind maps. Built with React, TypeScript, and Vite.
- PDF document viewing
- AI-powered document analysis
- Document summarization
- Keyword extraction
- Interactive mind mapping
- Text-to-speech capabilities
- Node.js (v18 or higher recommended)
- npm (v9 or higher) or yarn package manager
- OpenAI API key (GPT-4 access required)
- ElevenLabs API key (optional, for text-to-speech features)
- Modern web browser (Chrome, Firefox, Safari, or Edge)
- PDF documents (.pdf)
- Maximum file size: 25MB
- Text must be selectable in the PDF (non-scanned documents)
- Clone the repository:
git clone <repository-url>
cd pdf-reader- Install dependencies:
npm install- Create a
.envfile in the root directory and add your API keys:
VITE_OPENAI_API_KEY=your_openai_api_key_here
VITE_ELEVENLABS_API_KEY=your_elevenlabs_api_key_here # Optional- Start the application:
npm run dev-
Open your browser and navigate to
http://localhost:5173 -
Upload a PDF document using the upload button
-
Available features:
- Document Viewing: Navigate through pages using arrow keys or scroll
- AI Analysis: Click the analyze button to generate insights
- Summary: View an AI-generated summary of the document
- Keywords: See key concepts and their definitions
- Mind Map: Explore document concepts in an interactive graph
- Text-to-Speech: Listen to document sections (requires ElevenLabs API key)
To run the development server:
npm run devThe application will be available at http://localhost:5173
To create a production build:
npm run buildTo preview the production build:
npm run preview- React 18
- TypeScript
- Vite
- TailwindCSS
- OpenAI API
- PDF.js
- React Force Graph 2D
- ElevenLabs API (optional)
src/
├── components/ # React components
├── services/ # API and service integrations
├── styles/ # CSS and styling files
└── main.tsx # Application entry point
Common issues and solutions:
- PDF fails to load: Ensure the PDF is not password-protected and is under 25MB
- AI analysis not working: Verify your OpenAI API key and ensure you have GPT-4 access
- Text-to-speech unavailable: Check your ElevenLabs API key if you want to use this feature
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.