Languages:
Portuguese |
English
BookPulse AI is a full-stack Next.js application for building a private AI-powered reading library. Users can upload PDF books, organize them in a personal collection, and start voice conversations about each book through an AI assistant.
The system supports:
- Authentication and user management with Clerk
- PDF upload with optional custom cover image
- Automatic text extraction and segmentation for searchable book context
- Voice-based AI conversations powered by Vapi
- Subscription-aware limits for books and voice sessions
- Library search by title or author
This project was built to turn uploaded books into a more interactive reading experience.
The goal is to combine a clean reading-library workflow with practical AI features:
- keep each user's library private
- let users upload their own PDF content
- make book conversations contextual instead of generic
- control usage through subscription plans
- App Router project using server components, client components, server actions, and route handlers
- MongoDB persistence for books, book segments, and voice session history
- Clerk authentication and subscription integration
- Vercel Blob storage for PDF and cover uploads
- Personal library homepage with search by title or author
- Protected upload page for authenticated users
- PDF validation with 50MB size limit
- Optional cover image upload
- Automatic fallback cover generation from the PDF when available
- Duplicate-title check per user
- Automatic slug generation for book routes
- Voice conversation page for each uploaded book
- Live microphone controls and call status feedback
- Streaming transcript for user and assistant messages
- Book-aware search tool for retrieving relevant text segments during the conversation
- Configurable assistant voice chosen at upload time
Free: 1 book, 5 voice sessions/month, 5 minutes/sessionStandard: 10 books, 100 voice sessions/month, 15 minutes/sessionPro: 100 books, unlimited voice sessions, 60 minutes/session- Upload and voice-session limits enforced on the server
- Subscription pricing page integrated with Clerk Pricing Table
- Sign in with Clerk
- Open
Add New - Upload a PDF and optionally a cover image
- Choose the assistant voice
- Let the app extract and segment the book text
- Browse the book in your private library
- Open a book and start a voice conversation about its content
- Next.js 16
- React 19
- TypeScript
- Tailwind CSS 4
- Clerk
- MongoDB + Mongoose
- Vercel Blob
- Vapi Web SDK
- PDF.js
- shadcn/ui
- Radix UI
- React Hook Form
- Zod
- Sonner
- Lucide React
- Clone the repository:
git clone https://github.com/pitercoding/bookpulse-ai.git
cd bookpulse-ai- Install dependencies:
npm install- Create a
.env.localfile with your own credentials:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key
MONGODB_URI=your_mongodb_connection_string
BLOB_READ_WRITE_TOKEN=your_vercel_blob_token
NEXT_PUBLIC_ASSISTANT_ID=your_vapi_assistant_id
NEXT_PUBLIC_VAPI_API_KEY=your_vapi_public_key- Run the development server:
npm run dev- Open:
- App:
http://localhost:3000
- Do not commit real secrets to
.env.local. - Clerk must be configured with the subscription plans used by the app.
- Vapi must have a compatible assistant configured for book conversations.
- MongoDB should be reachable by the local app.
- Vercel Blob is required for PDF and image uploads.
- Unauthenticated users can browse the landing/library shell, but uploading books and opening voice conversations require sign-in.
- Books are private to the authenticated Clerk user.
- Uploaded PDFs are parsed and split into segments so the assistant can search the book content during a conversation.
- Session limits and book limits depend on the active subscription plan.
Current status:
- core flows appear to be implemented for manual testing
- no automated test suite is currently configured in
package.json
Recommended next test scope:
- server action tests for upload, duplicate checks, and subscription limits
- route handler tests for upload authorization and Vapi tool calls
- component tests for upload flow, transcript rendering, and subscription gating
- Add richer reading progress and per-book insights
- Add session history and conversation recap UI
- Add edit/delete flows for uploaded books
- Improve semantic retrieval for book segments
- Add summaries, highlights, and chapter-level navigation
- Expand assistant tools beyond text lookup
- Add unit and integration tests
- Add lint/build/test CI pipeline
- Improve observability and error reporting for upload and voice flows
- Frontend/App runtime: Vercel
- Database: MongoDB Atlas
- Auth and billing: Clerk
- File storage: Vercel Blob
bookpulse-ai/
|- app/
| |- (root)/page.tsx # Library home and search
| |- books/
| | |- new/page.tsx # Upload new book
| | \- [slug]/page.tsx # Voice conversation page
| |- subscriptions/page.tsx # Pricing and plan management
| \- api/
| |- upload/route.ts # Blob upload authorization
| \- vapi/search-book/route.ts # Tool endpoint for book-aware AI search
|- components/ # UI and feature components
|- database/
| |- mongoose.ts # MongoDB connection
| \- models/ # Mongoose models
|- hooks/
| \- useVapi.ts # Voice session lifecycle and transcript sync
|- lib/
| |- actions/ # Server actions
| |- subscription-*.ts # Plan definitions and helpers
| |- pdf.ts # PDF extraction helpers
| \- search-book-segments.ts # Book segment retrieval
|- public/
| \- assets/ # Static images and branding
|- README.md # Documentation (English)
\- README.pt.md # Documentation (Portuguese)
This project is licensed under the MIT License.
Piter Gomes — Computer Science Student (6th Semester) & Full-Stack Developer