All MVP features have been successfully implemented:
- ✅ Upload .epub and .pdf files
- ✅ Store files in IndexDB using localforage
- ✅ Store document metadata separately
- ✅ Display library grid with all documents
- ✅ Open and read EPUB files with epubjs
- ✅ Open and read PDF files with pdfjs-dist
- ✅ Navigate pages in both readers
- ✅ Track and save reading progress in NgRx
- ✅ Delete documents from both IndexDB and state
- ✅ Responsive layout (mobile/desktop)
- ✅ All components are standalone (no NgModule)
- ✅ NgRx state management with Entity adapter
- ✅ Proper separation of concerns (core, store, features)
- ✅ Type-safe models and interfaces
- ✅ Modern Angular 21+ patterns
src/app/
├── core/
│ ├── models/
│ │ └── document.model.ts # Document interface
│ └── services/
│ ├── indexdb.service.ts # IndexDB operations
│ ├── epub.service.ts # EPUB metadata extraction
│ └── pdf.service.ts # PDF metadata extraction
├── store/
│ └── documents/
│ ├── documents.actions.ts # NgRx actions
│ ├── documents.reducer.ts # NgRx reducer with Entity adapter
│ ├── documents.selectors.ts # NgRx selectors
│ └── documents.effects.ts # Side effects handling
├── features/
│ ├── upload/
│ │ └── upload.component.ts # File upload component
│ ├── library/
│ │ └── library.component.ts # Document library grid
│ └── reader/
│ ├── reader.component.ts # Main reader container
│ ├── epub-reader/
│ │ └── epub-reader.component.ts
│ └── pdf-reader/
│ └── pdf-reader.component.ts
├── app.config.ts # App configuration with NgRx
├── app.routes.ts # Routing configuration
└── app.ts # Root component
-
Start the development server:
npm start
-
Open your browser: Navigate to
http://localhost:4200 -
Upload a document:
- Click "Upload Document" button
- Select a .epub or .pdf file
- The document will be stored in IndexDB
-
Read documents:
- Click "Open" on any document card
- Use Previous/Next buttons to navigate
- Your reading progress is automatically saved
- Angular 21+: Modern standalone components
- NgRx: State management with Entity adapter
- localforage: IndexDB wrapper for file storage
- epubjs: EPUB rendering
- pdfjs-dist: PDF rendering
- Displays all uploaded documents in a grid
- Shows document metadata (title, type, size, last opened)
- Handles document deletion with confirmation
- Loads documents on initialization
- Handles file selection
- Dispatches upload action to NgRx store
- Accepts .epub and .pdf files only
- Routes to correct reader based on document type
- Displays document title and back navigation
- Acts as container for epub/pdf readers
- Renders EPUB using epubjs library
- Tracks current location
- Saves reading progress automatically
- Previous/Next navigation
- Renders PDF using pdfjs-dist
- Canvas-based rendering
- Zoom controls (50% - 200%)
- Page tracking with progress saving
{
documents: {
ids: string[],
entities: { [id: string]: Document },
selectedDocumentId: string | null,
loading: boolean,
error: string | null
}
}uploadDocument- Upload new fileuploadDocumentSuccess- Upload completeduploadDocumentFailure- Upload failedloadDocuments- Load all documentsloadDocumentsSuccess- Documents loadeddeleteDocument- Delete documentdeleteDocumentSuccess- Deletion completedopenDocument- Open document for readingupdateReadingProgress- Save current page
- File upload processing
- Metadata extraction
- IndexDB operations
- Progress tracking
- documents - Stores the actual file blobs
- metadata - Stores document metadata
- Files are stored as Blobs in IndexDB
- Metadata is stored separately for quick access
- Reading progress is synced to metadata
- All data persists across browser sessions
Works in all modern browsers that support:
- IndexDB
- ES2015+
- Canvas API
- File API
- Large Files: Very large PDFs may take time to load
- EPUB Formatting: Complex EPUB layouts may not render perfectly
- Browser Storage: Limited by browser IndexDB quota (usually 50MB+)
- Search within documents
- Bookmarks and highlights
- Export reading progress
- Dark mode
- Table of contents navigation
- Text selection and notes
- Full-text search across library
- Collections/categories
- Reading statistics
If you see PDF worker errors, the CDN link for pdf.worker.js is being used. For offline development, download the worker file and update the path in pdf-reader.component.ts.
- Check browser console for errors
- Verify IndexDB is enabled in browser
- Check available storage quota
- Clear browser cache
- Check browser console
- Verify IndexDB data in DevTools
npm testnpm run buildNgRx Store DevTools are enabled in development. Install the Redux DevTools browser extension to inspect state changes.
MIT