Skip to content

An intelligent notebook application built with Next.js and Genkit that allows you to get insights from your documents and websites. Upload files or provide URLs and start asking questions!

Notifications You must be signed in to change notification settings

flegaspi700/DocuNote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

79 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“„ DocuNote

CI

Turn documents into conversations

An intelligent AI-powered chat application built with Next.js 15 and Google Gemini that lets you upload files, scrape websites, and have natural conversations about your contentโ€”with automatic summaries and complete conversation history.

โœจ Features

  • ๐Ÿ’ฌ Conversational AI Chat: Interact with Google Gemini 2.5 Flash to ask questions and get information from your provided sources
  • ๐Ÿ“š Chat History: Save and load multiple conversations with auto-generated titles
  • โญ Pin Conversations: Star important conversations to keep them at the top โœจ NEW
  • ๐Ÿ” Conversation Search: Search conversations by title or message content with real-time filtering
  • ๐ŸŽฏ Advanced Search Filters: Filter conversations by date range, source type, and more
  • โŒจ๏ธ Keyboard Shortcuts: Navigate faster with Ctrl+N, Ctrl+K, Ctrl+E, and more
  • โœจ Content Summaries: AI-generated summaries for uploaded files and URLs with key points
  • ๐Ÿ“ฅ Export Conversations: Download chat history as TXT or PDF files
  • โšก Streaming Responses: Real-time AI response streaming with animated progress indicator
  • ๐Ÿ’พ Auto-Save Everything: Messages, sources, themes, and conversations automatically persist across sessions
  • ๐Ÿ”’ Input Validation: Comprehensive security with file size limits, URL validation, and SSRF protection
  • ๐Ÿ›ก๏ธ Error Boundaries: Graceful error handling with recovery options - prevents app crashes
  • ๐Ÿ“ฑ Mobile Responsive: Optimized for all devices with touch-friendly interactions and auto-close sidebar
  • ๐Ÿ“„ File Uploads: Upload and process .txt, .pdf, .md, .csv, and .docx files (10MB limit) to use as a knowledge base
    • Text files (.txt) - Plain text content
    • PDF documents (.pdf) - Extracted text from PDFs
    • Markdown files (.md) - Preserves formatting
    • CSV files (.csv) - Parsed and formatted with headers
    • Word documents (.docx) - Extracted text content
  • ๐ŸŒ Website Scraping: Provide any website URL, and the application will scrape its content to use as a source
  • ๐Ÿ“Š Source Management: Clean sidebar interface to easily add, view, and remove your files and URL sources

๐Ÿš€ Recent Updates

