A personal book collection manager built as a Progressive Web App. Track your reading, organize with shelves, and share a single library across family profiles — all offline-first with no account required.
Live Demo — demo berjalan di GitHub Pages. Semua fitur berfungsi secara offline. Untuk sync antar perangkat, kamu perlu deploy sync server sendiri (lihat bagian Sinkronisasi).
npm install
npm run dev
App langsung bisa dipakai tanpa sync server — semua data disimpan lokal di browser.
| Perintah | Keterangan |
|---|---|
npm run dev |
Jalankan dev server (terbuka ke jaringan lokal) |
npm run build |
Build produksi ke build/ |
npm run preview |
Preview build produksi |
npm run check |
Type-check dengan svelte-check |
npm run test |
Jalankan unit test (Vitest) |
src/
├── lib/
│ ├── components/ # Komponen UI
│ ├── db/ # Yjs Y.Doc, query helpers, reactive stores, migrasi
│ ├── i18n/ # Terjemahan (en, id)
│ ├── services/ # Business logic (books, stats, backup, dll.)
│ ├── stores/ # Svelte stores (user, theme, toast, dialog)
│ └── sync/ # Room codes, provider interface, PartyKit/Hocuspocus
├── routes/
│ ├── add/ # Tambah buku (cari, manual, scan)
│ ├── book/[id]/ # Detail & edit buku
│ ├── browse/ # Jelajahi per kategori, seri, penulis
│ ├── join/[code]/ # Link join room yang bisa dibagikan
│ ├── mine/ # Status bacaan per user
│ ├── settings/ # Pengaturan, backup, sync
│ ├── shelves/ # Rak buku kustom
│ └── stats/ # Statistik & target membaca
├── static/ # Ikon PWA & aset
partykit/ # PartyKit sync server
Penting: Fitur sync membutuhkan sync server. Tanpa server, app tetap berfungsi penuh secara offline — data tersimpan lokal di browser. Deploy sync server hanya diperlukan jika kamu ingin sync data antar perangkat (misalnya laptop dan HP).
Data disimpan lokal di IndexedDB via Yjs CRDTs. Sync bersifat opsional — buat atau join room dengan kode (format: XXXX-XXXX) untuk sync antar device secara real-time.
Buka Settings > Device Sync, lalu Create Room atau Join Room.
| Provider | Biaya | Kelebihan | Kekurangan |
|---|---|---|---|
| PartyKit (default) | Free tier (20 koneksi) | Data persist di cloud, offline-to-online sync | Perlu deploy server |
| Hocuspocus | Self-hosted | Full kontrol, unlimited | Perlu VPS sendiri |
PartyKit menyimpan Y.Doc di cloud, jadi device bisa sync meskipun tidak online bersamaan. Free tier cukup untuk penggunaan pribadi/keluarga (20 concurrent connections, 1GB storage).
Device A ←──WebSocket──→ PartyKit Server ←──WebSocket──→ Device B
↕
Durable Storage
(data persist di cloud)
Cara kerja:
wss://<project>.partykit.dev/party/<room-code>partykit/server.ts) menggunakan y-partykit yang handle:Setup:
# 1. Install PartyKit CLI & login
npm install -g partykit
npx partykit login
# 2. Deploy server
cd partykit
npm install
npm run deploy
# Output: https://libris-sync.<username>.partykit.dev
# 3. Build app dengan PartyKit host
VITE_PARTYKIT_HOST=libris-sync.<username>.partykit.dev npm run build
Atau untuk development lokal:
# Terminal 1: jalankan PartyKit server lokal
cd partykit && npm install && npm run dev
# Server jalan di localhost:1999
# Terminal 2: jalankan app (otomatis connect ke localhost:1999)
npm run dev
Lalu buka Settings → Create Room atau Join Room.
Kalau kamu deploy frontend ke GitHub Pages, set VITE_PARTYKIT_HOST sebagai repository secret:
VITE_PARTYKIT_HOST = libris-sync.<username>.partykit.devUntuk yang punya VPS dan mau full kontrol.
# Di VPS
mkdir hocuspocus && cd hocuspocus
npm init -y
npm install @hocuspocus/server
cat > index.js << 'EOF'
import { Hocuspocus } from "@hocuspocus/server";
new Hocuspocus({ port: 1234 }).listen();
EOF
node index.js
Di Settings, pilih Self-hosted → masukkan wss://your-vps:1234 → Create/Join Room.