Commit Graph
401 Commits
Author SHA1 Message Date
john-okeefe d102b6f976 style: add Tailwind Typography plugin for proper markdown rendering
Installed @tailwindcss/typography plugin to fix 'wall of text' issue in documentation.
The prose classes now properly style markdown HTML elements with:
- Proper margins and spacing for headings, paragraphs, lists
- Line-height and typography improvements
- Styled code blocks, blockquotes, tables, and links

Changes:
- Add @tailwindcss/typography to devDependencies
- Configure plugin in tailwind.config.ts
- Regenerate CSS with typography styles included
2026-02-02 20:54:18 -05:00
john-okeefe 59554d37f6 fix: update docs redirect to use lowercase index.md
Changed DocsHome redirect from /docs/INDEX.md to /docs/index.md
to match the renamed file.
2026-02-02 20:30:27 -05:00
john-okeefe 4866af24de docs: rename INDEX.md to index.md and update display name
- Renamed root INDEX.md to index.md (lowercase)
- Changed navigation title from "Documentation Index" to "Index"
- Removed caps lock for cleaner appearance
2026-02-02 20:28:24 -05:00
john-okeefe 35a039d720 docs: rename INDEX files to meaningful names and fix navigation
- Renamed subdirectory INDEX.md files to section-specific names:
  - user/INDEX.md → user/user-guide.md
  - developer/INDEX.md → developer/development.md
  - operations/INDEX.md → operations/operations.md
  - contributing/INDEX.md → contributing/contributing.md
  - developer/api/INDEX.md → developer/api/api-reference.md
  - developer/api/collections/INDEX.md → developer/api/collections/collections-api.md

- Updated all internal links to use new filenames
- Updated navigation.go to skip subdirectory INDEX files from sidebar
- Added Dockerfile to include docs directory in container build

This fixes the issue where multiple 'INDEX' links appeared in the sidebar,
making navigation confusing. Now each section has a descriptive name.
2026-02-02 20:25:18 -05:00
john-okeefe c194acf379 fix: update verify script to check git tracking, not file existence
The verification script was incorrectly flagging .env files that exist locally
but are properly gitignored. Now checks if files are tracked by git using
'git ls-files' instead of just checking file existence.

This prevents false positives when .env is in .gitignore and exists locally
for development but is not committed to the repository.
2026-02-02 20:13:57 -05:00
john-okeefe d1a8a62c08 docs: update password generation to use hex encoding
Change openssl rand commands from base64 to hex encoding to avoid
special characters that break URL parsing in database connection strings.

- JWT_SECRET: openssl rand -hex 32
- DBPASS: openssl rand -hex 16

Updated in:
- .env.example
- README.md
- docs/contributing/DEVELOPMENT.md
- docs/operations/troubleshooting.md
2026-02-02 20:13:05 -05:00
john-okeefe ab72c783ba docs: strengthen warning handling to prohibit auto-fix
- Change 'Review warnings, fix if appropriate' to 'Note warnings'
- Clarify warnings are informational only
- Explicitly prohibit auto-fixing warnings
- Align with verification script instruction: DO NOT automatically fix
- Warnings require explicit user permission to address
2026-02-02 16:53:58 -05:00
john-okeefe 62b02b6ed2 docs: clarify verification script error/warning handling
- Separate error fixing (required) from warning review (informational)
- Remove ambiguous 'warnings should be reviewed' phrasing
- Align with script instruction: do not auto-fix issues
- Make clear: errors must be fixed, warnings are for acknowledgment
2026-02-02 16:52:57 -05:00
john-okeefe 3a494fe703 docs: add verification script to pre-commit checklist
- Add 'Run verification script' as first step in Before Committing
- Add verification script to Phase Completion Verification
- Ensures guideline compliance before commits
- Catches errors early in development workflow
- Verification must pass (0 errors) before declaring complete
2026-02-02 16:52:10 -05:00
john-okeefe 343f8bbebf docs: add legacy notice to monolithic API reference
- Add warning banner to api-reference.md (1,600+ lines)
- Point users to new split endpoint documentation
- Recommend API Documentation Portal for interactive explorer
- Clarify this is kept for backward compatibility
- Resolves device content warnings (appropriate as legacy reference)
2026-02-02 16:50:45 -05:00
john-okeefe a89d5c599d feat: implement Hybrid SSR for bookshelf page
- Add LibraryData type to templates/types.go
- Update bookshelf template to accept libraries parameter
- Render libraries server-side for faster initial page load
- Libraries now populated from server data instead of AJAX fetch
- JavaScript still uses API for dynamic content (bookshelf items)
- Update /bookshelf route to fetch libraries server-side before render
- Properly handle UUID and pgtype.Text conversions
- Maintain API endpoint compatibility for JavaScript calls

This improves initial page load performance while preserving
dynamic functionality via API calls.
2026-02-02 16:46:45 -05:00
john-okeefe 7c4a37175b feat: add SSR data helpers to library handler
- Add GetUserVisibleLibrariesData() method for server-side rendering
- Add GetLibraryTypeData() method for SSR type fetching
- These helpers return data directly instead of JSON responses
- Enables Hybrid SSR pattern while preserving API endpoints
- Add context import for new methods
2026-02-02 16:46:22 -05:00
john-okeefe 0ee77f35e8 chore: enhance verification script with smart checks
- Add smart device content detection based on mention thresholds
- Check for README.md files in bruno directory (error)
- Update docs structure checks to match new paths (docs/developer/api, docs/user/devices)
- Add INFO-level warnings for moderate device mentions in docs
- Exclude README.md from device content placement checks
- Improve error recovery with better variable sanitization
2026-02-02 16:46:06 -05:00
john-okeefe 155b58aef6 docs: restructure documentation and update guidelines
- Update PROJECT_GUIDELINES.md to reflect current architecture (Hybrid SSR)
- Integrate service layer and SSR rules into existing sections
- Update README.md paths to match new docs structure (docs/developer/api, docs/user/devices)
- Remove redundant README.md files from bruno/ directories
- Update bruno/collection.bru documentation to current API standard
- Fix architectural pattern description from API-driven to Hybrid SSR
2026-02-02 16:45:59 -05:00
john-okeefe 253f56399d docs: restructure documentation into audience-based portals
BREAKING CHANGE: Documentation URLs have changed

New structure:
- user/ - End-user documentation (device setup, sync guides, frontend)
- developer/ - Developer documentation (API reference, protocols, specs)
- operations/ - Operations documentation (deployment, troubleshooting)
- contributing/ - Contribution guides

Changes:
- Created portal INDEX.md files for each audience section
- Moved device guides to user/devices/ (kobo-setup.md, koreader-setup.md)
- Moved API docs to developer/ (api-reference.md, collections-api.md)
- Moved sync guide to user/sync-guide.md
- Moved troubleshooting to operations/troubleshooting.md
- Moved all split API docs to developer/api/
- Renamed protocol files (kobo-protocol.md, koreader-protocol.md)
- Added placeholder user guides (frontend, user-areas, settings, admin)
- Updated all internal links to new paths
- Updated Go code (http_handler.go, navigation.go) for new paths
- Updated main INDEX.md for audience-based navigation

Benefits:
- Clear separation of user and developer documentation
- Scalable structure for future user guide expansion
- Better organization and discoverability
- Audience-specific landing pages

Related to DOCS_IMPLEMENTATION_PLAN.md Phase 2 completion
2026-02-02 15:58:34 -05:00
john-okeefe ece90c0f1f chore: prepare for documentation restructuring - backup state 2026-02-02 15:55:00 -05:00
john-okeefe ec74650c18 docs: add collections API endpoint files (Phase 2 completion) 2026-02-02 15:54:59 -05:00
john-okeefe a3a3d4ed40 docs: Expand verification scripts README with comprehensive examples
- Add complete enhanced output examples for all error/warning types
- Document verification script architecture and design principles
- Include content detection methods and data collection strategies
- Add comprehensive usage scenarios for development, CI/CD, AI workflows
- Provide advanced troubleshooting with debugging techniques
- Include performance optimization and edge case handling
- Demonstrate integration patterns for hooks and pipelines

