- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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)
- 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
- 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
- Remove string-based error checking for no rows
- Use proper pgx.ErrNoRows comparison only
- Improve error handling consistency in processEbookFile function
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
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.
- 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
- 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
- Add multiple folder support and smart scanner to features list
- Document new API endpoints for folder management and scanner operations
- Update project structure to include services directory
- Add comprehensive ebook scanner section with usage instructions
- Update recent enhancements with latest backend improvements
- Include real-time monitoring and metadata extraction details
- Add routes for ebook folder management in auth group
- Add routes for scanner operations (scan, start, stop)
- Update route handlers to use new multiple folder endpoints
- Maintain JWT authentication for protected routes
- Create EbookScanner service with multiple folder support
- Update scanner to handle array of folder paths instead of single path
- Add EPUB metadata extraction for rich ebook information
- Implement folder monitoring with fsnotify for real-time updates
- Add API endpoints for folder management:
- POST /api/auth/ebook-folders (add folder)
- GET /api/auth/ebook-folders (list folders)
- DELETE /api/auth/ebook-folders/:folderPath (remove folder)
- Update scanner endpoints to accept folder_paths array
- Add go-epub and fsnotify dependencies for metadata extraction and file watching
- Replace single folder queries with multiple folder operations
- Add AddUserEbookFolder, GetUserEbookFolders, DeleteUserEbookFolder queries
- Regenerate Go code with sqlc
- Update models to include UserEbookFolders struct
- Add ebook_folder_path column to users table (migration 004)
- Create user_ebook_folders table for multiple folders per user (migration 005)
- Remove old ebook_folder_path column from users table (migration 006)
- Add unique constraint to prevent duplicate folder paths per user
- Add theme column to users table with default 'tokyo-night'
- Update all user queries to include theme field
- Add ListUsers and UpdateUserTheme database queries
- Update auth handlers to support HTMX form submissions and JSON API
- Add ListUsers API endpoint
- Replace embedded static files with Go templates
- Update Dockerfile to copy templates directory
- Redesign index.html with inline styles and HTMX forms
- Update Bruno API testing requests for auth endpoints
- Updated COMPLETE_DOCUMENTATION.md feature descriptions
- Updated user journey reference from 'ebook library' to 'ebook collection'
- Updated all frontend page titles and headers
- Updated Bruno API collection and workspace names
- All references now consistently use 'Bookmann' as the application name
- 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