Upload, analyze, and chat with your PDFs using advanced AI technology
π Live Demo- Intelligent PDF Chat: Engage in natural conversations with your PDF documents
- Smart Document Processing: Automatic analysis and understanding of PDF content
- Secure Cloud Storage: Enterprise-grade security with end-to-end encryption
- Rich Text Editor: Built-in editor for taking notes while reviewing documents
- User Authentication: Secure authentication system powered by Clerk
- Responsive Design: Modern, mobile-friendly interface
- Real-time Updates: Live chat functionality with instant responses
- Next.js 15 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first CSS framework
- Framer Motion - Animation library
- Radix UI - Accessible component primitives
- Convex - Backend-as-a-Service with real-time capabilities
- Clerk - Authentication and user management
- Vector Database - Document embeddings for AI chat
- OpenAI - AI-powered chat functionality
- LangChain - Document processing and embeddings
- PDF-Parse - PDF text extraction
- Tiptap - Rich text editor
- Lowlight - Code syntax highlighting
- Node.js 18+ installed
- npm, yarn, pnpm, or bun package manager
-
Clone the repository
git clone <repository-url> cd chat-with-pdf
-
Install dependencies
npm install # or yarn install # or pnpm install
-
Set up environment variables Create a
.env.localfile in the root directory:# Clerk Authentication NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key CLERK_SECRET_KEY=your_clerk_secret_key # Convex NEXT_PUBLIC_CONVEX_URL=your_convex_url CONVEX_DEPLOY_KEY=your_convex_deploy_key # OpenAI OPENAI_API_KEY=your_openai_api_key
-
Set up Convex
npx convex dev
-
Run the development server
npm run dev # or yarn dev # or pnpm dev
-
Open your browser Navigate to http://localhost:3000
- Sign Up/Sign In: Create an account or sign in to access the platform
- Upload PDFs: Upload up to 3 PDFs for free (premium plans available)
- Start Chatting: Ask questions about your documents and get AI-powered answers
- Take Notes: Use the built-in editor to take notes while reviewing documents
- Manage Workspace: Organize your documents and conversations
The application follows a modern Next.js architecture:
/app- App Router pages and layouts/components- Reusable React components/convex- Backend functions and schema/lib- Utility functions and configurations/hooks- Custom React hooks
| Variable | Description | Required |
|---|---|---|
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY |
Clerk public key | Yes |
CLERK_SECRET_KEY |
Clerk secret key | Yes |
NEXT_PUBLIC_CONVEX_URL |
Convex backend URL | Yes |
CONVEX_DEPLOY_KEY |
Convex deployment key | Yes |
OPENAI_API_KEY |
OpenAI API key for AI features | Yes |
- Create a Clerk application at clerk.com
- Configure authentication providers
- Set up webhooks for user management
- Add environment variables to your project
- Create a Convex project at convex.dev
- Deploy your schema and functions
- Configure vector search for document embeddings
- Set up real-time subscriptions
- Connect your repository to Vercel
- Add environment variables in the Vercel dashboard
- Deploy - Vercel will automatically build and deploy your application
# Build the application
npm run build
# Start the production server
npm run startchat-with-pdf/
βββ app/ # Next.js App Router
β βββ (auth)/ # Authentication pages
β βββ api/ # API routes
β βββ dashboard/ # Dashboard pages
β βββ workspace/ # Workspace pages
β βββ layout.tsx # Root layout
βββ components/ # React components
β βββ auth/ # Authentication components
β βββ dashboard/ # Dashboard components
β βββ landing/ # Landing page components
β βββ ui/ # UI components
β βββ workspace/ # Workspace components
βββ convex/ # Backend functions
β βββ _generated/ # Auto-generated types
β βββ langchain/ # LangChain integration
β βββ schema.ts # Database schema
βββ hooks/ # Custom React hooks
βββ lib/ # Utility functions
βββ public/ # Static assets
- Fork the repository
- Create a 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
- All user data is encrypted in transit and at rest
- Authentication handled by Clerk with industry-standard security
- PDF files are securely stored and processed
- API routes are protected with authentication middleware
This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ by Rishkesh K V