Commit Graph
100 Commits
Author SHA1 Message Date
john-okeefe 311361a2ed feat(security): add password complexity validator
- Implement strict password requirements:
  - Minimum 8 characters
  - At least one uppercase letter
  - At least one lowercase letter
  - At least one number
  - At least one special character
- Add custom validator for Echo integration
- Add GetPasswordRequirements helper function
- Add ValidatePassword function for manual validation
2026-01-29 09:23:34 -05:00
john-okeefe db18aa5e5e docs: update README with new security features
Document new security and validation features:
- Rate limiting on auth endpoints
- Improved input validation
- Pagination limits
- Path validation
- Role normalization

Updates reflect the security improvements made to the application
2026-01-29 09:23:34 -05:00
john-okeefe 11ea4588d1 test: add comprehensive test suite covering all failure points
Added 157+ tests across 8 test files:
- registration_test.go: 19 registration and 10 login scenarios
- ebook_test.go: 40 ebook and media management tests
- user_test.go: 35 user profile and account management tests
- library_test_comprehensive.go: 25 library management tests
- edge_cases_test.go: 30+ security and edge case tests
- new_fixes_test.go: tests for new security fixes
- test_helpers.go: shared test utilities

Test Coverage:
- Authentication & authorization
- Input validation (email, username, password)
- Role-based access control
- Pagination and filtering
- Error handling and edge cases
- Security scenarios (SQL injection, XSS)

Documentation:
- TEST_COVERAGE.md: detailed test documentation
- ANALYSIS.md: comprehensive analysis of issues found

All tests pass successfully
2026-01-29 09:23:34 -05:00
john-okeefe 1b5c70be71 fix: validate library folder paths before saving
- Add os package import for file system checks
- Validate that folder paths exist before adding to library
- Check folder accessibility to prevent invalid paths
- Return clear error messages for invalid folders

Improves user experience by catching path errors early
2026-01-29 09:23:33 -05:00
john-okeefe 7f8b898105 fix: add pagination limits and validation
- Enforce maximum pagination limit of 1000 items per request
- Prevent negative offset values in pagination
- Apply limits to both /api/ebooks and /api/media-items endpoints
- Protect against DoS attacks from large limit values

Fixes security issue: No maximum pagination limit
2026-01-29 09:23:33 -05:00
john-okeefe 124b5748c9 fix: improve authentication validation and security
- Trim whitespace from usernames and validate non-empty
- Normalize role values to lowercase for case-insensitive comparison
- Prevent registration with whitespace-only usernames
- Maintain backward compatibility with existing functionality

Fixes validation gap: Username whitespace handling
2026-01-29 09:23:33 -05:00
john-okeefe 7db8bde4bb feat: add rate limiting to authentication endpoints
- Add rate limiter middleware (10 requests/minute per IP)
- Apply rate limiting to POST /api/auth/register and /api/auth/login
- Prevents brute force attacks and registration spam
- Automatic cleanup of old request records

Closes security issue: No rate limiting on auth endpoints
2026-01-29 09:23:33 -05:00
john-okeefe d3b728c458 fix: resolve registration database connection error
- Fix database authentication error by exposing actual database error messages
- Update error handling to follow pgx v5 standards with detailed error reporting
- Restore token environment variable management in Register User.bru for subsequent requests
- Enable proper debugging of database connection issues during user registration

The registration API now provides detailed error messages instead of generic 'failed to check existing users'
when database connection or authentication fails, making debugging easier.
2026-01-28 20:57:15 -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 935b867219 feat: add highlights and notes annotation system
This major update implements a complete user annotation system:

## 🎯 New Features
- User notes with position tracking for media items
- Text highlighting with customizable colors
- Highlight-note associations for detailed annotations
- Full CRUD API for both notes and highlights
- Backward compatibility with existing ebook endpoints

## 📊 Database Changes
- Add media_notes table (id, media_item_id, user_id, content, position, timestamps)
- Add media_highlights table (id, media_item_id, user_id, selection_text, start/end_position, color, optional note_id)
- Add foreign key relationships with CASCADE deletes
- Add proper indexes for performance
- Add database schema views for ebook backward compatibility

## 🔧 API Implementation
- Complete REST API endpoints for notes and highlights
- JWT authentication with proper middleware bypass
- Request validation with meaningful error responses
- UUID validation and type safety
- Support for hex color codes in highlights

## 🧪 Testing & Documentation
- Comprehensive test suite covering authentication scenarios
- Bruno API collection for manual testing
- Detailed testing guide with troubleshooting
- Updated documentation in README and TESTING.md

## 📁 Backward Compatibility
- Existing ebook endpoints continue working
- Database views maintain API contracts
- No breaking changes for existing integrations

The annotation system is now fully functional and ready for production use.
2026-01-28 17:12:40 -05:00
john-okeefe c76f745df7 docs: add comprehensive Go testing guide
- Add detailed testing instructions in TESTING.md
- Include quick start commands for all test scenarios
- Document new notes and highlights test coverage
- Add coverage analysis and reporting commands
- Include troubleshooting guide for common issues
- Add test flag reference and workflow recommendations
- Document test categories and what they verify
2026-01-28 16:14:26 -05:00
john-okeefe 14099d8d08 fix: resolve test compilation and logic errors
- Fix undefined variable 'resp' errors in library_test.go (should be 'req')
- Fix authentication test expectations to match unauthorized response
- Fix TestUserVisibleLibraries to properly simulate user visibility filtering
- Remove hidden library from mock user response to test visibility correctly
- All tests now pass successfully
2026-01-28 16:13:50 -05:00
john-okeefe 8f11219e03 chore: cleanup temporary files and update gitignore
- Remove temporary DOCUMENTATION_UPDATES.md after merging content
- Remove obsolete internal/database/connection.go file
- Update .gitignore to exclude build artifacts
- Clean up generated files and temporary directories
2026-01-28 15:45:10 -05:00
john-okeefe 9d59986bde deps: update Go modules for new functionality
- Add testify/assert and testify/require for testing
- Update module dependencies after adding annotation features
- Ensure proper pgx v5 compatibility with new database operations
2026-01-28 15:44:15 -05:00
john-okeefe ea2e24d0de docs: update README for notes and highlights functionality
- Add notes and highlights to Media Management features section
- Document complete API endpoints for annotations (CRUD operations)
- Update database schema documentation with new tables
- Add backward compatibility endpoints for existing ebook API
- Update Bruno collection structure to show new test directories
- Document highlight-note association and color customization features
- Remove temporary DOCUMENTATION_UPDATES.md after merging content
2026-01-28 15:43:48 -05:00
john-okeefe 0a457e02a2 test: add comprehensive tests for notes and highlights
- Add complete test suite for media notes API with validation
- Add complete test suite for media highlights API with color validation
- Add backward compatibility tests for ebook endpoints
- Test authentication scenarios (unauthorized access)
- Test request validation and error handling
- Fix existing test import issues and syntax errors
- Add test cases for highlight-note associations
2026-01-28 15:43:30 -05:00
john-okeefe 78851a940a feat: add comprehensive Bruno API tests for annotations
- Add complete Bruno collection for notes API (5 endpoints)
- Add complete Bruno collection for highlights API (5 endpoints)
- Include detailed request/response documentation
- Add proper validation examples and error cases
- Support both media-items and ebook endpoint testing
- Add environment variable support for dynamic IDs
2026-01-28 15:43:05 -05:00
john-okeefe ee4c4faff7 feat: implement notes and highlights API endpoints
- Add complete CRUD API for media items notes (/api/media-items/:id/notes/*)
- Add complete CRUD API for media highlights (/api/media-items/:id/highlights/*)
- Add backward compatibility endpoints for ebooks (/api/ebooks/:id/notes/*, /api/ebooks/:id/highlights/*)
- Implement proper validation for request payloads and UUIDs
- Support hex color codes for highlights with default yellow (#ffff00)
- Support position tracking (page:offset or CFI formats)
- Support optional note association with highlights
2026-01-28 15:42:52 -05:00
john-okeefe 29669e2fa3 feat: add database models and queries for annotations
- Add MediaNotes and MediaHighlights model structs with pgx v5 types
- Add EbookNotes and EbookHighlights for backward compatibility
- Add complete CRUD SQL queries for notes and highlights
- Add database connection pool function using pgx v5
- Generate sqlc code for new annotation functionality
2026-01-28 15:42:34 -05:00
john-okeefe 168c6b2302 feat: add media_notes and media_highlights tables
- Add media_notes table for user annotations with position tracking
- Add media_highlights table for text highlighting with color customization
- Add optional note_id foreign key for highlight-note associations
- Add backward compatibility views (ebook_notes, ebook_highlights)
- Add proper indexes for performance optimization
- Update schema comments to document new annotation features
2026-01-28 15:41:40 -05:00
john-okeefe 482a3bdc86 feat: create comprehensive test suite for library system
- Add authentication middleware tests for JWT validation
- Create library management tests for CRUD operations
- Add user visibility control tests
- Add JSON validation and error handling tests
- Add security testing for authorization bypasses
- Include tests for both success and failure scenarios
- Use httptest for isolated API testing
- Follow Go testing best practices
- Add comprehensive testing documentation

Tests verify multi-library system security and functionality before deployment.

Note: Database querier interface issues exist due to old user ebook folder references
in generated code and need resolution for full test suite operation.
2026-01-28 14:46:32 -05:00
john-okeefe 6d7e271fb5 test: add comprehensive test suite for library system
- Add authentication middleware tests for JWT validation
- Add library creation tests for admin authorization
- Add library visibility control tests
- Add user management and error handling tests
- Add JSON validation and security tests
- Add tests for both success and failure scenarios
- Test edge cases like missing tokens, invalid data, unauthorized access
- Use httptest for isolated API testing without needing running server
- Include comprehensive test coverage for security and functionality

Tests verify application security and multi-library system works correctly before deployment.
2026-01-28 12:50:42 -05:00
john-okeefe 3f7fae383c --no-verify 2026-01-28 12:23:10 -05:00
john-okeefe 6a6582507f docs: update README for complete library system
- Document new multi-library architecture (ebooks, comics, manga)
- Detail per-library folder management and visibility controls
- Include comprehensive API documentation with Bruno examples
- Add pgx v5 compliance and security best practices
- Update deployment and development instructions
- Document JWT authentication and role-based access control
- Include future roadmap for audiobooks, video, podcasts, etc.

Provides complete overview of transformed system for users and developers
2026-01-28 11:43:44 -05:00
john-okeefe 87e1625564 fix: properly implement JWT user object in middleware
- Update JWT middleware to set complete user object in context
- Parse UUID correctly and convert to pgtype.UUID format
- Add missing imports for uuid and pgx/v5/pgtype
- Fix type conversion from UUID string to byte array
- Ensure compatibility with database.Users struct

Resolves authentication issues for library and user endpoints
2026-01-28 11:34:04 -05:00
john-okeefe 57e545cbcb fix: correct SQL syntax for ebook rating creation
- Fix VALUES clause in CreateEbookRating query
- Remove invalid SELECT that caused SQL syntax error
- Use proper INSERT VALUES (, , ) syntax for pgx v5
- Ensure compatibility with existing code generation

Resolves database syntax error while maintaining backward compatibility
2026-01-28 11:28:20 -05:00
john-okeefe 81fa177fe6 feat: create Bruno requests for library system API
- Add library management requests (CRUD operations)
- Create media items API requests for library content
- Implement library visibility controls
- Add user library access management
- Update deprecated ebook folder endpoints with migration guide
- Include comprehensive documentation and test cases
- Replace collection.bru with proper dashboard request

Complete Bruno collection supporting new multi-library architecture
2026-01-28 11:15:36 -05:00
john-okeefe 84d846ae6c chore: deprecate user ebook folders endpoints
- Replace with 410 Gone responses directing to libraries
- Maintain API contract for backward compatibility
- Remove old user folder management functionality
- Prepare for complete library system migration

Old folder management now handled through library system
2026-01-28 11:04:18 -05:00
john-okeefe 6d3db17cf5 feat: update frontend for library system
- Redesign dashboard to show library selection first
- Add media browsing within selected library
- Implement library management interface
- Add user visibility controls for libraries
- Support library type icons and metadata
- Add create library modal with type selection
- Include folder management for each library
- Implement user-specific library access controls

Replaces single ebook library with flexible multi-library system
2026-01-28 11:03:17 -05:00
john-okeefe e29054f841 feat: integrate library system with routing and handlers
- Add library routes to main router configuration
- Implement media items API endpoints for library content
- Update existing ebook handlers to use new schema
- Add media rating and progress tracking
- Maintain backward compatibility with existing endpoints
- Support library-specific media item queries

Updates application to support new multi-library architecture
2026-01-28 11:02:51 -05:00
john-okeefe 87c0e309a3 feat: add library management API endpoints
- Add LibraryHandler with full CRUD operations
- Implement library creation with type validation
- Add library folder management endpoints
- Implement library visibility control system
- Add user library access management
- Include library statistics endpoint
- Support for admin and user-level operations

Provides modular foundation for multi-library system
2026-01-28 11:00:40 -05:00
john-okeefe dbc3590cad feat: implement library system database schema
- Add library_types table with ebooks, comics, manga types
- Add libraries table for multiple library support
- Add library_folders table for multi-folder libraries
- Add library_visibility table for user access control
- Add media_items table replacing ebooks for broader media support
- Create backward compatibility views for existing API
- Implement library service with type validation and file extension handling
- Support modular extension for future media types

Manga type includes cbz/cbr archives as requested
2026-01-28 11:00:06 -05:00
john-okeefe 6f74216a02 Remove empty sqlc.yaml from root directory 2026-01-28 08:36:23 -05:00
john-okeefe ffbf9d8717 fixed formatting so it would show in bruno 2026-01-27 20:43:19 -05:00
john-okeefe 49ee68e905 chore: Clean up and reorganize Bruno collection after rebuild
- Remove duplicate Get Admin Dashboard.bru (same as /admin route)
- Reorder sequence numbers for logical grouping
- Add missing body: none to GET requests
- Standardize folder path examples to /app/uploads
- Fix file formatting and add missing newlines
2026-01-27 16:50:49 -05:00
john-okeefe cf51644f44 fix: Remove unsupported check constraint from user_ebook_folders table
- Remove complex CHECK constraint with subquery that PostgreSQL doesn't support
- Add comment explaining admin-only access is enforced at application level
- Update role system notes to clarify access control implementation
- Fix Bruno request failures due to missing database table
2026-01-27 16:36:04 -05:00
john-okeefe ad64c044a7 fix: Remove hardcoded example from Scan Ebooks Bruno request
- Remove hardcoded folder_paths example from request body
- Allow flexible folder path configuration per request
- Improve request flexibility for different scan scenarios
2026-01-27 16:25:01 -05:00
john-okeefe 23ead6cf0c feat: Add admin ebook CRUD operations to Bruno collection
- Add POST /api/ebooks for creating new ebook entries
- Add PUT /api/ebooks/:id for updating existing ebook metadata
- Add DELETE /api/ebooks/:id for deleting ebooks from database
- Include complete request/response examples with all metadata fields
- Support file path, metadata, and publication information updates
2026-01-27 16:23:50 -05:00
john-okeefe 4a71376ed5 feat: Add admin ebook folder management routes to Bruno collection
- Add POST /api/auth/ebook-folders for adding ebook folders
- Add GET /api/auth/ebook-folders for retrieving configured folders
- Add DELETE /api/auth/ebook-folders for removing ebook folders
- Include comprehensive documentation and request examples
- Support path normalization and admin-only access
2026-01-27 16:23:42 -05:00
john-okeefe 7116af9a77 feat: Implement precise user registration restrictions
- Implement numbered requirements for user account creation:
  1. No users exist: First user becomes admin
  2. Admins exist: Anyone can register as regular user
  3. Admin logged in: Can create admins and regular users
  4. User logged in: Cannot create any accounts

- Update registration logic in auth.go to validate roles based on existing admin accounts and authentication status
- Add comprehensive error handling for unauthorized user creation attempts
- Ensure security while maintaining usability for regular users

BREAKING CHANGES:
- User accounts creation now restricted based on authentication state
- Regular users cannot create accounts when logged in
- Admin privileges enforced for user management operations
2026-01-27 15:57:52 -05:00
john-okeefe cfa2da8037 docs: Add API testing section to README
- Document Bruno API testing collection with organized structure
- Include comprehensive setup and usage instructions
- Add reference to role-based registration restrictions
- Explain admin-only endpoints and authentication requirements
2026-01-27 14:28:26 -05:00
john-okeefe 6f06da42a2 docs: Update README with enhanced API documentation and Bruno collection
- Add comprehensive Bruno API testing collection section with organized structure
- Document new role-based registration restrictions for admin user creation
- Update API endpoint documentation to reflect admin-only access for user management
- Clarify admin override capabilities for account deletion
- Enhance API authentication and authorization details throughout documentation
2026-01-27 14:27:17 -05:00
john-okeefe 481adaa71e feat: Implement role-based registration restrictions and reorganize Bruno collection
- Add role-based restrictions to POST /api/auth/register endpoint
- Only admins can create admin accounts if any admin already exists
- First user automatically gets admin role regardless of request
- Regular users can only create user accounts, not admin accounts
- Unauthenticated users can only create first admin, not subsequent admins
- Reorganize Bruno collection into logical subfolders (auth/, admin/, profile/)
- Update documentation to reflect new registration restrictions and security rules

BREAKING CHANGES:
- /api/auth/register now enforces role-based creation restrictions
- Bruno collection reorganized with subfolder structure
2026-01-27 14:15:06 -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 9262a35f68 feat: Restore manual scanner requests for testing
- Recreate Scan Ebooks request with optional folder_paths parameter
- Recreate Start Scanner request for real-time monitoring
- Recreate Stop Scanner request for monitoring control
- All scanner requests remain admin-only as intended
- Essential for testing ebook discovery and scanning functionality
2026-01-26 21:21:43 -05:00
john-okeefe cdee6a1aef fix: Update database configuration for proper container naming
- Fix database name reference in docker-compose.yml
- Update config.go to use consistent database name
- Ensure database connection string matches container setup
2026-01-26 21:19:34 -05:00
john-okeefe d4feea15c5 docs: Update README with admin system and role management
- Document first-user automatic admin assignment
- Update admin setup instructions with correct database name
- Add last-user protection documentation
- Update API endpoints with role field and protection notes
- Document Bruno collection reorganization and admin folder
- Clarify authentication flow and role-based access
- Update role permissions section with new protections
2026-01-26 21:19:29 -05:00
john-okeefe f2994f9147 refactor: Reorganize Bruno requests by role permissions
- Create separate admin folder for admin-only operations
- Move admin endpoints (Create/Update/Delete Ebook, Scanner, Folder Management) to /bruno/admin/
- Add admin dashboard, profile, and library page requests
- Add Register Admin User request with explicit admin role
- Update Register User request to include role field
- Remove empty scanner folder structure

API organization:
- Admin requests: /bruno/admin/ (require admin role)
- User requests: /bruno/user/ (available to all authenticated users)
- Environment: Single {{token}} variable works for both roles
2026-01-26 21:19:19 -05:00
john-okeefe 997a7318f8 feat: Implement first-user admin and last-user protection
- First registered user automatically becomes admin regardless of request
- Prevent deletion of the last user account to protect system
- Enhanced role validation and HTMX error handling
- Proper pgx 5 database standards throughout

Security improvements:
- Auto-admin for first user ensures system always has administrator
- Last-user protection prevents system from having zero users
- Role validation ensures only 'user' or 'admin' roles accepted
2026-01-26 21:18:08 -05:00
john-okeefe 5ca2e6a732 feat: Add role parameter to user creation and SQL queries
- Update CreateUser SQL query to accept role parameter
- Regenerate SQLC code to include Role field in CreateUserParams
- Support for explicit role assignment during user registration
2026-01-26 21:17:38 -05:00
john-okeefe 48b6796bcd docs: Update documentation for role-based access control
- Update README.md with admin system documentation
- Add admin setup instructions and role permissions
- Update API endpoint documentation with access requirements
- Update Bruno collection to reflect admin-only operations
- Document shared library concept and security model
- Add comprehensive admin setup guide
2026-01-26 16:56:35 -05:00
john-okeefe f8eaca1b08 feat: Add role-based frontend controls
- Update User type to include role field
- Modify dashboard template to conditionally show admin links
- Add protected dashboard route with user context
- Update main.go to serve dashboard with proper authentication
2026-01-26 16:56:22 -05:00
john-okeefe 734bad4697 feat: Add admin-only protection to ebook operations
- Update ebook handlers to require admin role for CRUD operations
- Modify folder operations to be admin-only
- Update ebook scanner to associate books with admin who added them
- Add admin ID tracking to CreateEbook operations
- Restrict scanner operations to admin users only
2026-01-26 16:55:42 -05:00
john-okeefe f5bfac996d feat: Implement role-based authentication and authorization
- Add AdminMiddleware for protecting sensitive operations
- Update JWT generation to include user role and details
- Modify login/registration to use enhanced JWT claims
- Update main.go to set admin-protected routes
- Add user role to JWT context for downstream handlers
2026-01-26 16:55:32 -05:00
john-okeefe 0b126202c8 feat: Add role-based access control to database schema
- Add role column to users table with admin/user constraint
- Add added_by_admin_id column to ebooks table for tracking
- Add constraint to ensure only admins can manage folders
- Update all SQL queries to include role field
- Regenerate database models with new schema
2026-01-26 16:54:57 -05:00
john-okeefe 86fa337c2c refactor: Consolidate database schema for first release
- Replace migration files with single schema.sql
- Include all current functionality in one file
- Add 10-point rating scale with half-star precision
- Remove old migration complexity for development
- Maintain all table constraints and indexes
- Add proper comments for rating system
- Prepare clean schema for first release deployment
2026-01-26 13:52:18 -05:00
john-okeefe 1140c4215e feat: Implement advanced rating system with half-star precision
- Add 5-star display with half-star support
- Implement dialog-based rating input with 0.5 increments
- Add rating conversion functions (10-point ↔ 5-point)
- Update visual styling for half-star display
- Maintain default 0 rating and "Not rated" state
- Add proper error handling and user feedback
2026-01-26 13:51:50 -05:00
john-okeefe e4d53e0d0a feat: Update backend validation for 10-point rating scale
- Change rating validation from 1-5 to 1-10
- Enable half-star precision support in backend
- Maintain compatibility with frontend conversion logic
- Support odd numbers for half-star ratings (1,3,5,7,9)
2026-01-26 13:49:37 -05:00
john-okeefe 012242dcad test: Update API collection for rating system changes
- Update rating examples to use 1-10 scale
- Document half-star precision in API collections
- Add rating conversion examples for testing
- Update Get Ebook Rating docs with scale explanation
- Update Create/Update Rating with new validation rules
2026-01-26 13:49:25 -05:00
john-okeefe e8cafc634c docs: Update documentation for advanced rating system
- Update feature list to reflect half-star precision
- Document backend 10-point scale conversion
- Update API documentation for rating endpoints
- Explain rating scale and half-star precision
- Update README with detailed rating system explanation
2026-01-26 13:49:13 -05:00
john-okeefe baa46a8a63 Update documentation to reflect interactive rating system and API changes
- Update README.md with interactive rating system details
- Document zero-rating behavior in GET /api/ebooks/:id/rating
- Add comprehensive rating system documentation section
- Update Bruno collection files to reflect new API behavior
- Enhance API testing documentation with rating 0 fallback
2026-01-26 11:54:53 -05:00
john-okeefe 1bda408448 Add interactive rating display and controls to dashboard 2026-01-26 11:49:51 -05:00
john-okeefe f35defd139 Update GetEbookRating API to return rating 0 when no rating exists 2026-01-26 11:49:44 -05:00
john-okeefe a1b070610a Add new configuration and documentation files
- Add config.json for application configuration
- Add diff.txt for development reference
- Add root sqlc.yaml as additional configuration
2026-01-26 11:33:43 -05:00
john-okeefe e33c598acf Fix package.json postinstall script and remove duplicate
- Use curl with -L flag for proper redirect handling
- Remove duplicate scripts section
- Clean up npm dependency management
2026-01-26 11:33:32 -05:00
john-okeefe 0550dd3d5a Fix ebook scanner error handling for database queries
- Remove string-based error checking for no rows
- Use proper pgx.ErrNoRows comparison only
- Improve error handling consistency in processEbookFile function
2026-01-26 11:32:45 -05:00
john-okeefe ba80ace1be Enhance error handling in ebook handlers
- Add pgx.ErrNoRows checks in GetEbook and GetReadingProgress
- Improve error handling in GetEbookRating with proper status codes
- Return consistent error responses across all endpoints
- Add missing pgx import for proper error comparison
2026-01-26 11:32:11 -05:00
john-okeefe 6b4e5f0198 Improve error handling in auth handlers
- Add specific pgx.ErrNoRows checks in GetProfile
- Better error handling in UpdatePassword and GetScanSettings
- Return appropriate HTTP status codes for different error types
- Improve error message consistency
2026-01-26 11:31:22 -05:00
john-okeefe 123ddab242 Update sqlc.yaml configuration for relative paths
- Change schema path to use relative path from internal/database
- Update queries path to use current directory
- Modify output directory to current directory for better organization
2026-01-26 11:30:15 -05:00
john-okeefe 64afdf6803 Clean up Bruno scanner documentation formatting
- Remove example request body template
- Improve documentation spacing and formatting
- Clarify API endpoint usage and response structure
2026-01-26 11:29:40 -05:00
john-okeefe e8a8db72a4 Optimize Dockerfile build process and add static assets
- Reorder package installation to improve layer caching
- Add curl to runtime dependencies
- Use relative paths for sqlc and templ generation
- Copy static assets to final stage
- Improve build step organization
2026-01-26 11:29:12 -05:00
john-okeefe 068d686fa1 added a fake ebook id to test for errors 2026-01-26 11:02:00 -05:00
john-okeefe 1da9aed891 refactor: clean up .gitignore for Go web app project
- Remove unnecessary Node.js and build tool entries
- Keep only relevant entries for Go web application
- Preserve Bruno collection, static assets, and Go template files
- Add clarifying comments for project-specific entries
2026-01-25 00:15:59 -05:00
john-okeefe 44bb829790 docs: add environment setup instructions
- Add .env.example file with template for secure configuration
- Update Quick Start section with detailed environment setup
- Provide both .env file and docker-compose variable methods
- Add security notes and password generation commands
- Document default database credentials with security warning
- Include instructions for generating secure JWT secrets and passwords
2026-01-25 00:09:46 -05:00
john-okeefe ec1f97828f feat: replace Tailwind CDN with local build system
- Add tailwind.config.js with theme color configuration
- Add package.json with build scripts and dependencies
- Add Dockerfile Node.js setup for CSS building
- Add input.css for Tailwind processing
- Update all templates to use local CSS and JS instead of CDN
- Add static file serving in main.go
- Download htmx during build process
- Enable CSS minification for production builds
2026-01-24 23:52:35 -05:00
john-okeefe f117b75151 docs: update README for local CSS build system
- Update technical details to reflect local Tailwind build process
- Remove CDN references and document self-contained asset building
- Update build process documentation with Node.js integration
2026-01-24 23:43:03 -05:00
john-okeefe 08e80ae84b refactor: reorganize project structure and update configurations
- Move migrations/ to database/schema/ for clarity on database schema definitions
- Move sqlc.yaml to internal/database/ to group with database code
- Move static/ to cmd/server/static/ to co-locate with server
- Update all configuration files and documentation
- Follow Go project conventions for better organization
2026-01-24 23:40:31 -05:00
john-okeefe 8a951fb242 Update dependencies and fix main.go issues 2026-01-23 21:27:18 -05:00
john-okeefe 5fe1c299b8 Update README: add profile management features, correct theme count, expand API docs 2026-01-23 21:27:14 -05:00
john-okeefe 7c70e9e85a Update Bruno API tests for user endpoints including new profile management 2026-01-23 21:27:13 -05:00
john-okeefe 382a2369c5 Fix auth handler: remove duplicate validation, fix first_name/last_name type handling 2026-01-23 21:27:10 -05:00
john-okeefe f4e8c0d983 Add user names support: add first_name/last_name to users table and regenerate database queries 2026-01-23 21:27:08 -05:00
john-okeefe 7c89e9f214 Simplify homepage: remove auth check, keep login hidden for now 2026-01-23 17:56:29 -05:00
john-okeefe 327b1cc5a4 Add strings import for getToken 2026-01-23 17:55:56 -05:00
john-okeefe 21490af3f0 Add jwtgo import for homepage auth check 2026-01-23 17:55:25 -05:00
john-okeefe 2da9245bfc Update homepage: remove create account, hide login if logged in 2026-01-23 17:54:56 -05:00
john-okeefe adeec3d64c Update admin templates: remove scanner link/card, fix profile inputs, reorder library sections 2026-01-23 17:52:10 -05:00
john-okeefe 335c63a494 Update main.go to use templ components for routing 2026-01-23 17:47:36 -05:00
john-okeefe e5a2b74be6 Add templ generation to Dockerfile 2026-01-23 17:44:49 -05:00
john-okeefe adaa425136 Update dependencies and admin template 2026-01-23 17:43:04 -05:00
john-okeefe a530df895f Remove generated .templ.go files from git and add to .gitignore 2026-01-23 17:41:57 -05:00
john-okeefe 5f5870b95d Migrate to templ: Convert all HTML templates to type-safe templ components
- Add templ dependency for type-safe HTML rendering
- Convert index.html, login.html, register.html, dashboard.html, admin.html, admin_profile.html, admin_library.html to .templ files
- Generate Go code with templ generate for compile-time safety
- Update server routes to use templ components with proper rendering
- Refactor JavaScript in dashboard to avoid backtick parsing conflicts
- Delete old HTML template files
- Clean up project by removing unnecessary files and binaries
2026-01-23 16:33:08 -05:00
john-okeefe fcc9b0f0b3 fix: resolve user registration error by fixing database queries
- Update CreateUser query to explicitly select only existing columns
- Update all user SELECT queries to explicitly select columns to avoid scan_frequency_minutes column issues
- Add GetUserForLogin query that includes password_hash for authentication
- Update login handler to use GetUserForLogin instead of GetUserByEmailOrUsername
- This prevents errors when migration hasn't been applied yet, allowing user registration to work
2026-01-23 11:06:56 -05:00
john-okeefe a5e96ddb0b feat: restructure admin dashboard into separate pages
- Convert admin dashboard from single 2-column page to multi-page interface
- Create main admin dashboard (/admin) as overview with navigation sidebar
- Add separate profile settings page (/admin/profile) for user account management
- Add separate library management page (/admin/library) combining folder and scan settings
- Implement sidebar navigation pattern similar to Gitea, Jellyfin, Audiobookshelf
- Add dedicated templates: admin.html, admin_profile.html, admin_library.html
- Include quick actions and statistics on main dashboard
- Improve UI with better organization and visual hierarchy
- Maintain consistent navigation and theme across all admin pages
- Add folder management, scan settings, and library statistics to library page
2026-01-23 09:44:47 -05:00
john-okeefe 11621462f2 feat: create admin dashboard with user preferences and library settings
- Add admin dashboard at /admin route consolidating all user settings
- Move user preferences (username, email, password, theme) from separate page
- Add ebook library preferences section with folder management
- Add scan settings (frequency and auto-scan toggle) with database persistence
- Create database migration for scan_frequency_minutes and auto_scan_enabled columns
- Add API endpoints for scan settings management:
  - PUT /api/library/scan-settings - Update scan preferences
  - GET /api/library/scan-settings - Get current scan settings
- Update dashboard navigation to link to admin dashboard
- Remove old preferences.html template (functionality moved to admin)
- Create Bruno API testing files for library endpoints
- Add real-time folder loading and management in admin interface
- Implement scan settings persistence and retrieval from database
2026-01-23 09:38:40 -05:00
john-okeefe 2dba1d6eb9 feat: add user preferences dashboard
- Add /preferences route and preferences.html template for user settings
- Implement username, email, password, and theme update functionality
- Add account deletion feature with confirmation
- Add navigation link to preferences from dashboard
- Create API endpoints:
  - PUT /api/user/username - Update username
  - PUT /api/user/email - Update email address
  - PUT /api/user/password - Change password with verification
  - DELETE /api/user/account - Delete user account
- Add database queries for user updates and account deletion
- Create Bruno API testing files for all user preference endpoints
- Add proper validation, error handling, and security checks
2026-01-23 09:30:15 -05:00
john-okeefe c29183a14f fix: minor formatting fix in Bruno ebook rating file
- Remove extra space in 'body: json' declaration
- Ensure file ends with proper newline
2026-01-23 09:22:34 -05:00
john-okeefe b9edb92af2 refactor: rename bruno/auth folder to bruno/user
The auth folder now contains user management endpoints beyond just authentication:
- User registration/login (auth)
- Profile management (user)
- Theme settings (user preferences)
- Ebook folder management (user settings)

Renaming to 'user' better reflects the expanded scope covering user accounts, preferences, and settings management.
2026-01-23 09:11:42 -05:00
john-okeefe c3769fe7f1 refactor: rename project back from shelf to bookmann
- Change Go module name back from 'shelf' to 'bookmann'
- Update all import paths back to 'bookmann' module
- Update README.md project name back to 'Bookmann'
- Update docker-compose.yml container names back to 'bookmann' and 'bookmann_db'
- Regenerate database code with restored module imports
2026-01-23 09:08:59 -05:00
john-okeefe 4318f8624b refactor: restructure project from bookmann to shelf
- Rename project from 'bookmann' to 'shelf'
- Move all backend/ contents to root level (flatten structure)
- Update Go module name from 'bookmann' to 'shelf'
- Update all import paths to use new 'shelf' module
- Update Dockerfile to work without backend/ subdirectory
- Update docker-compose.yml to use new structure and rename containers
- Update .gitignore for new file paths
- Update README.md with new project name and structure
- Regenerate database code with new module imports
2026-01-23 09:08:04 -05:00