Skip to content

NormVg/opendocs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

opendocs

opendocs logo

A minimalist, modern PDF reader with AI-powered chat

version Electron Vue

A minimalist, modern PDF reader and organizer with built-in AI chat capabilities. Built with Electron, Vue 3, and Gemini AI.

✨ Features

πŸ“„ PDF Reading

  • Clean, distraction-free interface - Minimalist design focused on reading
  • Smooth navigation - Pan and zoom with mouse controls
  • Page tracking - Automatic page detection and navigation
  • Document library - Organize and access your PDFs easily
  • Starred documents - Bookmark your favorites
  • Search - Full-text search across all pages with result navigation

πŸ€– AI Chat

  • Multimodal AI integration - Chat with Google's Gemini AI about your documents
  • Context-aware - Add specific pages, page ranges, or the entire document as context
  • Streaming responses - Real-time AI responses with markdown formatting
  • Chat history - Automatically saves all conversations
  • Model selection - Choose from multiple Gemini models
  • Custom models - Add your own Gemini models in settings

🎨 User Experience

  • Dark mode - System-aware dark theme
  • Responsive design - Adapts to window size
  • Glassmorphism UI - Modern, translucent design elements
  • Keyboard shortcuts - Efficient navigation
  • Help modal - Built-in quick guide

πŸ› οΈ Tech Stack

  • Desktop Framework: Electron 38
  • Frontend: Vue 3 (Composition API)
  • PDF Rendering: vue-pdf-embed + PDF.js
  • AI: Google Gemini API (via Vercel AI SDK)
  • Icons: Lucide Vue
  • Markdown: markdown-it + highlight.js
  • Build Tool: Vite + electron-vite

πŸ“¦ Installation

Prerequisites

  • Node.js 18 or higher
  • npm or pnpm

Setup

  1. Clone the repository

    git clone https://github.com/yourusername/opendocs.git
    cd opendocs
  2. Install dependencies

    npm install
    # or
    pnpm install
  3. Get a Gemini API Key

    • Visit Google AI Studio
    • Create a new API key
    • You'll add this in the app's Settings later

πŸš€ Development

Run in development mode

npm run dev
# or
pnpm dev

This starts the Electron app with hot-reload enabled.

Project Structure

opendocs/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main/           # Electron main process
β”‚   β”‚   └── index.js    # Main entry point, IPC handlers
β”‚   β”œβ”€β”€ preload/        # Preload scripts
β”‚   β”‚   └── index.js    # IPC bridge
β”‚   └── renderer/       # Vue app (renderer process)
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ assets/     # CSS, images
β”‚       β”‚   β”œβ”€β”€ components/ # Vue components
β”‚       β”‚   β”‚   β”œβ”€β”€ AIChatSidebar.vue
β”‚       β”‚   β”‚   β”œβ”€β”€ DocListItem.vue
β”‚       β”‚   β”‚   └── ReaderToolbar.vue
β”‚       β”‚   β”œβ”€β”€ views/      # Main views
β”‚       β”‚   β”‚   β”œβ”€β”€ LibraryView.vue
β”‚       β”‚   β”‚   β”œβ”€β”€ ReaderView.vue
β”‚       β”‚   β”‚   └── SettingsView.vue
β”‚       β”‚   β”œβ”€β”€ router/     # Vue Router
β”‚       β”‚   β”œβ”€β”€ App.vue
β”‚       β”‚   └── index.html
β”œβ”€β”€ resources/          # App icons
└── package.json

πŸ—οΈ Building

Build for current platform

npm run build
# or
pnpm build

Build for specific platforms

# macOS
npm run build:mac

# Windows
npm run build:win

# Linux
npm run build:linux

Built apps will be in the dist/ folder.

πŸ“– Usage

First Time Setup

  1. Launch opendocs
  2. Click settings in the bottom left
  3. Enter your Gemini API key
  4. (Optional) Add custom AI models

Opening PDFs

  • Click open in the bottom right
  • Or drag and drop a PDF into the library

Using AI Chat

  1. Open a PDF
  2. Click the ✨ icon in the top right
  3. (Optional) Click βž• to add context:
    • Current Page - Just the page you're viewing
    • Page Range - Specify a range (e.g., 1-10)
    • Full Document - Entire PDF
  4. Type your question and press Enter

Search

  1. Click the πŸ” icon in the toolbar
  2. Type your search query
  3. Use ← β†’ arrows to navigate results

Keyboard Shortcuts

  • Esc - Close search or modals
  • ⌘/Ctrl + F - Search in document (when in reader)

🎯 Key Features Explained

AI Context System

The AI chat uses a sophisticated context management system:

  • Current Page: Extracts text from the visible page
  • Page Range: Allows you to specify which pages to include
  • Full Document: Processes the entire PDF text

Context items appear as chips in the input area and can be removed individually.

Chat History

  • Conversations are automatically saved to localStorage
  • Each chat is linked to its document
  • History is accessible via the πŸ“œ icon in the chat sidebar
  • You can delete individual chats

Model Management

  • Default models: Gemini 2.0 Flash Lite, 1.5 Flash, 1.5 Pro
  • Add custom models in Settings β†’ Models
  • Each model requires: Model Name and Model ID

πŸ”§ Configuration

electron-builder.yml

Configure app builds for different platforms:

  • App icons for macOS (.icns), Windows (.ico), Linux (.png)
  • App ID, category, and bundle identifier
  • Platform-specific settings

cook.config.json

Development workflow shortcuts (if using cook):

  • dev - Start development server
  • build - Build for macOS
  • install - Install dependencies

πŸ› Troubleshooting

PDF won't load

  • Ensure the file path is valid
  • Check browser console for errors
  • Try a different PDF

AI chat not working

  • Verify API key is set in Settings
  • Check internet connection
  • Ensure the model ID is correct

Search not finding text

  • PDFs with scanned images (OCR) may not have extractable text
  • Try a different PDF with native text

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

πŸ“„ License

This project is open source and available under the MIT License.

πŸ™ Acknowledgments

  • PDF.js - Mozilla's PDF rendering library
  • Gemini AI - Google's multimodal AI
  • Electron - Cross-platform desktop framework
  • Vue.js - Progressive JavaScript framework

Made with ❀️ for better document reading from TheAlphaOnes

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published