November 4, 2025 - Major Test Coverage Improvements ๐ŸŽฏ

  • โœ… Test Coverage: 63.29% โ†’ 66.92% (+3.63%) - Core business logic now has 95%+ coverage
    • Storage Tests (PR #26): lib/storage.ts 69.14% โ†’ 97.14% (+28%)

      • 45 comprehensive tests for localStorage utilities
      • Tests: messages, sources, AI themes, conversations, bulk operations
      • Full coverage of CRUD operations, pin/unpin, sorting logic
    • Validation Tests (PR #27): lib/validation.ts 71.95% โ†’ 95.85% (+23.9%)

      • 61 comprehensive tests for security and input validation
      • Tests: URL validation (SSRF, XSS protection), message/content length
      • File name security, HTML sanitization, utility functions
    • Error Logger Tests (PR #27): lib/error-logger.ts 35.95% โ†’ 99.25% (+63.3%)

      • 50 comprehensive tests for error tracking and logging
      • Tests: error levels, history management, persistence, formatting
      • Error type detection (network, timeout), user-friendly messages
    • Total Impact: 156 new tests added (532 โ†’ 688 tests)

    • Methodology: Test-Driven Development (TDD) with edge case focus

    • All PRs merged with CI validation โœ…

November 4, 2025 - Stable Conversation Sorting & Pin Feature โญ

  • โœ… Fixed Conversation Sorting - Conversations no longer rearrange when selected

    • Root Cause: saveConversation() was updating updatedAt timestamp even when just loading from history
    • Solution: Added updateTimestamp parameter (default: true) - set to false when loading
    • Impact: Conversation list stays in consistent order, only changes when content actually changes
    • Testing: 8 new TDD tests for sorting stability and pin feature โœ…
  • โœ… Pin/Star Conversations - Keep important conversations at the top

    • Click star icon to pin/unpin any conversation
    • Pinned conversations always appear first (sorted by most recent)
    • Unpinned conversations follow (also sorted by most recent)
    • Visual distinction: yellow background for pinned items
    • Pin status persists in localStorage
    • Branch: feat/conversation-sorting-and-pinning

November 4, 2025 - Conversation Title UI Fix ๐Ÿ›

  • โœ… Fixed Critical Bug - Conversation titles now update immediately in the header
    • Root Cause: ConversationTitle component was overriding the title prop with hardcoded "New Conversation" when messages.length === 0
    • Solution: Removed conditional override logic - component now displays actual title prop
    • Impact: Instant UI updates when changing conversation titles (no more page refresh needed)
    • Testing: TDD methodology with 3 new tests, all 511 tests passing โœ…
    • Branch: fix/conversation-title-ui-update

November 2, 2025 - Enhanced Conversation Management

  • โœ… Save Empty Conversations - You can now save and name conversations even without messages or files
    • Create conversations with custom titles before chatting
    • Edit conversation titles anytime (not just after first message)
    • Better organization for planning and research workflows

October 30, 2025 - Extended File Type Support ๐Ÿ“„

  • โœ… Added support for 3 new file types: CSV, Markdown, and Word documents
    • .csv - Parsed with column headers and formatted tables
    • .md - Markdown files with preserved formatting
    • .docx - Microsoft Word documents with extracted text
  • โœ… Updated welcome message to reflect all 5 supported file types
  • โœ… Comprehensive testing with Jest and Playwright for all file formats

๏ฟฝ๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18 or higher
  • npm or yarn
  • Google Gemini API Key (Get one here) - Powers both chat and image generation!

Installation

  1. Clone the repository:

    git clone https://github.com/flegaspi700/DocuNote.git
    cd DocuNote
  2. Install Dependencies:

    npm install
  3. Set up environment variables:

    Create a .env.local file in the root directory:

    # Required: Gemini API for chat, theme generation, and image generation
    GEMINI_API_KEY=your_gemini_api_key_here

    That's it! Your Gemini API key powers everything: chat responses, theme generation, and Gemini 2.5 Flash Image background images. No additional setup needed!

  4. Run the Development Server:

    npm run dev

    This will start the Next.js development server on http://localhost:9002.

  5. Start building! ๐ŸŽ‰

Quick Testing

Run the test suite to verify everything works:

# Unit and integration tests
npm test

# End-to-end tests
npm run test:e2e

# Coverage report
npm run test:coverage

For detailed testing documentation, see TESTING-README.md.


๐Ÿ“š Documentation

Comprehensive documentation is available in the docs/ folder:

Start here: ๐Ÿ“– Documentation Index


๐Ÿ› ๏ธ Tech Stack

Frontend

AI & Backend

Development & Testing


๐ŸŽฏ Project Status

โœ… What's Working (Nov 4, 2025)

  • Chat Interface - Full conversational AI with context from sources
  • Chat History - Save, load, and manage multiple conversations with auto-generated titles
  • Pin Conversations - Star important conversations to keep them at the top โญ NEW
  • Conversation Search - Search by title or message content with debounced filtering
  • Search Filters - Filter conversations by date range, source type
  • Testing - 688 tests (675 passing, 13 skipped), 66.92% coverage, CI/CD pipeline โœจ NEW
    • Core business logic: 95%+ coverage (storage, validation, error-logger)
  • Keyboard Shortcuts - Quick navigation with Ctrl+N, Ctrl+K, Ctrl+E, Ctrl+Shift+T
  • Message Editing - Edit and regenerate AI responses
  • Conversation Tags - Organize with custom color-coded tags
  • Content Summaries - AI-generated summaries for files and URLs
  • Export Conversations - Download chat history as TXT or PDF
  • Response Streaming - Real-time token-by-token AI responses
  • Data Persistence - Auto-save/restore messages, sources, themes, and conversations
  • Input Validation - Comprehensive security and data validation (SSRF, XSS protection)
  • Error Logging - Centralized error tracking with persistence and user-friendly messages
  • Error Boundaries - Graceful error handling and crash prevention
  • Mobile Responsive - Optimized for all devices (320px - 1920px+)
  • File Upload - .txt, .pdf, .md, .csv, .docx file processing (10MB limit) โœจ NEW
  • URL Scraping - Website content extraction with SSRF protection
  • Source Management - Add/remove files and URLs with summary generation
  • Theme System - Dark/light mode + AI-generated themes with optimized fonts
  • CI/CD - TypeScript, ESLint, Jest, and build checks on every push

๐Ÿšง Known Limitations

  • No user authentication (single-user local app)
  • No swipe gestures for sidebar (future enhancement)
  • 5MB localStorage limit (can store ~1000 messages)
  • Content limits (500K chars per file, 100K chars per message)

See Development Issue Log for detailed status.


๐Ÿ”ฎ Next Steps & Roadmap

High Priority (Production Ready)

  1. Persist Sources & Themes โœ… COMPLETED (Oct 13, 2025)
  2. Streaming Responses โœ… COMPLETED (Oct 13, 2025)
  3. Input Validation โœ… COMPLETED (Oct 13, 2025)
  4. UI Layout Improvements โœ… COMPLETED (Oct 13, 2025)
  5. Error Boundaries โœ… COMPLETED (Oct 13, 2025)
  6. Mobile Responsive Layout โœ… COMPLETED (Oct 17, 2025)

Medium Priority (Enhanced UX)

  1. Chat History โœ… COMPLETED (Oct 17, 2025) - Save and load past conversations
  2. Content Summaries โœ… COMPLETED (Oct 17, 2025) - AI-generated summaries for uploaded sources
  3. Conversation Search โœ… COMPLETED (Oct 17, 2025) - Search conversations by title and content
  4. Export Conversations โœ… COMPLETED (Oct 30, 2025) - Download chat history as TXT/PDF
  5. Keyboard Shortcuts โœ… COMPLETED (Oct 30, 2025) - Navigate with Ctrl+N, Ctrl+K, Ctrl+E, Ctrl+Shift+T
  6. Advanced Search Filters โœ… COMPLETED (Oct 30, 2025) - Filter by date, source type, message count
  7. Message Editing โœ… COMPLETED (Oct 30, 2025) - Edit and regenerate AI responses
  8. Conversation Tags โœ… COMPLETED (Oct 30, 2025) - Organize with custom tags

Low Priority (Future Features)

  1. User Authentication - Multi-user support with accounts
  2. Cloud Storage - Sync conversations across devices
  3. More AI Models - Support for Claude, GPT-4, etc.
  4. Voice Input - Speech-to-text for messages
  5. Collaborative Chats - Share conversations with others
  6. Multi-Model Support - Switch between AI models
  7. Collaborative Features - Share conversations, team workspaces
  8. Voice Integration - Speech-to-text and text-to-speech

Polish & Documentation

  1. Screenshots & Media - Add screenshots to README and documentation
  2. Demo Video/GIF - Create visual walkthrough of features
  3. Deployment Guide - Step-by-step deployment instructions (Vercel, Netlify, Azure)
  4. Contributing Guidelines - Detailed contribution workflow and standards
  5. API Documentation - Document Genkit flows and server actions
  6. Architecture Diagrams - Visual representation of app structure

See detailed roadmap: Daily Logs


๐Ÿงช Testing

This project has comprehensive test coverage:

  • Unit Tests: Component and utility testing with Jest
  • Integration Tests: AI flow testing with 92%+ coverage
  • E2E Tests: Browser automation with Playwright

Quick Commands:

npm test                    # Run Jest tests
npm run test:e2e           # Run Playwright E2E tests
npm run test:coverage      # Generate coverage report
npx playwright show-report # View E2E test report

Current Status:

  • 688 tests (675 passing, 13 skipped)
  • 20+ E2E tests with Playwright
  • 66.92% statement coverage, 81.20% branch coverage, 54.85% function coverage
  • CI/CD pipeline with automated checks

For complete testing guide, see Testing Documentation.


๐Ÿ“– Learn More

Documentation

External Resources


๐Ÿค Contributing

Contributions are welcome! Please see:

  1. Development Guide - How to contribute
  2. Git Commit Guide - Commit standards
  3. Testing Guide - How to write tests

Development Workflow:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Write/update tests
  5. Update documentation
  6. Submit a pull request

๐Ÿ“Š Project Metrics

Metric Value Last Updated
Lines of Code ~7,500+ lines Nov 4, 2025
Documentation ~25,000+ lines Nov 4, 2025
Tests 688 tests (675 passing, 13 skipped) Nov 4, 2025
Test Coverage 66.92% statements, 81.20% branches, 54.85% functions Nov 4, 2025
Components 32+ reusable UI components Nov 4, 2025
AI Flows 6 Genkit flows Nov 4, 2025
Custom Hooks 7 hooks Nov 4, 2025

๐Ÿ“ License

This project is open source. See the LICENSE file for details.


๐Ÿ™ Acknowledgments

Built with:


Last Updated: November 4, 2025

About

An intelligent notebook application built with Next.js and Genkit that allows you to get insights from your documents and websites. Upload files or provide URLs and start asking questions!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages