Commit Graph
17 Commits
Author SHA1 Message Date
john-okeefe 6fcd7f4400 fix(docker): add Go build cache mount and remove unnecessary -a flag
Add --mount=type=cache for Go build cache to speed up repeated builds.
Remove the -a flag which forces full rebuilding of all packages and is
unnecessary when using cache mounts.
2026-05-24 21:20:12 -04:00
john-okeefe 6e8986bea5 fix(docker): use npm install instead of npm ci for self-contained builds
npm ci requires a package-lock.json and installs exactly what it specifies.
npm install resolves from package.json directly, making the Docker build
fully self-contained — you can clone the repo and run docker build with no
local Node tooling or pre-existing lockfile.
2026-05-24 20:23:57 -04:00
john-okeefe d42d09b8db chore: upgrade templ v0.3.1001 → v0.3.1020, pin in Dockerfile
Newer templ generates ResolveAttributeValue calls that don't exist in
v0.3.1001 runtime, causing Docker build failures ("undefined:
templ.ResolveAttributeValue"). Pin templ CLI version in Dockerfile to
match go.mod instead of using @latest.

Also updated local templ CLI to v0.3.1020 to match.
2026-05-10 16:13:36 -04:00
john-okeefe 855ef161d8 fix(docker): bump builder to Go 1.26, download sqlc binary, fix test-runner Go version
The builder stage was previously bumped to Go 1.26 but the test-runner stage
remained on Go 1.25, causing 'go.mod requires go >= 1.26.0' errors during
test execution.

Go 1.26 introduced stricter validation of replace directives in dependency
go.mod files, which broke 'go install sqlc@latest' (sqlc v1.31.0 has replace
directives). Replace go install with a direct binary download from GitHub
releases, matching the existing kepubify download pattern.

Bump test-runner from golang:1.25-alpine to golang:1.26-alpine to match the
go.mod requirement.
2026-04-21 21:15:18 -04:00
john-okeefe 0af319fef9 build: Add HTMX copy step to build:ts script
- Modified package.json build:ts to copy htmx.min.js from node_modules to web/static/
- This fixes the 404 error for /static/htmx.min.js that occurred after ESBuild migration
- Added htmx.min.js to static files

See ESBUILD_MIGRATION_PLAN.md for migration context.
2026-03-08 21:35:35 -04:00
john-okeefe e16923395b chore(build): remove obsolete downloaded JS bundles and update Dockerfile
Remove minified JavaScript libraries that were previously downloaded during
postinstall (htmx.min.js, highlight.min.js, lunr.min.js, lunr-flex.min.js).
These are now bundled via esbuild from npm packages.

Update Dockerfile to remove the now-unnecessary postinstall npm script execution,
streamlining the container build process.
2026-03-06 20:18:06 -05:00
john-okeefe 55440e0dc8 feat(devops): improve Docker build caching and add dev workflow targets
- Optimize Dockerfile layer caching with --mount=type=cache for Go modules and npm
- Reorganize Dockerfile layers for better cache hit rates
- Improve .dockerignore organization with categorized comments
- Add Makefile targets: up, down, rebuild-app, restart, ps
- Enhance Makefile help output with categorized sections
2026-02-22 18:40:16 -05:00
john-okeefe aaa367cb33 chore: add -short flag to test command in Dockerfile 2026-02-14 00:12:56 -05:00
john-okeefe 5d93577078 fix(tests): Add missing addFolderToLibrary call to TestMediaItemISBNNormalization
- TestMediaItemISBNNormalization was missing library folder creation
- Caused HTTP 400 errors when creating media items
- addFolderToLibrary call was accidentally removed from line 73
- Tests now properly create library with folder before adding media items

This fixes the root cause of ISBN normalization test failures where
media-item creation failed due to missing library folder requirement.
2026-02-11 15:32:09 -05:00
john-okeefe 11070fbf25 Improve test infrastructure and organization
- Add test-runner stage to Dockerfile for isolated test execution
- Refactor Makefile test targets: separate unit and integration tests
- Unit tests now run on host (fast, no containers required)
- Integration tests run in containers matching production environment
- Add dedicated 'tests' service to docker-compose.yml
- Update test-integration target to use containerized test runner
- Improve service health checks and wait conditions
- Add test environment variables for consistent testing

This change separates unit tests (fast, local) from integration tests
(full environment, containerized) for better developer experience
and more reliable CI/CD pipelines.
2026-02-09 10:13:32 -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 ec5a961f6c feat(conversion): add EPUB to KEPUB conversion service with kepubify
- Install kepubify binary in Dockerfile for on-the-fly conversion
- Add conversion service with caching layer (24hr TTL)
- Support KEPUB downloads through OPDS endpoint
- Cache converted files to reduce processing overhead
- Add environment configuration for cache directory and tool path
2026-02-01 12:15:28 -05:00
john-okeefe 201a7d89d8 build: update Dockerfile for TypeScript compilation
- Add npm run build:ts step to compile TypeScript
- Copy web/ directory instead of cmd/server/static/
- Build pipeline now: Go deps → CSS → HTMX → TypeScript → Go binary
- TypeScript compiles to JavaScript before final image build

Integrates TypeScript compilation into container build process.
2026-01-29 14:08:53 -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 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 e5a2b74be6 Add templ generation to Dockerfile 2026-01-23 17:44:49 -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