Commit Graph
25 Commits
Author SHA1 Message Date
john-okeefe 99d6c9a5d1 build: configure multi-entry Vite build for reader
- Add reader.ts as second entry point alongside main.ts in vite.config.ts
- Set assetsDir to empty string to output chunks to /static/ root
- Remove reader-shell import from main.ts (loaded separately via reader.js)
- Update .gitignore to exclude web/static/assets/*.js chunks
- Update Bruno environment with new test IDs
2026-04-04 18:17:03 -04:00
john-okeefe 7f6c6d903e test: update Bruno test data for media items
Update Bruno API test collections with latest test data:

Bookhoard.yml environment:
- Update media_item_id to current database value after recent
  database recreation/schema updates

Create Media Rating test:
- Change test rating from 8 to 7 to test different rating value
  for validation

These are test infrastructure updates only, no application code changes.
2026-03-29 00:27:28 -04:00
john-okeefe c9e085c164 feat: automate library_id extraction from Get Libraries API response
- Update library_id in Bookhoard environment configuration
- Add post-response script to Get Libraries (Admin) endpoint
- Script automatically extracts and saves first library_id from response
- Enables seamless API testing without manual variable updates
2026-03-27 21:14:31 -04:00
john-okeefe bac77312b4 test: update Bruno API collection for has_cover filter
Updated the Bruno API test collection to include tests for the new
3-state has_cover filter functionality.

Changes:
- Added test cases for has_cover=true, has_cover=false, and has_cover
  not specified to verify all three states work correctly
- Updated environment configuration to support the new filter parameter

These tests verify that the has_cover filter properly handles:
- NULL (not specified): Returns all books
- TRUE: Returns only books with cover images
- FALSE: Returns only books without cover images

This ensures the 3-state boolean implementation works correctly across
all scenarios and prevents regression of the bug where searches were
returning 0 results.
2026-03-27 18:08:18 -04:00
john-okeefe d8c63b8b8e test: update Bruno API collection with current database test values
Update test data values across Bruno API collection to reflect current
database state and improve test parameter relevance:

- Environment variables: Refresh library_id and job_id UUIDs to current
  database values for accurate testing
- Combined Search test: Update tags_filter from "scifi" to "fict" for
  broader genre coverage and extend year_max from 2000 to 2026 for
  modern title inclusivity
- Fuzzy Author Filter test: Change author_filter from "Conan" to
  "orwell" for consistent author search testing

These updates ensure API tests use valid reference data that matches
the development database state.
2026-03-26 21:01:47 -04:00
john-okeefe 6b518462f9 test: update Bruno API collection with new test data values
Update test environment and request files to use different test data:
- Update job_id variable to new test job UUID
- Change search test queries from Foundation/Asimov to 1984/Orwell
- Change series search from Foundation to Haley
- Add force parameter to scanner test

These updates provide fresh test data for API testing and
demonstrate search functionality with different media items.
2026-03-26 15:35:25 -04:00
john-okeefe 53046f5499 test: improve Bruno API collection formatting and automation
This commit improves the Bruno API collection with better formatting,
updated test environment variables, and automation scripts for easier
API testing workflow.

## Environment Updates

- bruno/environments/Bookhoard.yml: Updated test IDs for library_id
  and job_id to reflect latest test database state

## Formatting Improvements

Updated all Bruno collection files with consistent formatting:
- bruno/highlights/Create Media Highlight.yml
- bruno/highlights/Update Media Highlight.yml
- bruno/library/Add Library Folder.yml
- bruno/library/Create Library.yml
- bruno/library/Delete Library.yml
- bruno/library/Set Library Visibility.yml
- bruno/media-items/Create Media Item.yml
- bruno/media-items/Create Media Rating.yml
- bruno/media-items/Update Media Item.yml
- bruno/media-items/Update Media Rating.yml
- bruno/media-items/search/Combined Search and Filters.yml
- bruno/notes/Create Media Note.yml
- bruno/notes/Update Media Note.yml
- bruno/progress/Update Reading Progress.yml
- bruno/user/admin/Register Admin User.yml
- bruno/user/auth/Logout User.yml
- bruno/user/auth/Refresh Token.yml

Improvements include:
- Consistent YAML structure and indentation
- Proper multiline string format for JSON bodies
- Moved auth: inherit after headers for consistency
- Added descriptive comments in request bodies

## Automation Features

Added runtime scripts to Create Library.yml:
- after-response script automatically extracts and saves library_id
  from API response to environment variables
- Persists library_id for use in subsequent requests
- Reduces manual copy-paste workflow during testing

Updated request bodies with example data:
- Create Media Item.yml: Added complete example with library_id
  variable reference, title, author, file_path, file_size, mime_type
- Other files: Updated with proper JSON formatting

## Benefits

- More consistent API collection structure
- Automated workflow reduces manual steps
- Better readability with proper YAML formatting
- Example data makes requests easier to understand
2026-03-26 10:34:23 -04:00
john-okeefe 333f4ae026 chore: update test library_id in Bruno environment
- Update library_id variable in Bookhoard.yml environment
- Changed to dd03d719-76c8-4398-93ec-9258d2becf85
- Refreshes test environment with current library ID

Updates the Bruno API testing environment to use a current
library ID for testing media items and search functionality.
2026-03-25 21:13:35 -04:00
john-okeefe 74009f66b5 refactor: restructure Bruno API collection for consistency
Standardize all Bruno API request files with consistent formatting and
structure to improve maintainability and readability.

Changes include:
- Consolidate URL parameters into main URL instead of separate definitions
- Standardize quote style (double quotes throughout)
- Add proper settings section with defaults (timeout, redirects, etc.)
- Improve YAML formatting with literal style for multi-line content
- Remove redundant fields (disabled: false)
- Clean up header and body structure
- Update sequence numbers for better organization
- Add scenarios folder structure for organized test groupings

Removes obsolete Search Invalid Library ID test case.

Environment configuration updated with new library_id for testing.

These changes improve the Bruno collection's maintainability and make
it easier to create new API requests following established patterns.
2026-03-25 18:03:00 -04:00
john-okeefe d802236874 scanner: fix library isolation, file mtime, force rescan, and deletion handling
Fix 1 - File modification time for created_at:
- Get file.ModTime() in processMediaFile and pass to CreateMediaItem
- Modified SQL INSERT to include created_at column

Fix 2 - Force rescan UPDATE instead of DELETE+INSERT:
- Changed force rescan logic to call updateMediaItem instead of delete + create
- Preserves created_at timestamp on force rescan

Fix 3 - GetMediaItemByFilePath filters by library_id:
- Added library_id to WHERE clause in SQL query
- Created GetMediaItemByFilePathAnyLibrary for cross-library lookups (KOReader)
- Added SetLibraryID method to MediaScanner
- Updated handler to call SetLibraryID for watch mode

Fix 4 - File deletion handling with persistent logging:
- Added fsnotify.Remove handler in WatchChanges
- Added orphan cleanup in ScanFolders after scan completes
- Created scanner_logger.go with daily log rotation (7 days)
- Logs to /app/logs/scanner-deletes-YYYY-MM-DD.log and scanner-errors-YYYY-MM-DD.log
- Individual deletes with enhanced safety logging

Note: Integration tests can now safely scan /app/uploads because
GetMediaItemByFilePath now filters by library_id, preventing
cross-library interference.
2026-02-26 16:39:42 -05:00
john-okeefe 836f77582b chore(bruno): update environment variables for testing
Update Bruno environment configuration with current library and job IDs
to support API testing workflows.

Changes:
- Update library_id to current active library
- Update job_id to recent scan job
- Add collection_id variable for collection testing

Variables Updated:
- library_id: 551ac19c-896a-4406-b479-353fc489b295
- job_id: 450094c6-a8f1-4125-aea7-77df80223877
- collection_id: 11e8d915-ef95-4257-98b3-b8eeacfd59b9 (new)

Impact:
- Bruno requests reference current test data
- Supports testing scan functionality
- Enables collection endpoint testing
- Maintains test environment consistency

File: bruno/environments/Bookhoard.yml
2026-02-24 21:33:36 -05:00
john-okeefe f859b2714d refactor(bruno): reorganize file structure from bruno-yaml to flat bruno directory
- Move all files from bruno-yaml/* to bruno/*
- Maintains existing directory structure within categories
- Updates bruno/user/auth files with OAuth2 refresh token flow
- Updates bruno/user/profile files for user profile management
- Adds bruno/dashboard/ directory with dashboard API tests
- Preserves all existing test scenarios and OpenCollection YAML format
- No functional changes - file reorganization only
2026-02-17 20:22:21 -05:00
john-okeefe 96730d9475 docs: add Carousel dashboard implementation plan 2026-02-17 17:00:46 -05:00
john-okeefe b941776677 docs: add comprehensive device authentication implementation details
- Add IMPLEMENTATION_EXACT.md with exact code changes for all phases
- Update IMPLEMENTATION_PLAN.md with clarifications on two-field approach:
  - device_identifier: Serial number (Kobo) or UUID (KOReader)
  - auth_token: Auto-generated API key for authentication
- Resolve all user questions with  marked decisions
- Add verification steps for documentation accuracy
- Document Kobo vs KOReader registration workflow differences
- Add SQL query for token regeneration (UpdateDeviceAuthToken)
- Include TypeScript device management code
- Add Bruno API test files for all new endpoints
- Update Kobo setup documentation for URL path token approach
2026-02-12 15:36:18 -05:00
john-okeefe 2d39b44f1f docs(bruno): update API test files for media terminology
- Rename ebook_id environment variable to media_item_id
- Update scanner endpoint example paths and documentation
- Update library endpoint documentation
- Keep library type 'ebooks' where appropriate (valid type value)
2026-02-08 14:33:28 -05:00
john-okeefe ba31e1491e refactor: update Bruno API collection for media-items system
- Remove all ebook-specific API requests (15 files deleted)
- Rename Scan Ebooks.bru to Scan Media Items.bru
- Update API paths from /api/ebooks to /api/media-items
- Update base URL and environment configuration
- Maintain all existing media-items, library, auth, and progress tests

Aligns Bruno collection with unified media-items API architecture
2026-01-30 13:52:06 -05:00
john-okeefe 0276e3312c chore(bruno): update Bruno test files with minor formatting improvements 2026-01-29 11:03:14 -05:00
john-okeefe 6ed69005b5 refactor(bruno): standardize all variables to snake_case naming convention
Standardize all Bruno environment variables to use snake_case convention
(aligned with Go naming practices) and remove duplicate camelCase variants.

Changes:
- Environment file cleanup:
  - Remove: baseUrl, ebookid, fakebookid, libraryId, mediaItemId, isVisible, refreshToken
  - Standardize: fakebookid → fake_book_id, isVisible → is_visible, refreshToken → refresh_token
  - All variables now use consistent snake_case format

- Update all Bruno requests to use standardized variables:
  - ebooks: {{ebookid}} → {{ebook_id}}
  - library: {{libraryId}} → {{library_id}}
  - media-items: {{mediaItemId}} → {{media_item_id}}
  - visibility: {{isVisible}} → {{is_visible}}
  - auth: {{refreshToken}} → {{refresh_token}}

Benefits:
- Single source of truth for each variable
- Consistent with Go naming conventions
- No ambiguity about which variable name to use
- Cleaner, more maintainable codebase
2026-01-29 10:06:00 -05:00
john-okeefe 92dbfec27b fix(bruno): add missing variables to environment and remove invalid vars sections
- Add missing variables to Bookmann environment:
  - library_id (snake_case variant)
  - media_item_id (snake_case variant)
  - job_id for scan status tracking
  - baseUrl (camelCase variant for compatibility)
  - refreshToken to secret vars
- Remove invalid vars sections from request files
  - Variables should be referenced directly from environment
  - Vars sections are for request-specific overrides, not env references
- All variables now properly defined and accessible
2026-01-29 09:55:41 -05:00
john-okeefe 8db5939892 refactor: standardize Bruno API requests with bruToJsonV2 format
- Convert all JSON tests to JavaScript functions for bruToJsonV2 compatibility
- Update authentication to use 'inherit' instead of manual headers
- Fix hardcoded URLs to use {{base_url}} variables
- Standardize variable syntax from {{ _.var }} to {{var}}
- Add comprehensive API documentation to all requests
- Update environment variables with missing required fields
- Apply consistent structure: meta, http method, headers, tests, vars, settings, docs
- Enhanced validation with proper error handling and field checks
2026-01-28 20:13:56 -05:00
john-okeefe 71584c1b55 feat: Enhance admin user management system
- Add admin override capability to DELETE /api/auth/account endpoint
- Move /api/auth/users to admin-only with complete user fields (first_name, last_name, role, theme)
- Consolidate Bruno requests: remove duplicate List Users (Admin), merge Delete Account functionality
- Update all documentation to reflect enhanced capabilities
- Implement pgx 5 standards compliance with proper error handling

BREAKING CHANGES:
- /api/auth/users endpoint now requires admin role (was previously accessible)
- DELETE /api/auth/account accepts optional user_id parameter for admin deletion
2026-01-27 13:36:11 -05:00
john-okeefe 068d686fa1 added a fake ebook id to test for errors 2026-01-26 11:02:00 -05:00
john-okeefe d98a0675e1 Complete project cleanup: remove unneeded files, organize static assets, update .gitignore 2026-01-22 14:08:57 -05:00
john-okeefe 4345b7bcdd First Commit. AI Generated App. 2026-01-21 21:17:22 -05:00
john-okeefe 55c42f1f99 feat: Add comprehensive backend validation, toast notifications, and Tokyo Night theme
- Backend: Add server-side validation with go-playground/validator/v10
- Frontend: Add toast notifications for API errors with @zerodevx/svelte-toast
- UI: Complete Tokyo Night theme redesign with modern animations
- Docs: Update COMPLETE_DOCUMENTATION.md and README.md with all enhancements
- Validation: Email format, password strength, and input sanitization
- UX: Real-time error feedback, loading states, and responsive design
2026-01-21 20:01:18 -05:00