Files
ReadMeABook/documentation
kikootwo c8bfcdb611 Add admin Bulk Import feature
Introduce a Bulk Import feature for admins to scan server folders, match discovered audiobook folders against Audible, review matches, and queue batch imports.

What changed:
- Added documentation: documentation/features/bulk-import.md and TABLEOFCONTENTS update.
- Backend: SSE scan endpoint (POST /api/admin/bulk-import/scan) streams discovery and matching events; execute endpoint (POST /api/admin/bulk-import/execute) validates paths, creates/resolves audiobook & request records, and queues organize_files jobs. Both endpoints enforce admin-only access and validate allowed root directories (download_dir, media_dir, /bookdrop).
- Frontend: Modal wizard and steps for folder selection, scan progress, and match review (BulkImportWizard + ScanFolderStep, ScanProgressStep, MatchReviewStep + shared types).
- Utilities: bulk-import-scanner for folder discovery and ffprobe metadata extraction; shared types for scanned books/events.
- UI: Added Bulk Import quick action to admin dashboard (src/app/admin/page.tsx).

Key details:
- Audible searches are rate-limited (≈1.5s) and matching results include library/request status checks.
- Reuses existing organize_files job queue and manual-import pipeline; no new database tables introduced (state is ephemeral during the wizard).
- Includes error handling, path normalization, and security checks for allowed directories.

This commit wires frontend, backend, and docs together to provide an admin-only multi-step bulk import workflow.
2026-03-13 12:03:21 -04:00
..
2026-03-13 12:03:21 -04:00

ReadMeABook - Audiobook Library Management

Status: MVP Complete (Phases 1-4 ) | Docker deployment pending

Stack

  • Frontend: Next.js 14+, TypeScript, Tailwind CSS
  • Backend: Node.js/Express via Next.js API routes
  • Database: PostgreSQL (Docker embedded)
  • Queue: Bull + Redis (Docker embedded)
  • Deployment: Single Docker image

Architecture

Docker Container
├── Next.js App (Frontend + Backend)
├── PostgreSQL (users, audiobooks, requests, config, jobs)
├── Bull Queue + Redis (background jobs)
└── Volumes: /config, /downloads, /media

External integrations: Plex (auth + library), Prowlarr/Jackett (indexers), qBittorrent/Transmission (downloads), Audible (metadata scraping)

Core Features (Implemented)

  • Plex OAuth authentication
  • Setup wizard (8 steps: admin, Plex, Prowlarr, download client, paths)
  • Audiobook discovery (popular, new releases via Audible scraping)
  • Request management with status tracking
  • Automation pipeline: search → download → organize → Plex scan
  • Admin dashboard with metrics, active downloads, recent requests
  • Settings pages (Plex, Prowlarr, download client, paths)
  • Scheduled jobs (Plex scan, Audible refresh, retry logic, cleanup)
  • User/admin RBAC

User Flow

  1. Login with Plex → 2. Search/browse audiobooks → 3. Request → 4. Auto: search indexers → download torrent → organize files → scan Plex → 5. Available in Plex library

Documentation Map

Backend:

Integrations:

Automation (Phase 3):

Frontend:

Admin:

Deployment:

Testing:

Development Phases

Phase 1: Foundation (auth, database, setup wizard) Phase 2: User features (discovery, requests, dashboard) Phase 3: Automation (search, download, organize, Plex integration) Phase 4: Admin tools (dashboard, settings, monitoring, scheduled jobs) Phase 5: Enhanced features (WebSockets, advanced search) Phase 6: Advanced admin (analytics, notifications, quality profiles)

Standards

  • Files ≤400 lines
  • File headers link to documentation
  • Update docs before/after code changes
  • Type-safe TypeScript throughout
  • Encrypted sensitive config (AES-256)