No description
Find a file
ggq-admin fb88b291de feat: Add interactive Table of Contents navigation with i18n support
Implements complete TOC feature for document navigation with bilingual support.

## TOC Detection & Extraction
- Pattern-based TOC detection with 3 regex patterns
- Heuristic validation (30%+ match ratio, 5+ entries, sequential pages)
- Hierarchical section key parsing (e.g., "4.1.2" → level 3, parent "4.1")
- Database schema with parent-child relationships
- Automatic extraction during OCR post-processing
- Server-side LRU caching (200 entries, 30min TTL)

## UI Components
- TocSidebar: Collapsible sidebar (320px) with auto-open on TOC presence
- TocEntry: Recursive component for hierarchical rendering
- Flex layout: Sidebar + PDF viewer side-by-side
- Active page highlighting with real-time sync
- localStorage persistence for sidebar state

## Navigation Features
- Click TOC entry → PDF jumps to page
- Deep link support: URL hash format #p=12
- Page change events: navidocs:pagechange custom event
- URL hash updates on all navigation (next/prev/goTo/TOC)
- Hash change listener for external navigation
- Page clamping and validation

## Search Integration
- "Jump to section" button in search results
- Shows when result has section field
- Navigates to document with page number and hash

## Accessibility
- ARIA attributes: role, aria-label, aria-expanded, aria-current
- Keyboard navigation: Enter/Space on entries, Tab focus
- Screen reader support with aria-live regions
- Semantic HTML with proper list/listitem roles

## Internationalization (i18n)
- Vue I18n integration with vue-i18n package
- English and French translations
- 8 TOC-specific translation keys
- Language switcher component in document viewer
- Locale persistence in localStorage

