Commit Graph
73 Commits
Author SHA1 Message Date
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
john-okeefe 152ed27200 docs: update README with multiple folder support and scanner functionality
- 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
2026-01-23 09:04:59 -05:00