This creates definitive documentation for verification system that
covers all enhanced outputs, usage patterns, and integration
methods, making scripts fully understandable and actionable for
both human developers and AI assistance.
2026-02-02 14:05:49 -05:00
john-okeefe 7da4373cc1 docs: Update verification scripts README with enhanced output documentation
- Document detailed error/warning output patterns
- Show examples of enhanced information provided
- Explain specific content found for each violation type
- Include examples for both errors and warnings
- Demonstrate improved user experience with actionable details

This documents the latest enhancement where verification scripts now
provide specific file paths, line numbers, and content details
instead of generic error messages, making issues easier to understand
and resolve for both humans and AI assistance.
2026-02-02 13:49:03 -05:00
john-okeefe c78e520f22 feat: Enhance verification scripts with detailed error/warning output
Enhanced Error/Warning Details:
- API content warnings now show actual lines found
- Build failures now display error logs
- Missing files now show expected locations
- Dockerfile warnings list found files
- Large commits now show specific commit details
- Git ignore issues display current contents

verify-guidelines.sh Comprehensive Documentation Validation:
- Check 12: Content placement validation (API patterns, device setup)
- Check 13: Structure validation (required directories, file counts)
- Check 14: Bruno API tests validation (coverage comparison)
- Full integration of comprehensive documentation checks
- Maintains AI behavior protocol across all operations

User Experience Improvement:
- All errors/warnings now include specific details
- Clear guidance on what was found and why it's an issue
- Verbose output helps identify false positives vs real violations
- Enables faster issue resolution without guesswork

This addresses user request for detailed error/warning information
instead of generic messages, making verification results actionable and
understandable for both humans and AI assistance.
2026-02-02 13:40:21 -05:00
john-okeefe 65b2ebfa9b feat: Enhance verification system with AI protocol and dual-script approach
Makefile Integration:
- Add make verify-quick target for critical-only checks
- Fix verify-guidelines target to call comprehensive script
- Clear separation of usage patterns

AI Behavior Protocol:
- Add comprehensive AI instructions to both scripts
- Enhanced error/warning functions with AI reminders
- Multi-layered safeguards prevent automatic fixing
- Protocol applies to ALL file modifications

verify-quick.sh Enhancements:
- Basic documentation structure validation
- API content placement detection in README.md
- Maintains fast performance for development

Documentation:
- Comprehensive scripts/README.md with usage guidelines
- Bruno API tests validation explained
- Troubleshooting and compliance sections
- Clear AI protocol instructions and examples

This provides dual-script approach: fast critical checks during development,
comprehensive validation for pre-commit/CI, with AI safety across all operations.
2026-02-02 12:56:41 -05:00
john-okeefe 65d3525d80 feat: Add documentation completeness validation
Check 16: Documentation Completeness Validation
- Detect orphaned documentation (files without proper markdown structure)
- Check for inconsistent file naming patterns in docs/api/
- Validate markdown formatting compliance
- Ensure documentation maintains structural integrity

This final check completes the comprehensive documentation validation
suite, ensuring all documentation files follow proper formatting
and naming conventions per PROJECT_GUIDELINES.md standards.
2026-02-02 11:34:51 -05:00
john-okeefe 8d31298861 feat: Add Bruno API tests and recent changes validation
Check 14: Bruno API Tests Validation
- Count and verify Bruno .bru test files presence
- Compare API documentation vs Bruno test coverage
- Flag insufficient test coverage for human review

Check 15: Recent Documentation Changes Analysis
- Analyze recent commits for documentation compliance
- Flag code commits without corresponding documentation updates
- Verify proper commit message format (docs: prefix)
- Ensure documentation stays synchronized with code changes

These checks provide comprehensive validation of API testing coverage
and ensure documentation follows proper git commit conventions
per PROJECT_GUIDELINES.md requirements.
2026-02-02 11:32:21 -05:00
john-okeefe 5deef46ef5 feat: Add high-recall documentation content and structure validation
Check 12: Documentation Content Placement
- Detect API patterns in README.md when docs/api/ exists
- Flag device setup content outside docs/devices/
- Identify development content outside docs/contributing/
- Monitor README.md length (>300 lines triggers warning)

Check 13: Documentation Structure Validation
- Verify required directories exist (docs/api, docs/devices, docs/contributing)
- Count and report API documentation files
- Validate device setup guides presence

