A self-hosted, multi-user audiobook player web app designed for mobile โ drop your audiobook folders, deploy via Docker, and start listening on your phone.
Note: the demo is a front-end preview only (no backend, no data) โ login, library, and playback are disabled. Run the full app via Docker (see below).
Built with โค๏ธ by Adrian Stark
-
๐ฅ Multi-User (SQLite-backed)
- Per-user isolated library, favorites, progress, metadata, and settings
- Choose / create / login / switch users from a mobile-first gate screen
- 30-day HttpOnly session cookie per device โ each device logs in independently
- Per-user avatar upload; data stored in a single embedded SQLite database
- Legacy single-user JSON data is auto-migrated to the default user on first boot
-
๐ Public Access Gate
- Optional server-side password page to protect an internet-exposed deployment
- HMAC-signed access token, remembered 30 days per browser
- Configurable via
PUBLIC_ACCESS_PASSWORD(independent from user accounts)
-
๐ต Multi-Format Audio Support
- Plays MP3, AAC/M4A, WAV, FLAC, OGG, OPUS natively
- Server-side FFmpeg conversion for non-browser-native formats (WMA, APE)
- WMA/APE are converted once to AAC (.m4a) and served as plain static files โ no on-demand transcoding
-
๐ Smart Folder Parsing
- Auto-recognizes
Novel Name / Season (Chapter) / Episodestructure - Supports Chinese numerals (็ฌฌไธๅญฃ) and Arabic numerals (Season 1)
- Single-season books (flat audio files) handled gracefully
- Auto-play across season boundaries
- Auto-recognizes
-
๐พ Persistent Playback Memory
- Remembers exact position (book + season + episode + second)
- Auto-save every 10 seconds during playback
- Resume with configurable rewind (0โ30s) for context
- Quick resume button on bookshelf โ one tap to continue
-
โญ๏ธ Skip Intro & Outro
- Per-book customizable skip duration
- Applies globally to all episodes of a book
- Independent settings for each book
-
๐ฑ Offline & PWA
- Download entire seasons for offline listening
- Download progress tracking with cancel support
- Configurable cache size (50MBโ5GB)
- Add-to-home-screen install prompt for a native-like experience
-
๐จ Modern Mobile UI
- Dark theme with glassmorphism design
- Smooth animations (Framer Motion)
- Bottom navigation (Bookshelf / Favorites / Settings)
- Mini player bar with full-screen player view
- Lock-screen controls via Media Session API
-
๐ Library Management
- Bookshelf with search and sorting (Recent / AโZ / ZโA)
- Favorites collection
- Custom book name, description, and cover image upload
- Upload books as files, folders, or archives (ZIP/7Z/RAR/TAR.GZ)
- Server directory browser for audiobook path selection
-
โก Smart Conversion Engine
- Auto-converts WMA/APE to AAC (.m4a, 64kbps mono) when a book is first detected
- Originals are replaced after conversion โ half the size, equal-or-better voice quality
- Dynamic concurrency (up to CPU cores / 2, max 10)
- CPU/memory safeguard โ pauses when system load exceeds 85%
- Per-book progress shown on the bookshelf and detail page
- Docker (recommended for deployment) โ image bundles FFmpeg, 7zip, and Node 24
- For local development: Node.js 24+ (required for the built-in
node:sqlitemodule) and FFmpeg
git clone https://github.com/uniStark/audiooook.git
cd audiooook
# Optional: create a .env to override defaults (see below), then:
docker compose up -d --build
# Access at http://localhost:3003docker-compose.yml supports these .env overrides:
# .env
AUDIOBOOK_HOST_PATH=/srv/audiobooks # host audiobook library mount
PUBLIC_ACCESS_PASSWORD=your-strong-password # public access gate passwordBy default the library is bind-mounted from ./data/audiobooks and persistent data
(SQLite DB, covers, per-user files) lives in ./data.
docker build -t audiooook_web .
# Mount host directory at the same path for consistent UI browsing
docker run -d -p 3003:4001 \
-v /nas:/nas \
-v ./data:/app/server/data \
-e AUDIOBOOK_PATH=/nas/books \
-e PUBLIC_ACCESS_PASSWORD=your-strong-password \
--name audiooook_web audiooook_webNote: Mount host directories at the same path inside the container (e.g.,
-v /nas:/nas) so the UI directory browser shows consistent paths. Multiple mounts supported:-v /nas:/nas -v /mnt/media:/mnt/media
# Install all dependencies (root + server + client)
npm run install:all
# Start dev environment (frontend + backend concurrently)
npm run dev
# Frontend: http://localhost:4001
# Backend: http://localhost:5001The server seeds a default user on first boot:
| Username | Password |
|---|---|
admin |
admin |
The default user (admin) owns the audiobook library mounted via AUDIOBOOK_PATH.
Additional users get their own isolated library under server/data/users/<username>/audiobooks/.
Change these credentials after first login, and set a strong PUBLIC_ACCESS_PASSWORD for public deployments.
audiobooks/
โโโ Tomb Raiders/ โ Book name (auto-detected)
โ โโโ cover.jpg โ Cover image (optional)
โ โโโ Season 1 - Seven Star Palace/ โ Season 1
โ โ โโโ episode01.wma
โ โ โโโ episode02.wma
โ โ โโโ ...
โ โโโ Season 2 - Angry Sea/ โ Season 2
โ โ โโโ ...
โ โโโ ...
โโโ Three-Body Problem/ โ Single-season book (no subdirs)
โ โโโ 01.mp3
โ โโโ 02.mp3
โ โโโ ...
โโโ Ghost Blows Out the Light/
โโโ ็ฌฌไธๅญฃ/ โ Chinese season names supported
โ โโโ ...
โโโ ็ฌฌไบๅญฃ/
โโโ ...
audiooook_web/
โโโ client/ # React frontend (Vite)
โ โโโ src/
โ โ โโโ components/ # BookCard, BottomNav, EpisodeList, MiniPlayer,
โ โ โ # Player, UserGate, PwaInstallCard
โ โ โโโ pages/ # Bookshelf, BookDetail, Favorites, Settings
โ โ โโโ stores/ # Zustand stores (player, book, download, session)
โ โ โโโ hooks/ # usePwaInstallPrompt
โ โ โโโ utils/ # API client, IndexedDB + server sync, formatters
โ โโโ vite.config.js
โโโ server/ # Express backend
โ โโโ db/ # appDb.js โ SQLite schema, users/sessions/data
โ โโโ middleware/ # publicAccess (password gate), userContext (per-user)
โ โโโ routes/ # books, audio, config, user, upload, session
โ โโโ services/ # scanner, converter (WMA/APEโAAC), oss
โ โโโ utils/ # parser, paths, accessAuth
โ โโโ data/ # Runtime data (SQLite DB, covers, per-user dirs)
โโโ Dockerfile # Multi-stage build (Node 24 + FFmpeg + 7zip)
โโโ docker-compose.yml # Production container config
โโโ .gitattributes # Force LF line endings
โโโ PROJECT_CONTEXT.md # Comprehensive AI-oriented project docs
| Layer | Technologies |
|---|---|
| Frontend | React 18, Vite 6, Tailwind CSS, Zustand, Framer Motion, React Router DOM 7 |
| Backend | Node.js 24, Express 4, built-in node:sqlite, FFmpeg (audio conversion) |
| Storage | SQLite (users, sessions, favorites, progress, metadata) + filesystem (audio, covers, avatars) |
| Offline | IndexedDB (idb), Service Worker, VitePWA |
| Icons | react-icons (Heroicons v2) |
| Deployment | Docker, Docker Compose V2 |
| Environment | Frontend | Backend | Access URL |
|---|---|---|---|
| Development | 4001 (Vite) | 5001 (Express) | http://localhost:4001 |
| Docker | โ (static) | 4001 (internal) | http://host:3003 |
| Variable | Description | Default |
|---|---|---|
PORT |
Server port | Dev: 5001 / Docker: 4001 |
NODE_ENV |
Environment | production (Docker) |
AUDIOBOOK_PATH |
Default user's audiobook directory | /data/audiooook_web (prod) / ./audiobooks (dev) |
AUDIOBOOK_HOST_PATH |
Host path bind-mounted as the library (compose) | ./data/audiobooks |
DEFAULT_USER_AUDIOBOOK_PATH |
Override the default user's library specifically | falls back to AUDIOBOOK_PATH |
PUBLIC_ACCESS_PASSWORD |
Public access gate password | audiooook |
PUBLIC_ACCESS_SECRET |
Secret for signing the access token | the access password |
AUDIOOOOK_DB_PATH |
Override SQLite database file location | server/data/audiooook.sqlite |
TZ |
Timezone for log timestamps | Asia/Shanghai |
OSS_REGION / OSS_ACCESS_KEY_ID / OSS_ACCESS_KEY_SECRET / OSS_BUCKET / OSS_PREFIX |
Alibaba Cloud OSS (optional) | โ |
- Public access gate (
/api/auth) โ a server-rendered password page guarding the whole site, intended for internet-exposed deployments. Verified browsers are remembered for 30 days via a signedaudiooook_accesscookie. - User session (
/api/session) โ after passing the gate, a user picks an account (or creates one) from the in-appUserGate. A 30-day HttpOnlyaudiooook_user_sessioncookie scopes every API call to that user's data.
All persistent data is stored in ./data (bind-mounted to /app/server/data):
| File / Directory | Content |
|---|---|
audiooook.sqlite |
Users, sessions, settings, favorites, progress, book metadata (per-user) |
config.json |
Server settings (audiobook path, cache size) |
covers/ |
Default/legacy cover images |
users/<username>/audiobooks/ |
Per-user uploaded library (default user uses the global mount) |
users/<username>/covers/ |
Per-user custom covers |
users/<username>/profile/ |
Per-user avatar |
Important: Never delete
./dataduring updates โ it holds all user accounts and progress. Update safely withdocker compose up -d --build(or--no-cacheto force a clean rebuild).
Migration note: Legacy
metadata.json/user-data.jsonfrom older single-user installs are automatically imported into the SQLite database (under the default user) on first boot, then left untouched.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
Made with โค๏ธ by Adrian Stark