## Error Handling
- Specific error messages for each failure case
- Validation before processing (doc exists, has pages, has OCR)
- Non-blocking TOC extraction (doesn't fail OCR jobs)
- Detailed error returns: {success, error, entriesCount, pages}

## API Endpoints
- GET /api/documents/:id/toc?format=flat|tree
- POST /api/documents/:id/toc/extract
- Cache invalidation on re-extraction

## Testing
- Smoke test script: 9 comprehensive tests
- E2E testing guide with 5 manual scenarios
- Tests cover: API, caching, validation, navigation, search

## Database
- Migration 002: document_toc table
- Fields: id, document_id, title, section_key, page_start, level, parent_id, order_index
- Foreign keys with CASCADE delete

## Files Changed
- New: TocSidebar.vue, TocEntry.vue, LanguageSwitcher.vue
- New: toc-extractor.js, toc.js routes, i18n setup
- Modified: DocumentView.vue (sidebar, deep links, events)
- Modified: SearchView.vue (Jump to section button)
- Modified: ocr-worker.js (TOC post-processing)
- New: toc-smoke-test.sh, TOC_E2E_TEST.md

Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 13:22:45 +02:00
client feat: Add interactive Table of Contents navigation with i18n support 2025-10-20 13:22:45 +02:00
demo-screenshots Add demo screenshot capture script and verify all features 2025-10-20 01:52:28 +02:00
docs Fix search, add PDF text selection, clean duplicates, implement auto-fill 2025-10-20 01:35:06 +02:00
scripts Add StackCP hosting evaluation and deployment guides 2025-10-19 09:35:27 +02:00
server feat: Add interactive Table of Contents navigation with i18n support 2025-10-20 13:22:45 +02:00
test/data fix: Complete OCR pipeline with language code mapping 2025-10-19 05:09:51 +02:00
tests feat: Add interactive Table of Contents navigation with i18n support 2025-10-20 13:22:45 +02:00
.gitignore feat(ui): Meilisearch-style polish (badges, glass, grid, skeleton) + theme color\n\n- Add accessible focus ring and kbd styling\n- Add badge/glass/section/accent-border/bg-grid/skeleton utilities\n- Update theme-color + OG meta\n- Ignore sensitive handover file\n\nSee docs/ui/CHANGELOG_UI.md for details 2025-10-19 16:52:02 +02:00
ANALYSIS_INDEX.md docs: Add complete NaviDocs handover documentation and StackCP analysis 2025-10-19 13:19:42 +02:00
ARCHITECTURE-SUMMARY.md docs: Add architecture summary 2025-10-19 01:23:40 +02:00
BRANDING_CREATIVE_BRIEF.md feat: Complete frontend UI polish with Meilisearch-inspired design 2025-10-19 16:40:48 +02:00
BUILD_COMPLETE.md feat: Complete frontend UI polish with Meilisearch-inspired design 2025-10-19 16:40:48 +02:00
capture-demo-screenshots.js Add demo screenshot capture script and verify all features 2025-10-20 01:52:28 +02:00
CLEANUP_COMPLETE.sh feat: Complete frontend UI polish with Meilisearch-inspired design 2025-10-19 16:40:48 +02:00
DEMO-GUIDE.md Add comprehensive documentation for demo 2025-10-20 01:59:42 +02:00
DEVELOPMENT.md feat: Complete frontend UI polish with Meilisearch-inspired design 2025-10-19 16:40:48 +02:00
FEATURE-ROADMAP.md Update documents route with delete endpoint - WIP 2025-10-20 03:41:25 +02:00
GITEA_ACCESS.md docs: Add Gitea access explanation 2025-10-19 13:48:58 +02:00
GOOGLE_DRIVE_OCR_QUICKSTART.md feat: Complete frontend UI polish with Meilisearch-inspired design 2025-10-19 16:40:48 +02:00
IMPLEMENTATION_COMPLETE.md feat: NaviDocs MVP - Complete codebase extraction from lilian1 2025-10-19 01:55:44 +02:00
NAVIDOCS_HANDOVER.md feat: Complete frontend UI polish with Meilisearch-inspired design 2025-10-19 16:40:48 +02:00
navidocs_search_token_test_report.json feat: Add image extraction design, database schema, and migration 2025-10-19 19:47:30 +02:00
OCR_FINAL_RECOMMENDATION.md docs: Add final OCR recommendation and comparison summary 2025-10-19 09:09:22 +02:00
OCR_PIPELINE_SETUP.md feat: NaviDocs MVP - Complete codebase extraction from lilian1 2025-10-19 01:55:44 +02:00
playwright.config.js Add Playwright E2E test suite with 8 passing tests 2025-10-20 01:51:09 +02:00
PORT_ALLOCATION.md feat: Complete frontend UI polish with Meilisearch-inspired design 2025-10-19 16:40:48 +02:00
PORT_MIGRATION_SUMMARY.md feat: Complete frontend UI polish with Meilisearch-inspired design 2025-10-19 16:40:48 +02:00
QUICK_REFERENCE.md feat(ui): Meilisearch-style polish (badges, glass, grid, skeleton) + theme color\n\n- Add accessible focus ring and kbd styling\n- Add badge/glass/section/accent-border/bg-grid/skeleton utilities\n- Update theme-color + OG meta\n- Ignore sensitive handover file\n\nSee docs/ui/CHANGELOG_UI.md for details 2025-10-19 16:52:02 +02:00
QUICKSTART.md feat: NaviDocs MVP - Complete codebase extraction from lilian1 2025-10-19 01:55:44 +02:00
README.md feat: Complete frontend UI polish with Meilisearch-inspired design 2025-10-19 16:40:48 +02:00
README_NEW.md feat: Complete frontend UI polish with Meilisearch-inspired design 2025-10-19 16:40:48 +02:00
REORGANIZE_FILES.sh feat: Complete frontend UI polish with Meilisearch-inspired design 2025-10-19 16:40:48 +02:00
SERVICES_STATUS.md feat: Complete frontend UI polish with Meilisearch-inspired design 2025-10-19 16:40:48 +02:00
SESSION-SUMMARY.md Add session summary - NaviDocs polished and demo-ready 2025-10-20 02:03:40 +02:00
SESSION_STATUS.md feat: Complete frontend UI polish with Meilisearch-inspired design 2025-10-19 16:40:48 +02:00
STACKCP_ARCHITECTURE_ANALYSIS.md docs: Add complete NaviDocs handover documentation and StackCP analysis 2025-10-19 13:19:42 +02:00
STACKCP_DEBATE_BRIEF.md docs: Add complete NaviDocs handover documentation and StackCP analysis 2025-10-19 13:19:42 +02:00
STACKCP_EVALUATION_REPORT.md feat: Complete frontend UI polish with Meilisearch-inspired design 2025-10-19 16:40:48 +02:00
STACKCP_QUICK_REFERENCE.md docs: Add complete NaviDocs handover documentation and StackCP analysis 2025-10-19 13:19:42 +02:00
STACKCP_VERIFICATION_SUMMARY.md Add StackCP deployment verification summary 2025-10-19 09:36:43 +02:00
start-all.sh feat: Complete frontend UI polish with Meilisearch-inspired design 2025-10-19 16:40:48 +02:00
stop-all.sh feat: Complete frontend UI polish with Meilisearch-inspired design 2025-10-19 16:40:48 +02:00
test-backend-e2e.js feat: Add image extraction design, database schema, and migration 2025-10-19 19:47:30 +02:00
test-e2e.js feat: Add image extraction design, database schema, and migration 2025-10-19 19:47:30 +02:00
test-image-endpoints.sh Add image retrieval API endpoints 2025-10-19 19:57:49 +02:00
test-manual.pdf fix: Switch to local system tesseract command for OCR 2025-10-19 04:48:18 +02:00
TEST_RESULTS.md feat: Complete frontend UI polish with Meilisearch-inspired design 2025-10-19 16:40:48 +02:00

NaviDocs - Professional Boat Manual Management

Production-ready boat manual management platform with OCR and intelligent search

Built with Vue 3, Express, SQLite, and Meilisearch. Extracted from the lilian1 (FRANK-AI) prototype with clean, professional code only.


Features

  • Upload PDFs - Drag and drop boat manuals
  • OCR Processing - Automatic text extraction with Tesseract.js
  • Intelligent Search - Meilisearch with boat terminology synonyms
  • Offline-First - PWA with service worker caching
  • Multi-Vertical - Supports boats, marinas, and properties
  • Secure - Tenant tokens, file validation, rate limiting

Tech Stack

Backend

  • Node.js 20 - Express 5
  • SQLite - better-sqlite3 with WAL mode
  • Meilisearch - Sub-100ms search with synonyms
  • BullMQ - Background OCR job processing
  • Tesseract.js - PDF text extraction

Frontend

  • Vue 3 - Composition API with <script setup>
  • Vite - Fast builds and HMR
  • Tailwind CSS - Meilisearch-inspired design
  • Pinia - State management
  • PDF.js - Document viewer

Quick Start

Prerequisites

# Required
node >= 20.0.0
npm >= 10.0.0

# For OCR
pdftoppm (from poppler-utils)
tesseract >= 5.0.0

# For search
meilisearch >= 1.0.0

# For queue
redis >= 6.0.0

Installation

# Clone repository
cd ~/navidocs

# Install server dependencies
cd server
npm install
cp .env.example .env
# Edit .env with your configuration

# Initialize database
npm run init-db

# Install client dependencies
cd ../client
npm install

# Start services (each in separate terminal)
meilisearch --master-key=masterKey
redis-server
cd ~/navidocs/server && node workers/ocr-worker.js
cd ~/navidocs/server && npm run dev
cd ~/navidocs/client && npm run dev

Visit http://localhost:8080


Architecture

See docs/architecture/ for complete schema and configuration details.

Ship it. Learn from users. Iterate.