These checks implement high-recall pattern detection to catch potential
documentation guideline violations for human review, ensuring content is
properly routed according to PROJECT_GUIDELINES.md decision table.
2026-02-02 11:30:55 -05:00
john-okeefe 3af4f3ea91 feat: Add AI behavior protocol to verification script
- Add comprehensive AI instructions at script start and end
- Enhance error/warning functions with AI reminders
- Multi-layered safeguards prevent automatic fixing
- Clear protocol: explain -> propose -> ask permission -> await response
- Instructions apply to ALL file modifications, not just verification issues

These safeguards ensure AI always asks permission before fixing any issues
found by the verification script, preventing automatic corrections of
potential false positives.
2026-02-02 11:30:00 -05:00
john-okeefe a3709dc38a docs: Update PROJECT_GUIDELINES documentation section
Update Documentation section to reflect new docs/ structure:
- Add comprehensive documentation location table
- Clarify when to use docs/ vs README.md
- Include workflow for documentation updates
- Update all checklist sections with documentation guidance

Changes:
- README.md: Setup/onboarding only
- docs/: User-facing features and workflows
- docs/api/: API reference and endpoints
- docs/devices/: Device setup guides
- docs/contributing/: Development documentation

Ensures documentation is properly organized and searchable
via the new docs system with Lunr.js search.
2026-02-02 10:38:00 -05:00
john-okeefe 3babfe520f Regenerate template Go files after CSS-to-Tailwind conversion
Regenerate all _templ.go files using templ generate after
removing custom <style> tags and converting to TailwindCSS.
Line numbers updated in error messages due to template changes.
2026-02-02 10:35:56 -05:00
john-okeefe fa8b0fb43b Remove custom CSS from queue template
Remove <style> tags with status and priority badge classes.
Move badge styles to input.css as component utilities for
TailwindCSS compliance.
2026-02-02 10:28:01 -05:00
john-okeefe 656261af4f Remove custom CSS from auth templates
Remove <style> tags from index, login, and register templates.
All theme CSS variables now come from centralized input.css,
eliminating duplicate theme definitions across templates.
2026-02-02 10:27:59 -05:00
john-okeefe d0c180446c Remove custom CSS from docs template
Remove <style> tags with sidebar transitions, scrollbars, and mobile
responsive styles from docs template. Convert to TailwindCSS utility
classes for transitions and transforms.
2026-02-02 10:27:56 -05:00
john-okeefe fa16a3d78a Remove custom CSS from main user templates
Remove <style> tags from analytics, bookshelf, conflicts, and dashboard
templates. Convert custom CSS classes (.stat-card, .shelf, .book-item,
.conflict-card, etc.) to TailwindCSS utility classes. Rely on
centralized theme CSS variables in input.css.
2026-02-02 10:27:53 -05:00
john-okeefe 605beb31e5 Remove custom CSS from admin templates
Remove <style> tags from admin templates (admin, admin_library,
admin_profile) and rely on centralized theme CSS in input.css.
Converts inline styles to use CSS variables and TailwindCSS classes.
2026-02-02 10:27:39 -05:00
john-okeefe 1af9b1e77a Add centralized theme CSS variables to input.css
Move theme CSS custom properties from individual templates to
centralized location in web/static/input.css using Tailwind @layer
directives for better maintainability and to eliminate duplicate
code across templates.
2026-02-02 10:27:35 -05:00
john-okeefe 6d6640e23b docs: clarify OOP guideline - applies to TypeScript, not Go
Updated PROJECT_GUIDELINES.md and verification script to clarify:

1. OOP restriction applies to FRONTEND (TypeScript) only
2. Go methods are fine and encouraged
3. Avoid classes, inheritance, and OOP bloat in TypeScript

