NextAI is a full-stack PDF question-answering application. Users can upload a PDF, ask questions about its contents by typing or speaking, and receive text or spoken answers.
nextai/
|-- public/ # Static frontend files
|-- src/
| |-- components/
| | |-- ChatComponent.js # Text and voice questions
| | |-- PdfUploader.js # PDF upload interface
| | `-- RenderQA.js # Question and answer display
| `-- App.js # Main React application
|-- server/
| |-- chat.js # PDF retrieval and question answering
| |-- server.js # Express server and upload routes
| |-- package.json
| `-- package-lock.json
|-- package.json
`-- package-lock.json
- Node.js 18 or later
- npm
- OpenAI API key
Install the frontend dependencies:
npm installInstall the backend dependencies:
cd server
npm installCreate server/.env:
REACT_APP_OPENAI_API_KEY=your_openai_api_keyCreate a server/uploads folder.
Run the frontend and backend together from the project root:
npm run dev- Frontend: http://localhost:3000
- Backend: http://localhost:5001
Run only the frontend:
npm startRun only the backend:
cd server
npm start