Commit Graph
351 Commits
Author SHA1 Message Date
john-okeefe e58849397c promote goldmark dependencies to direct 2026-02-01 21:20:48 -05:00
john-okeefe a8e904a7fb regenerate templ files with updated file paths 2026-02-01 21:18:05 -05:00
john-okeefe 711bab142c update .gitignore for build artifacts 2026-02-01 21:18:04 -05:00
john-okeefe 1e8cfa1008 Phase 1: Fix markdown rendering
- Add rawHTML helper function using template.HTML()
- Update docs template to use { template.HTML(doc.Content) }
- Docs now render HTML headings and content properly
- Markdown is converted to HTML by goldmark (with Unsafe()) and output directly
2026-02-01 21:05:12 -05:00
john-okeefe 5c7137feb8 docs: add interactive documentation system with Go+HTMX
- Add internal/docs package with markdown renderer (goldmark)
- Create docs layout template with sidebar navigation
- Implement hierarchical navigation auto-generated from docs folder
- Add table of contents generator (extract ## headings)
- Add syntax highlighting for code blocks (highlight.js)
- Add mobile responsive design
- Add /docs routes to main.go

The documentation system features:
- Dark theme matching app design
- Collapsible sidebar sections (Getting Started, User Guide, Device Setup, API Reference, Contributing)
- Table of contents for each page
- Breadcrumb navigation
- Full-text search (client-side JavaScript, API endpoint ready)
- Syntax highlighting for code blocks
- Mobile-friendly with hamburger menu

All documentation is served from /docs route, no authentication required.
Markdown files are rendered using goldmark with GFM extensions and syntax highlighting.
2026-02-01 18:33:55 -05:00
john-okeefe 555bd0df15 docs: update references for new configuration structure
- Update README.md with simplified documentation links
- Update docs/API_REFERENCE.md formatting and structure
- Update docs/SYNC_USER_GUIDE.md with minor improvements

These updates reflect the reorganized documentation structure
and new configuration approach with defaults in docker-compose.yml.
2026-02-01 17:34:21 -05:00
john-okeefe 7d1fc546a8 config: move operational defaults to docker-compose.yml
- Add conversion service configuration with sensible defaults
  - BOOKHOARD_CONVERSION_CACHE_DIR: /app/cache/kepub
  - BOOKHOARD_CONVERSION_TOOL: /usr/bin/kepubify
  - BOOKHOARD_CONVERSION_CACHE_TTL: 24h
  - Add named volume for conversion cache
- Add rate limiting configuration with defaults
  - TEST_MODE: false
  - RATE_LIMIT_ENABLED: true
  - REQUESTS_PER_MINUTE: 10
- Simplify .env.example to only required secrets (JWT_SECRET, DBPASS)
- Add section comments to docker-compose.yml for better organization
- Document optional overrides in .env.example comments

This change separates secrets (in .env) from operational configuration
(in docker-compose.yml), following security best practices while
maintaining flexibility for custom deployments.
2026-02-01 17:34:00 -05:00
john-okeefe 7135571de8 docs: reorganize documentation structure for users and self-hosters
- Remove internal development docs (phase tracking, implementation plans, security audits)
- Move DEVELOPMENT.md to docs/contributing/ for contributor guidance
- Move TROUBLESHOOTING.md from root to docs/ folder
- Add docs/INDEX.md as navigation hub for all documentation
- Clean up docs to focus on user/self-hoster facing content

This reorganization separates user-facing documentation from
internal contributor documentation, making the project more
approachable for self-hosters.
2026-02-01 17:33:40 -05:00
john-okeefe 6592db2c65 Update Go struct field names: BookmannUuid → BookhoardUuid
Complete the rename by updating:
- DeviceCatalogs struct field: BookmannUuid → BookhoardUuid (models.go)
- Generated queries: Update all references (queries.sql.go)
- Local variables: bookmannUUID → bookhoardUUID (kobo.go)
- Struct field access: catalog.BookmannUuid → catalog.BookhoardUuid

All "bookmann" and "BOOKMANN" references are now eliminated from the codebase.

Part of project rename to Bookhoard.
2026-02-01 16:26:59 -05:00
john-okeefe 5b9f21a592 Final cleanup: Update remaining comments and variable names
Changes:
- Update comments: "Bookmann UUID" → "Bookhoard UUID"
- Rename sidecar struct field: Bookmann → Bookhoard
- Update type names: SidecarBookmannConfig → SidecarBookhoardConfig
- Fix test database name in queue_test.go
- Fix uppercase env var examples in KOBO_SETUP.md

Internal Go variable names (BookmannUuid, bookmannUUID) left unchanged
as they're implementation details that don't affect functionality.

Part of project rename to Bookhoard.
2026-02-01 16:24:58 -05:00
john-okeefe 6d9b36be82 Regenerate templates after import path updates
Template changes:
- Regenerate all .templ files after bookmann → bookhoard import path changes
- Reformat queue.templ with consistent formatting
- Update generated .go template files

Part of project rename to Bookhoard.
2026-02-01 16:21:27 -05:00
john-okeefe 655ed9225f Update code references and tests: Bookmann → Bookhoard
Code changes:
- main.go: Update cache directory path
- sidecar.go: Update file extension (.bookmann.json → .bookhoard.json)
- security.go: Update CORS example URLs
- queue_test.go: Update test database name
- feed_test.go: Update test assertions
- phase1_integration_test.go: Update test email addresses
- TEST_COVERAGE.md: Update project references

Part of project rename to Bookhoard.
2026-02-01 16:21:10 -05:00
john-okeefe 153b330dd1 Update database schema and queries: Bookmann → Bookhoard
Database changes:
- schema.sql: Update column name bookmann_uuid → bookhoard_uuid
- schema.sql: Update index names and example URLs
- queries.sql: Update all SQL queries to use bookhoard_uuid
- Update example configuration values

Part of project rename to Bookhoard.
2026-02-01 16:21:03 -05:00
john-okeefe ff96ffa92d Update documentation and API tests: Bookmann → Bookhoard
Documentation updates:
- All docs/ files: Update project references
- Bruno API collection: Update collection name and tests
- Device setup guides: Update all examples
- Implementation plan: Update database schema examples
- README files: Update project references

Part of project rename to Bookhoard.
2026-02-01 16:20:56 -05:00
john-okeefe 547bc6f8f8 Update legal files and build configuration: Bookmann → Bookhoard
Root level changes:
- LICENSE: Update copyright notice to Bookhoard
- .gitignore: Update build artifact patterns
- package.json: Update package name to bookhoard
- TROUBLESHOOTING.md: Update all references and examples
- README.md: Update database connection examples

Part of project rename to Bookhoard.
2026-02-01 16:20:49 -05:00
john-okeefe 4e1feca124 Rename test file references: Bookmann → Bookhoard
Test file updates:
- Update import paths in test files: bookmann/internal → bookhoard/internal
- Update test helper functions and references
- Update test comments and documentation

This is part 6 of the project rename to Bookhoard.
2026-02-01 16:12:18 -05:00
john-okeefe 67629b0c14 Rename project documentation: Bookmann → Bookhoard
Documentation updates:
- Update README.md title and all references
- Update PROJECT_GUIDELINES.md title and guidelines
- Update all documentation files in docs/ directory
- Update device setup guides (Kobo, KOReader)
- Update API and architecture documentation
- Update completion summaries and progress reports

This is part 5 of the project rename to Bookhoard.
2026-02-01 16:12:12 -05:00
john-okeefe 96825e3bc2 Rename API test collection references: Bookmann → Bookhoard
Bruno API test updates:
- Update test assertions: X-Bookmann-* → X-Bookhoard-*
- Update variable names and references in test scripts
- Update documentation and comments in API tests

This is part 4 of the project rename to Bookhoard.
2026-02-01 16:12:05 -05:00
john-okeefe bb713f6300 Rename frontend template references: Bookmann → Bookhoard
Template changes:
- Update page titles: "Bookmann" → "Bookhoard"
- Update header branding and navigation text
- Regenerate compiled .go templates from .templ sources
- Update all UI references in HTML templates

This is part 3 of the project rename to Bookhoard.
2026-02-01 16:11:59 -05:00
john-okeefe 00a083b60b Rename backend code references: Bookmann → Bookhoard
Backend changes:
- Update import paths: bookmann/internal → bookhoard/internal
- Rename struct fields: BookmannUUID → BookhoardUUID
- Update handler function names: mapContentIdToBookmannUUID → mapContentIdToBookhoardUUID
- Update HTTP response headers: X-Bookmann-* → X-Bookhoard-*
- Update service and middleware references
- Update main.go imports and references

This is part 2 of the project rename to Bookhoard.
2026-02-01 16:11:54 -05:00
john-okeefe d43e0105eb Rename project module and database references: Bookmann → Bookhoard
Core infrastructure changes:
- Update Go module name: bookmann → bookhoard
- Rename database schema references and comments
- Update database column names: bookmann_uuid → bookhoard_uuid
- Rename SQL query functions: GetDeviceCatalogByBookmannUUID → GetDeviceCatalogByBookhoardUUID
- Update configuration defaults

This is part 1 of the project rename to Bookhoard.
2026-02-01 16:11:47 -05:00
john-okeefe 033271d267 Update project configuration for Bookhoard organization rename
Phase 1 of Gitea repository migration:
- Rename docker containers: bookmann_db → bookhoard_db, bookmann → bookhoard
- Update database name: bookmann → bookhoard
- Rename environment variables: BOOKMANN_* → BOOKHOARD_*
- Update documentation references to new project name

This prepares the codebase for migration to Bookhoard organization.
2026-02-01 16:10:29 -05:00
john-okeefe d0d86f19d6 refactor: remove all backward compatibility database views
Removed all 5 backward compatibility views from database schema:

1. ebooks view (lines 122-128)
   - Old API: /api/ebooks
   - Replaced by: media_items table with library_type filter

2. ebook_reading_progress view (lines 160-168)
   - Old API: mapped ebook_id alias
   - All progress routes now use reading_progress table directly

3. ebook_ratings view (lines 323-331)
   - Old API: /api/ebooks/:id/rating
   - Replaced by: media_ratings table

4. ebook_notes view (lines 333-341)
   - Old API: /api/ebooks/:id/notes
   - Replaced by: media_notes table

5. ebook_highlights view (lines 343-351)
   - Old API: /api/ebooks/:id/highlights
   - Replaced by: media_highlights table

Verification:
- No code queries these views directly (all queries use base tables)
- No handlers reference these views
- Bruno API tests use /api/media-items endpoints
- Application compiles successfully

This completes Phase 4 of legacy code cleanup.
All backward compatibility layers removed, codebase uses base tables directly.
2026-02-01 15:18:09 -05:00
john-okeefe 8d7a7a8045 docs: add code modification safety protocols to guidelines
Added 110 lines of safety guidelines to prevent future bugs:

New CRITICAL PROHIBITIONS:
- NEVER delete code without reading full context (20 lines before/after)
- NEVER make cascading fix-up edits without git diff review
- NEVER skip post-edit verification

New MANDATORY REQUIREMENTS:
- Post-Edit Verification (mandatory for all file modifications)
- Backup Before Large Changes
- Large Deletion Safety Pattern

New ERROR RECOVERY PROTOCOL:
- Immediate actions when mistakes occur
- Recovery examples with git commands
- Prevention learning points

New WORKFLOW CHECKLISTS:
- Error Recovery Protocol
- Phase Completion Verification

These guidelines address the critical bug where auth functions were
accidentally deleted during cleanup, preventing recurrence.
2026-02-01 14:11:32 -05:00
john-okeefe d79dedf54d docs: add legacy cleanup completion summary
Added comprehensive documentation of Phases 1-3:
- Phase 1: Documentation cleanup details
- Phase 2: Dead code removal summary
- Phase 3: Test suite cleanup details
- Complete statistics and verification results

This document serves as a record of the legacy code cleanup
work completed in this session.
2026-02-01 14:11:29 -05:00
john-okeefe dacbea6f85 test: add comprehensive media-item ISBN validation tests
New test file with 5 test suites:
- TestMediaItemISBNNormalization (8 test cases)
- TestMediaItemISBNEdgeCases (3 test cases)
- TestMediaItemsPagination (5 test cases)
- TestMediaItemLibraryRequirement (2 test cases)
- TestUpdateMediaItemISBN (1 test case)

Features:
- Tests use /api/media-items endpoint (not deprecated /api/ebooks)
- Real API calls (not mock handlers)
- Comprehensive ISBN-10/ISBN-13 normalization coverage
- Pagination validation with limit/offset edge cases
- Library requirement validation

This replaces the functionality lost from isbn_and_library_test.go
with modern, working tests using current API endpoints.

Phase 3: Test Suite Cleanup - Replacement Tests
2026-02-01 14:11:24 -05:00
john-okeefe 01321d1720 test: remove outdated ISBN normalization tests
- Deleted isbn_and_library_test.go (507 lines)
- All tests used deprecated /api/ebooks endpoint
- Tests were mock-based, not real API calls
- Functionality will be replaced with modern tests

This is part of legacy code cleanup Phase 3.
Phase 3: Test Suite Cleanup
2026-02-01 14:11:18 -05:00
john-okeefe 72db266e23 test: remove outdated ebook pagination tests
- Removed TestPaginationAndFiltering function
- Deleted 4 test cases using deprecated /api/ebooks endpoint
- Tests for pagination already exist in library_test.go using /api/media-items

This is part of legacy code cleanup Phase 3.
Phase 3: Test Suite Cleanup
2026-02-01 14:11:17 -05:00
john-okeefe 6bdf4bfcd4 refactor: remove deprecated ebook folder handlers and restore auth functions
Phase 2: Dead Code Removal

Removed:
- AddEbookFolder handler (deprecated)
- GetEbookFolders handler (deprecated)
- DeleteEbookFolder handler (deprecated)
- AddEbookFolderRequest struct
- DeleteEbookFolderRequest struct
- EbookFolderResponse struct

Fixed:
- Restored Register function (user registration)
- Restored Login function (user authentication)
- Restored GetProfile function
- Restored UpdateProfile function
- Restored UserProfile struct
- Restored UpdateProfileRequest struct

Note: Critical auth functions were accidentally deleted during cleanup
and have been restored to maintain application functionality.
2026-02-01 14:10:57 -05:00
john-okeefe a67fa0f142 docs: remove backward compatibility comments from ebook handler
- Removed comment about 'Ebook notes handlers (backward compatibility using views)'
- Removed comment references to non-existent GetEbookNotes and GetEbookHighlights
- Cleaned up misleading legacy documentation

This is part of legacy code cleanup Phase 1.
Phase 1: Documentation Cleanup
2026-02-01 14:09:34 -05:00
john-okeefe 19d12c3a6b docs: remove migration comments from database schema
- Removed comment about user_ebook_folders table replacement
- Removed comment about library system transition
- Historical migration documentation removed

This is part of legacy code cleanup Phase 1.
Phase 1: Documentation Cleanup
2026-02-01 14:09:33 -05:00
john-okeefe 93aa130adc docs: remove backward compatibility documentation sections
- Removed 'Ebook Compatibility (Backward Compatible)' section
- Removed 'Backward Compatibility Views' from database docs
- Removed backward compatibility bullet point from Database Schema section
- Cleaned up legacy API references from README

This is part of legacy code cleanup Phase 1.
Phase 1: Documentation Cleanup
2026-02-01 14:09:13 -05:00
john-okeefe a2b26e68c5 chore: remove obsolete implementation plan documents 2026-02-01 13:21:39 -05:00
john-okeefe d906ef3e4d docs: add testing guide and progress routes analysis documentation 2026-02-01 13:21:37 -05:00
john-okeefe e28776c7a6 test(api): add Bruno API tests for devices, media items, and progress 2026-02-01 13:21:35 -05:00
john-okeefe 351c68b0b8 test: add comprehensive test coverage for API endpoints and services 2026-02-01 13:21:34 -05:00
john-okeefe 9b1282cd08 test: remove hardcoded refresh token test from main_test.go 2026-02-01 13:21:32 -05:00
john-okeefe 3159e28b36 docs(api): add comprehensive API documentation for new features
- Analytics API endpoints (reading stats, device usage, popular books)
- Bulk operations for conflicts, books, and collections
- Book matching and auto-linking endpoints
- Unlinked book management
- OPDS on-the-fly conversion
- Request/response examples for all endpoints
- Authentication requirements and error handling
2026-02-01 12:16:25 -05:00
john-okeefe 85df19c242 docs: add phase summaries and conversion service documentation
- Phase 6: WebSocket verification and bulk operations summary
- Phase 1: Device management completion summary
- Phase 2: Quick completion summary and detailed notes
- Conversion service: Architecture and implementation details
- Document caching strategy, TTL configuration, and performance considerations
2026-02-01 12:16:22 -05:00
john-okeefe 2521a8c966 test(api): add Bruno tests for sync-kobo and OPDS features
Sync-Kobo:
- Auto link books endpoint tests
- Bulk link books endpoint tests
- Get unlinked book suggestions endpoint tests

OPDS:
- Download book with on-the-fly KEPUB conversion tests

All tests cover no user, user, and admin contexts
2026-02-01 12:16:19 -05:00
john-okeefe 2df5ca3325 test(api): add Bruno tests for analytics, books, and bulk operations
Analytics:
- Reading stats endpoint tests
- Device usage tests
- Popular books tests

Books:
- Bulk delete tests
- Bulk update tests

Collections:
- Bulk add books to collections tests

Conflicts:
- Bulk resolve conflicts tests
- Bulk dismiss conflicts tests
- Bulk resolve highest progress tests

All tests cover no user, user, and admin contexts
2026-02-01 12:16:07 -05:00
john-okeefe ef8f39bd5a feat(templates): add unlinked books management UI
- Display paginated list of unresolved unlinked books
- Show match suggestions with confidence scores
- Bulk linking interface
- Auto-link with configurable threshold
- Device and file metadata display
2026-02-01 12:16:02 -05:00
john-okeefe 9d5ee483b5 fix(templates): update conflict, progress, and queue templates
- Add bulk resolve/dismiss UI for conflicts
- Add high-progress bulk resolve shortcut
- Update progress display for new analytics data
- Update queue UI for better sync visibility
2026-02-01 12:15:57 -05:00
john-okeefe 2207bb5b9f fix(templates): update admin templates for new features
- Add collection bulk operations UI
- Add book bulk actions
- Update navigation for analytics page
2026-02-01 12:15:54 -05:00
john-okeefe c5f327b991 refactor(routes): add new bulk and analytics endpoints, clean up SSR
New endpoints:
- Analytics: /analytics, /analytics/reading-stats, /analytics/device-usage, /analytics/popular-books
- Sync bulk: /sync/bulk-link-books, /sync/auto-link-books, /sync/unlinked-books/:id/suggestions
- Collections bulk: /collections/bulk-add-books
- Books bulk: /books/bulk-delete, /books/bulk-update
- Conflicts bulk: /conflicts/bulk-resolve, /conflicts/bulk-dismiss
- OPDS: /opds/devices/:deviceId/* (catalog, search, nav, download, cover, formats)

Removed:
- Redundant SSR template routes (consolidated into handler methods)
- Manual JWT parsing in routes (use middleware)
- Legacy dashboard and bookshelf routes

Created conversion service instance for OPDS integration
2026-02-01 12:15:52 -05:00
john-okeefe 4fe8a81f66 feat(opds): add on-the-fly KEPUB conversion for downloads
- Integrate conversion service with OPDS handler
- Convert EPUB to KEPUB format on download request
- Cache converted files to reduce processing time
- Support per-device catalog with format availability
- Maintain backward compatibility with existing downloads
2026-02-01 12:15:49 -05:00
john-okeefe 82ff6356b5 feat(collections,media): add bulk operations for books and collections
Collections:
- HandleBulkAddBooks: add multiple books to multiple collections

Media:
- HandleBulkDelete: delete multiple media items
- HandleBulkUpdate: bulk update book metadata (tags, status)
- Individual result tracking for each operation
- WebSocket broadcasts for collection updates
2026-02-01 12:15:47 -05:00
john-okeefe 924254689c feat(sync): add bulk book linking and auto-linking features
- BulkLinkBooks: manually link multiple unlinked books to media items
- AutoLinkBooks: automatically link books above confidence threshold
- GetUnlinkedBookSuggestions: get match suggestions for specific unlinked book
- Support batch operations with individual result tracking
- Configurable confidence thresholds and limits
2026-02-01 12:15:44 -05:00
john-okeefe c1b3f51380 feat(conflicts): add bulk resolve and dismiss operations
- BulkResolveConflicts: resolve multiple conflicts with configurable strategies
  - most_recent: choose most recently updated source
  - highest_progress: choose source with highest reading progress
  - manual: use specified winning source
- BulkDismissConflicts: dismiss multiple resolved conflicts at once
- ResolveHighestProgress: convenience endpoint for high-progress strategy
- Return detailed results for each operation
2026-02-01 12:15:42 -05:00
john-okeefe eb97a0ef4b feat(analytics): add reading statistics dashboard
- Add reading stats endpoint with daily/monthly history
- Add device usage statistics (sync count, time spent)
- Add popular books view with completion rates
- Server-side rendered analytics page with HTMX
- Date range filtering for reading history
2026-02-01 12:15:38 -05:00