Changed verification script:
- Removed Go struct methods check (was incorrect)
- Added TypeScript class declaration check instead
- Now checks for 'class ' keyword in web/*.ts files

This clarifies the guideline was never about Go backend code,
only about avoiding OOP patterns in TypeScript frontend code.

Verification now shows: 13/13 checks passing, 0 warnings
Only 1 error remains: 12 legacy templates with custom CSS.
2026-02-02 10:12:41 -05:00
john-okeefe 0a6ef46927 docs: reorganize verification script to match PROJECT_GUIDELINES.md order
Updated verify-quick.sh to follow PROJECT_GUIDELINES.md structure:
- Added comments for each check showing which guideline it verifies
- Reordered checks to match guideline document order
- Expanded from 5 checks to 13 comprehensive checks

New checks added:
- Backend & Database: migration files, pgx v5 driver version
- Frontend & Styling: OOP pattern detection, TailwindCSS usage
- General: git history for secrets, Dockerfile proliferation
- Build & Deployment: code compilation (post-edit verification)
- Configuration: .env.example, .gitignore validation
- Code Modification Safety: commit quality check (no large commits)

Updated scripts/README.md to document all 13 checks with their
corresponding guidelines.

Current status: 12/13 checks passing
- Only 1 error: 12 legacy templates with custom CSS (need Tailwind conversion)
- 1 warning: some Go files have >10 methods (potential OOP, needs manual review)
2026-02-02 10:08:31 -05:00
john-okeefe 12c6b41577 fix: exclude web/static/ from JS/CSS checks (compiled output)
Exclude web/static/ from verification checks:
- These are TypeScript compiled output files
- Already in .gitignore (web/static/*.js)
- Similar to node_modules/ - build artifacts, not source

Updated verify-quick.sh to exclude:
- web/static/*.js (TypeScript → JS compilation)
- web/static/*.css (TailwindCSS → CSS compilation)

Also removed ./bookhoard binary from repository.

Verification now shows only 1 error: 12 legacy templates with custom CSS.
Docs templates already comply (converted in Phase 4).
2026-02-02 10:00:26 -05:00
john-okeefe e0b95ba297 Add project guidelines verification script
Created comprehensive verification script to check codebase against PROJECT_GUIDELINES.md

Features:
- Checks for custom CSS (TailwindCSS requirement)
- Detects JavaScript files that should be TypeScript
- Verifies no secrets committed (.env, credentials.json)
- Validates code compiles (go build)
- Finds local binaries (should use container builds)
- Quick checks with clear pass/fail/warning output

Usage:
  make verify-guidelines
  ./scripts/verify-quick.sh

Current codebase status:
  - 12 templates with custom CSS (need Tailwind conversion)
  - 2 .js files in web/static/ (need TypeScript conversion)
  - 1 binary file (./bookhoard)

This addresses the trust issue: AI now has a tool to prove guideline compliance
2026-02-02 09:55:39 -05:00
john-okeefe 2726455578 refactor: convert docs templates to use TailwindCSS
Phase 4+5: Replace custom CSS with Tailwind utility classes
- Remove ~250 lines of custom CSS from docs.templ
- Remove ~120 lines of custom CSS from api_explorer.templ
- Use Tailwind CDN for styling
- Keep only essential CSS:
  * CSS variables for theming (--bg-primary, --accent, etc.)
  * Custom scrollbar styling
  * Mobile sidebar transform transitions
  * Smooth scroll behavior
- All layout, spacing, colors, typography now use Tailwind classes
- Mobile-first responsive design with Tailwind breakpoints
- Proper accessibility with aria-labels and semantic HTML

Benefits:
- Consistent design system
- Smaller custom CSS footprint
- Better maintainability
- Follows PROJECT_GUIDELINES.md requirement: TailwindCSS primary
2026-02-02 09:35:37 -05:00
john-okeefe 542fbaf116 docs: add Lunr.js search with fuzzy matching and highlighting
Phase 4 part 1: Add search infrastructure
- Add SearchDoc struct and GenerateSearchIndex to docs handler
- Add stripHTML helper for plain text extraction
- Add ServeSearchIndex endpoint to http handler
- Add /docs/search-index.json route in main.go
- Search index includes all documentation files with ID, title, content, URL
2026-02-02 09:08:37 -05:00
john-okeefe 3b3630666a docs: integrate API explorer into documentation pages
Phase 3 complete: Add API explorer to endpoint documentation
- Add DocsLayoutWithExplorer template function
- Update HTTPHandler.ShowAPIEndpoint to check authentication
- Add GetAPIEndpointData method to docs handler
- Include API explorer for all endpoint documentation
- Explorer shows mock data to non-authenticated users
- Explorer enables real API execution for logged-in users
- Add legacy fallback for endpoints without explorer data
2026-02-02 08:58:12 -05:00
john-okeefe afdcc7b589 docs: add API explorer template component and fix rendering
Phase 3 part 1: Add interactive API explorer
- Create templates/api_explorer.templ with mock and real modes
- Add EndpointInfo and APIExplorerData types to templates/types.go
- Fix markdown rendering with UnsafeHTML.ToComponent()
- Add templ import for Component support
- API explorer supports:
  - Mock data mode for non-authenticated users
  - Real execution mode for logged-in users
  - Request/response display
  - cURL generation
  - Copy to clipboard
2026-02-02 08:56:23 -05:00
john-okeefe 3e81477341 docs: add sync protocols and WebSocket API documentation
Phase 2 part 7: Add real-time sync protocol documentation
- KOReader Protocol: progress sync, metadata fetch
- Kobo Protocol: markup sync, library fetch
- WebSocket: real-time events (progress updates, conflicts)
- Include message format examples for all protocols
2026-02-02 08:52:13 -05:00
john-okeefe 55024bb70a docs: add book-matching, collections, and OPDS API endpoints
Phase 2 part 6: Split advanced features endpoints
- Book Matching: search_books, link_book (manual and auto-link)
- Collections: INDEX.md linking to COLLECTIONS_API.md
- OPDS: feeds, acquisition, publication (OPDS 1.2 protocol)
- Include format conversion details (EPUB to KEPUB)
2026-02-02 08:51:56 -05:00
john-okeefe efa046d030 docs: add ratings, devices, and analytics API endpoints
Phase 2 part 5: Split device management and analytics endpoints
- Ratings: get_ratings, create_rating (1-10 scale with half-stars)
- Devices: register_device, list_devices, get_devices, revoke_device
- Analytics: get_analytics (reading statistics)
- Include device registration flow details
2026-02-02 08:51:53 -05:00
john-okeefe 284486f0a0 docs: add progress, notes, and highlights API endpoints
Phase 2 part 4: Split reading progress and annotation endpoints
- Progress: get_progress, update_progress, delete_progress
- Notes: get_notes, create_note, update_note, delete_note
- Highlights: get_highlights, create_highlight, update_highlight, delete_highlight
- All endpoints support EPUB CFI and percentage locations
2026-02-02 08:51:48 -05:00
john-okeefe 4b06983784 docs: add library and media items API endpoints
Phase 2 part 3: Split library and media item endpoints
- Libraries: get_visible_libraries, get_library, create_library, add_library_folder, set_library_visibility
- Media Items: list_media_items, get_media_item, search_media_items, filter_sort_media_items, update_media_item, delete_media_item
- Complete request/response examples for all endpoints
2026-02-02 08:51:43 -05:00
john-okeefe 52eb75cef7 docs: add authentication and user management API endpoints
Phase 2 part 2: Split auth and user endpoints
- Authentication: register, login, refresh_token, logout
- Users: get_profile, update_profile, update_theme, change_password
- Each endpoint in separate markdown file
- Include request/response examples and error codes
2026-02-02 08:51:40 -05:00
john-okeefe 67bd90feec docs: create API documentation index and structure
Phase 2 part 1: Add API documentation landing page
- Create docs/api/INDEX.md with quick links
- Organize by category (auth, users, libraries, media items, etc.)
- Provide navigation to all API endpoint documentation
- Link to COLLECTIONS_API.md for collections details
2026-02-02 08:51:37 -05:00
john-okeefe 254085cad9 docs: fix markdown rendering with @rawHTML directive
Phase 1 complete: Fix rawHTML function in template
- Change { doc.Content } to @rawHTML(doc.Content)
- Ensures markdown converts to HTML properly
- Fixes headings, lists, code blocks formatting
2026-02-02 08:51:33 -05:00
john-okeefe f5b61d2aea Remove book files from uploads directory
- Remove all EPUB, PDF, and cover image files
- Keep metadata.opf files for reference
- Clean up uploads directory to reduce repository size
2026-02-02 08:14:01 -05:00