A powerful desktop application that helps you write books with AI assistance. Built with Electron, React, and OpenAI's GPT-4.
- Create and organize multiple books
- Track progress with chapter and word counts
- Edit book metadata (title, author, description)
- Topic Extraction: Upload notes and automatically extract topics using AI
- Outline Generation: Generate detailed chapter outlines from your notes
- Content Generation: Create full chapter content based on outlines
- Content Refinement: Improve selected text with AI assistance
- Interactive AI Assistant: Chat with AI about your writing
- Professional TipTap editor with formatting options
- Bold, italic, underline, lists, and more
- Auto-save functionality (saves every 2 seconds)
- Word count tracking
- Generate professional PDFs of your books
- Includes cover page, table of contents, and formatted chapters
- Beautiful typography optimized for reading
- Upload and organize research notes
- Automatic topic extraction and categorization
- Filter notes by topic
- Link notes to chapters
- Slack-style three-panel interface
- Clean, professional design
- Intuitive navigation
- Real-time status updates
- Node.js: Version 18 or higher
- npm: Version 9 or higher
- OpenAI API Key: Get one from OpenAI Platform
- Operating System: macOS, Windows, or Linux
cd book-writing-assistantnpm installThis will install all required packages including:
- Electron for desktop app functionality
- React for the UI
- TipTap for rich text editing
- better-sqlite3 for local database
- OpenAI SDK for AI features
- Puppeteer for PDF generation
- Get an API key from OpenAI Platform
- Launch the application
- Go to Settings (bottom of left sidebar)
- Enter your API key
- Click "Save Settings"
Your API key is encrypted and stored securely on your local machine.
npm run electron:devThis will:
- Start the Vite development server
- Launch Electron with hot-reload enabled
- Open DevTools for debugging
npm run electron:buildThis will create a distributable package in the dist-electron directory.
For macOS, you'll get:
.dmgfile for easy installation.zipfile for manual installation
- Click the "+" button next to "Books" in the left sidebar
- Enter book title, author name, and description
- Click "Create"
- Navigate to "All Notes" in the left sidebar
- Paste or type your research notes (separate ideas with blank lines)
- Click "Process Notes"
- AI will automatically extract topics and organize your notes
- Select a book from the left sidebar
- Click "+ New Chapter" in the right sidebar
- Enter chapter title
- Optionally select a topic to auto-generate an outline
- Click "Create Chapter"
- Open a chapter
- Go to the "Outline" tab
- Edit the outline or click "Refine with AI" for improvements
- Click "Approve Outline" when ready
- Go to the "Content" tab
- Click "Generate Chapter Content"
- AI will write the full chapter based on your outline and notes
- Edit as needed using the rich text editor
- Select any text in the editor
- Click "Refine Selection"
- Tell AI how to improve it
- Review and accept changes
- Go to the "AI Assistant" tab
- Ask questions or request help
- Get suggestions for improvements
- Iterate on your writing
- Select a book with chapters
- Click "Generate PDF" in the right sidebar
- Wait for PDF generation
- Click "Open PDF" to view
- PDF is saved to your Downloads folder
book-writing-assistant/
├── electron/
│ ├── main.js # Electron main process
│ ├── preload.js # IPC bridge (security)
│ ├── database.js # SQLite operations
│ ├── ai-service.js # OpenAI API integration
│ └── pdf-generator.js # PDF creation
├── src/
│ ├── main.jsx # React entry point
│ ├── App.jsx # Main app component
│ ├── components/
│ │ ├── Layout/ # Three-panel layout
│ │ ├── Editor/ # Chapter editors
│ │ ├── Books/ # Book management
│ │ ├── Chapters/ # Chapter management
│ │ ├── Notes/ # Notes processing
│ │ ├── Topics/ # Topics catalog
│ │ └── Settings/ # Settings page
│ ├── contexts/
│ │ └── AppContext.jsx # Global state
│ └── styles/
│ └── index.css # TailwindCSS styles
├── package.json
├── vite.config.js
└── README.md
The application uses SQLite to store all data locally on your machine. The database file is stored in:
- macOS:
~/Library/Application Support/Book Writing Assistant/books.db - Windows:
%APPDATA%/Book Writing Assistant/books.db - Linux:
~/.config/Book Writing Assistant/books.db
- books: Book metadata
- chapters: Chapter content and outlines
- notes: Research notes
- topics: Extracted topics
- notes_topics: Links between notes and topics
- settings: Application settings (encrypted)
- Make sure you've entered a valid OpenAI API key
- Check that you have credits in your OpenAI account
- Go to Settings and re-enter your API key
- Restart the application
- Ensure you have chapters with content
- Check that Puppeteer is installed correctly
- Try running
npm install puppeteermanually - On some systems, you may need to install Chrome/Chromium
- Close the application completely
- Navigate to the database location (see above)
- Backup the
books.dbfile - Delete
books.dband restart (this will reset all data)
- Delete
node_modulesfolder - Delete
package-lock.json - Run
npm installagain - Try building again
- Make sure you're using Node.js 18 or higher
- Check that all dependencies installed correctly
- Try
npm run devfirst to test Vite - Check console for error messages
- API Keys: Encrypted using AES-256-CBC before storage
- Context Isolation: Enabled in Electron for security
- No Remote Access: All data stays on your local machine
- Secure IPC: Uses Electron's contextBridge for safe communication
- The application auto-saves every 2 seconds
- Large documents may take longer to process
- PDF generation can take 10-30 seconds depending on book length
- AI requests typically take 5-15 seconds
This application uses OpenAI's GPT-4 API. Costs depend on your usage:
- Topic Extraction: ~$0.01 per 10 paragraphs
- Outline Generation: ~$0.05 per outline
- Chapter Generation: ~$0.20-0.50 per chapter (2000-3000 words)
- Content Refinement: ~$0.02-0.10 per request
Monitor your usage at OpenAI Platform.
- Cmd/Ctrl + B: Bold
- Cmd/Ctrl + I: Italic
- Cmd/Ctrl + U: Underline
- Cmd/Ctrl + S: Manual save (auto-save is enabled)
- Enter: Send message in AI Assistant
- Shift + Enter: New line in AI Assistant
Planned features for future releases:
- Export to DOCX, Markdown, ePub
- Version history for chapters
- Global search across all content
- Dark mode
- Custom PDF templates
- Cloud sync (optional)
- Collaboration features
- Grammar and style checking
- Word count goals and progress tracking
- Chapter templates
For issues, questions, or feature requests:
- Check this README for troubleshooting tips
- Review the console logs for error messages
- Make sure you're using the latest version
- Ensure your OpenAI API key is valid and has credits
MIT License - See LICENSE file for details
- Built with Electron
- UI powered by React
- Rich text editing with TipTap
- AI powered by OpenAI
- Styling with TailwindCSS
- Icons from Lucide
Happy Writing! 📚✍️