Use cases¶
This section presents the main use cases derived from the functional requirements. Each use case includes actors, requirements traceability, detailed flows, and alternative scenarios.
Use case notation¶
| Element | Description |
|---|---|
| UC-X.Y | Use case identifier (section X, item Y) |
| Actors | User types involved |
| Priority | P0-P3 (matches requirement priority) |
| Requirements | Links to FR and NFR |
| Preconditions | State required before use case |
| Main flow | Primary success scenario |
| Alternative flows | Variations and edge cases |
| Postconditions | State after successful completion |
1. User management use cases¶
UC-1.1: Create user account¶
Actors: Anonymous User → Registered User Priority: P0 Requirements: FR-1.1
Description: User creates a new account to access synchronization and cloud features.
Preconditions:
- User is not logged in
- User has valid email address
Main flow:
- User navigates to registration screen
- User enters email address and password
- System validates email format and uniqueness
- System validates password strength (8+ chars, mixed case, number)
- System creates account in inactive state
- System sends verification email
- User clicks verification link
- System activates account
- User is redirected to login screen
Alternative flows:
A1: Email already registered
- At step 3, if email exists:
- System displays "Email already registered" error
- User can choose to log in or recover password
A2: Weak password
- At step 4, if password is too weak:
- System displays password requirements
- User must enter a stronger password
A3: Verification link expired
- At step 7, if link expired (24 hours):
- System displays expiration message
- User can request new verification email
Postconditions:
- New user account exists
- User can log in with credentials
UC-1.2: Login with credentials¶
Actors: Registered User Priority: P0 Requirements: FR-1.2
Description: User authenticates using email and password.
Preconditions:
- User has registered account
- Account is verified and active
Main flow:
- User navigates to login screen
- User enters email and password
- System validates credentials
- System creates session token
- User is redirected to library
Alternative flows:
A1: Invalid credentials
- At step 3, if credentials invalid:
- System displays "Invalid email or password"
- Failed attempt is logged
- After 5 failures, temporary lockout (15 minutes)
A2: Account not verified
- At step 3, if account not verified:
- System prompts to resend verification email
A3: Account disabled
- At step 3, if account disabled:
- System displays account disabled message
- User is directed to support contact
Postconditions:
- User is authenticated
- Session token is stored on device
- User has access to their library
UC-1.3: Login with Google account¶
Actors: Registered User Priority: P1 Requirements: FR-1.3
Description: User authenticates via Google OAuth 2.0.
Preconditions:
- User has Google account
- Device has internet connection
Main flow:
- User selects "Sign in with Google"
- System redirects to Google OAuth
- User authorizes application
- Google returns authorization code
- System exchanges code for user info
- If new user, system creates account
- System creates session token
- User is redirected to library
Alternative flows:
A1: User denies authorization
- At step 3, if user denies:
- System returns to login screen
- Message: "Google sign-in cancelled"
A2: Link to existing account
- At step 6, if email matches existing account:
- System prompts to link accounts
- User confirms linking
Postconditions:
- User is authenticated
- Google account linked to Papyrus account
UC-1.4: Use application offline¶
Actors: Anonymous User, Registered User Priority: P0 Requirements: FR-1.4, NFR-2.1
Description: User accesses application without internet connection.
Preconditions:
- Application is installed on device
- For registered users: at least one previous online session
Main flow:
- User opens application without internet
- System detects offline state
- System loads local data
- User accesses library and books
- User can read, annotate, organize
- Changes are stored locally
- Offline indicator is displayed
Alternative flows:
A1: First launch (Anonymous)
- User can immediately use all local features
- No account required
A2: First launch (Registered, never synced)
- System shows "Connect to sync your data"
- User can continue with empty library
A3: Sync when online
- When internet restored:
- System begins background sync
- Pending changes indicator updates
Postconditions:
- User can use reading and management features
- Changes are queued for sync
UC-1.5: Recover password¶
Actors: Registered User Priority: P1 Requirements: FR-1.5
Description: User resets forgotten password via email.
Preconditions:
- User has registered account
- User has access to registered email
Main flow:
- User clicks "Forgot password"
- User enters registered email
- System sends recovery email with link
- User clicks link (valid 24 hours)
- User enters new password
- System validates password strength
- System updates password
- All existing sessions are invalidated
- User is redirected to login
Alternative flows:
A1: Email not found
- At step 3, system still shows success message (security)
- No email sent if account doesn't exist
A2: Link expired
- At step 4, if link expired:
- System displays expiration message
- User can request new link
Postconditions:
- Password is updated
- User must log in with new password
UC-1.6: Delete account¶
Actors: Registered User Priority: P1 Requirements: FR-1.6
Description: User permanently deletes their account and all data.
Preconditions:
- User is logged in
- User understands consequences
Main flow:
- User navigates to account settings
- User selects "Delete account"
- System displays warning about data loss
- User confirms by entering password
- System marks account for deletion
- System logs user out
- Account and data deleted within 30 days
Alternative flows:
A1: Export data first
- Before step 4, user can export all data
- See UC-2.7 for export process
A2: Cancel deletion
- Within 7 days, user can log in to cancel
- Account is restored to active state
Postconditions:
- Account is deleted
- User data removed from server
- Local data remains on device
2. Book management use cases¶
UC-2.1: Import book files¶
Actors: Reader Priority: P0 Requirements: FR-2.6, FR-7.2
Description: User adds books to library from files.
Preconditions:
- User has book files in supported format
Main flow:
- User selects "Add books"
- User chooses import source (device, cloud, URL)
- User selects files
- System uploads/imports files
- System extracts metadata from files
- System checks for duplicates
- Books are added to library
- User receives confirmation
Alternative flows:
A1: Unsupported format
- System displays format error
- Lists supported formats
A2: Duplicate detected
- System shows existing book
- User can: skip, replace, keep both
A3: Bulk import
- User selects folder
- System imports all supported files
- Progress shown for large imports
A4: Import from URL
- User enters URL
- System downloads and imports
Postconditions:
- Books are in user's library
- Metadata is populated
UC-2.2: Convert book formats¶
Actors: Reader Priority: P2 Requirements: FR-2.1
Description: User converts book to different format.
Preconditions:
- Book exists in library
- Source format supports conversion
Main flow:
- User opens book details
- User selects "Convert format"
- User chooses target format
- User sets conversion options (optional)
- System processes conversion
- Converted file is added to library
- Original file is preserved
Alternative flows:
A1: Conversion fails
- System shows error details
- User can retry with different options
A2: Large file
- Progress indicator shown
- Conversion runs in background
- Notification when complete
Postconditions:
- New file in target format exists
- Original file unchanged
UC-2.3: Edit book metadata¶
Actors: Reader Priority: P0 Requirements: FR-2.2, FR-2.13
Description: User modifies book information.
Preconditions:
- Book exists in library
Main flow:
- User opens book details
- User selects "Edit"
- User modifies metadata fields
- User saves changes
- System validates and stores changes
Alternative flows:
A1: Fetch metadata online
- User clicks "Fetch metadata"
- System searches online sources
- User reviews and selects matches
- Selected metadata is applied
A2: Edit cover image
- User can upload new cover
- User can crop/adjust cover
- User can fetch cover online
Postconditions:
- Book metadata is updated
UC-2.4: Organize books into shelves¶
Actors: Reader Priority: P0 Requirements: FR-2.9
Description: User creates and manages book collections.
Preconditions:
- User has books in library
Main flow:
- User navigates to Shelves
- User creates new shelf (name, description, color)
- User adds books to shelf
- Shelf is saved
Alternative flows:
A1: Add from library view
- User long-presses book
- User selects "Add to shelf"
- User chooses shelf(s)
A2: Create nested shelf
- User creates shelf within existing shelf
- Hierarchy is maintained
A3: Drag and drop
- User drags book to shelf
- Book is added to shelf
Postconditions:
- Books are organized in shelves
UC-2.5: Tag books¶
Actors: Reader Priority: P0 Requirements: FR-2.10
Description: User assigns colored labels to books.
Preconditions:
- User has books in library
Main flow:
- User opens book details or context menu
- User selects "Tags"
- User creates or selects tags
- Tags are applied to book
Alternative flows:
A1: Create new tag
- User enters tag name
- User selects color
- Tag is created and applied
A2: Batch tagging
- User selects multiple books
- User applies tags to all
Postconditions:
- Books have assigned tags
- Tags visible in library view
UC-2.6: Search books¶
Actors: Reader Priority: P0 Requirements: FR-2.7, FR-2.8, FR-2.11
Description: User finds books using search and filters.
Preconditions:
- User has books in library
Main flow:
- User opens search
- User enters query
- System searches metadata
- Results are displayed
- User can filter/sort results
Alternative flows:
A1: Full-text search
- User searches book contents
- Results show matched text with context
A2: Advanced filters
- User uses filter panel
- Multiple criteria combined
A3: Query language
- User types query like
author:"Name" AND year:>2000 - System parses and executes
A4: Save search
- User saves search as filter
- Filter available for reuse
Postconditions:
- Matching books are displayed
UC-2.7: Export books and data¶
Actors: Reader Priority: P0/P1 Requirements: FR-2.4, FR-2.5
Description: User exports library data for backup or migration.
Preconditions:
- User has books in library
Main flow:
- User navigates to Export
- User selects what to export (books, metadata, annotations)
- User chooses format (ZIP, JSON, CSV)
- System creates export file
- User downloads export
Alternative flows:
A1: Selective export
- User selects specific books
- Only selected items exported
A2: Export to cloud
- User chooses cloud destination
- File uploaded directly
Postconditions:
- Export file is created
- User has backup of data
UC-2.8: Scan ISBN barcode¶
Actors: Reader Priority: P2 Requirements: FR-2.12
Description: User adds physical book by scanning barcode.
Preconditions:
- Device has camera
- Physical book has ISBN barcode
Main flow:
- User selects "Scan ISBN"
- Camera opens
- User scans barcode
- System decodes ISBN
- System fetches metadata
- User reviews and confirms
- Book is added as physical
Alternative flows:
A1: Manual ISBN entry
- If scan fails, user types ISBN
- System fetches metadata
A2: No metadata found
- System shows "Not found"
- User can enter details manually
Postconditions:
- Physical book added to library
UC-2.9: Track physical book¶
Actors: Reader Priority: P1 Requirements: FR-2.14
Description: User manages physical books in library.
Preconditions:
- None
Main flow:
- User selects "Add physical book"
- User enters book details
- User sets reading status
- User can add location (e.g., "Shelf 3")
- Book is added to library
Alternative flows:
A1: Mark as lent
- User marks book as lent
- User enters borrower info
- Reminder can be set
Postconditions:
- Physical book tracked in library
3. Reading and viewer use cases¶
UC-3.1: Read books with integrated viewer¶
Actors: Reader, E-ink Reader Priority: P0 Requirements: FR-3.1
Description: User reads e-books in the viewer.
Preconditions:
- Book exists in library
- Book format is supported
Main flow:
- User opens book from library
- System loads book in viewer
- System restores last position
- User reads and navigates
- System saves progress automatically
Alternative flows:
A1: Navigate via TOC
- User opens table of contents
- User selects chapter
A2: Go to page/position
- User enters page number or percentage
- System jumps to position
A3: E-ink mode
- System detects e-ink display
- UI adapts (no animations, high contrast)
Postconditions:
- Reading position is saved
- Time tracked for statistics
UC-3.2: Customize reading experience¶
Actors: Reader, E-ink Reader Priority: P0 Requirements: FR-3.2
Description: User personalizes viewer appearance.
Preconditions:
- Book is open in viewer
Main flow:
- User opens reader settings
- User adjusts typography (font, size, spacing)
- User sets colors (background, text)
- User configures layout (margins, mode)
- Changes apply immediately
- Settings are saved
Alternative flows:
A1: Quick theme switch
- User taps theme button
- Cycles through presets
A2: E-ink optimized
- User enables e-ink mode
- High contrast, no animations
Postconditions:
- Reader customized to preference
UC-3.3: Manage reading profiles¶
Actors: Reader, E-ink Reader Priority: P1 Requirements: FR-3.3
Description: User saves and switches reader configurations.
Preconditions:
- Reader settings have been customized
Main flow:
- User opens profile management
- User creates new profile
- User names profile (e.g., "Night reading")
- Current settings saved to profile
- User can switch between profiles
Alternative flows:
A1: Set default profile
- User marks profile as default
- Applied to new books
A2: Export/import profiles
- User exports profile to file
- Can import on other devices
Postconditions:
- Profiles saved for quick switching
UC-3.4: Manage bookmarks¶
Actors: Reader Priority: P0 Requirements: FR-3.4
Description: User creates and uses bookmarks.
Preconditions:
- Book is open in viewer
Main flow:
- User taps bookmark button
- Bookmark created at current position
- User can add note (optional)
- Bookmark saved
Alternative flows:
A1: View all bookmarks
- User opens bookmark panel
- Sees list with positions
- Taps to navigate
A2: Delete bookmark
- User swipes or long-press
- Confirms deletion
Postconditions:
- Bookmark saved and accessible
4. Annotations and notes use cases¶
UC-4.1: Create text annotations¶
Actors: Reader Priority: P0 Requirements: FR-4.1
Description: User highlights text while reading.
Preconditions:
- Book is open in viewer
Main flow:
- User selects text
- Context menu appears
- User chooses highlight color
- User adds note (optional)
- Annotation saved
Alternative flows:
A1: Quick highlight
- User selects and taps color
- Instant highlight without menu
Postconditions:
- Text is highlighted
- Annotation appears in panel
UC-4.2: Create book notes¶
Actors: Reader Priority: P0 Requirements: FR-4.2
Description: User creates free-form notes for books.
Preconditions:
- Book exists in library
Main flow:
- User opens book notes
- User creates new note
- User enters title and content
- Note saved
Alternative flows:
A1: Rich text editing
- User uses formatting (bold, lists)
- Markdown syntax supported
Postconditions:
- Note attached to book
UC-4.3: Manage annotations¶
Actors: Reader Priority: P0 Requirements: FR-4.3
Description: User edits or deletes annotations.
Preconditions:
- Annotations exist for book
Main flow:
- User opens annotation panel
- User selects annotation
- User edits (color, note) or deletes
- Changes saved
Postconditions:
- Annotations updated
UC-4.4: Export annotations¶
Actors: Reader Priority: P1 Requirements: FR-4.4
Description: User exports annotations to file.
Preconditions:
- Book has annotations
Main flow:
- User opens export options
- User selects format (Markdown, PDF, TXT)
- User configures options (include context, metadata)
- System generates export
- User downloads file
Postconditions:
- Annotations exported to file
UC-4.5: Search annotations¶
Actors: Reader Priority: P1 Requirements: FR-4.5
Description: User searches through annotations.
Preconditions:
- User has annotations
Main flow:
- User opens annotation search
- User enters search query
- Results from all books shown
- User can filter by book, color, date
Postconditions:
- Matching annotations displayed
5. Progress tracking use cases¶
UC-5.1: Track reading progress¶
Actors: Reader Priority: P0 Requirements: FR-5.1
Description: System tracks and displays reading activity.
Preconditions:
- User reads books in viewer
Main flow:
- System monitors reading sessions
- System records time and pages
- User views progress dashboard
- Statistics displayed (charts, metrics)
Postconditions:
- Reading activity is tracked
- Statistics available
UC-5.2: Filter progress statistics¶
Actors: Reader Priority: P1 Requirements: FR-5.2
Description: User customizes statistics view.
Preconditions:
- Reading data exists
Main flow:
- User opens statistics
- User selects time range
- User filters by books/shelves
- Filtered results displayed
Postconditions:
- Statistics filtered to selection
6. Goal management use cases¶
UC-6.1: Create reading goals¶
Actors: Reader Priority: P1 Requirements: FR-6.1
Description: User sets reading objectives.
Preconditions:
- User wants to track goals
Main flow:
- User opens Goals
- User creates new goal
- User selects type (books, pages, time)
- User sets target and period
- Goal is saved and tracking begins
Postconditions:
- Goal is active
- Progress tracked automatically
UC-6.2: Manage goal progress¶
Actors: Reader Priority: P1 Requirements: FR-6.2, FR-6.3
Description: User and system update goal progress.
Preconditions:
- Active goal exists
Main flow:
- System updates progress automatically
- User can manually adjust if needed
- Progress displayed with visualizations
- Notifications sent at milestones
Postconditions:
- Goal progress is current
7. Storage and synchronization use cases¶
UC-7.1: Configure storage options¶
Actors: Registered User, System Administrator Priority: P0 Requirements: FR-7.1, FR-7.1.1
Description: User configures metadata server connection and file storage backend(s) for synchronization and book storage.
Preconditions:
- Application is installed
- Internet connection available (for server configuration)
Main flow (Metadata server):
- User opens Settings > Sync & Storage
- User selects metadata server option:
- Official hosted server (default)
- Self-hosted server (enter URL)
- User logs in or registers on metadata server
- System validates connection
- Sync capabilities are enabled
Main flow (File Storage Backend):
- User opens Settings > Storage > File Storage
- User clicks "Add Storage Backend"
- User selects backend type (Google Drive, WebDAV, MinIO, etc.)
- User configures credentials:
- OAuth flow for Google/OneDrive/Dropbox
- URL + credentials for WebDAV/MinIO
- System validates connection and shows storage info
- User sets backend as primary (optional)
- Backend is available for file storage
Alternative flows:
A1: Cloud storage OAuth (Google Drive, OneDrive, Dropbox)
- User clicks "Connect with [Provider]"
- OAuth popup opens
- User authorizes Papyrus access
- System stores tokens securely
- Storage folder is created automatically
A2: Self-hosted metadata server
- User enters server URL (e.g., https://papyrus.home.local)
- System tests connection and retrieves server info
- User registers or logs in on self-hosted server
- Connection is established
A3: WebDAV server (Nextcloud, etc.)
- User enters WebDAV URL
- User enters username and password
- System tests connection
- User specifies folder path
A4: MinIO/S3-compatible storage
- User enters endpoint URL
- User enters bucket name
- User enters access key and secret key
- System tests connection
A5: Local-only mode (no sync)
- User skips metadata server setup
- User uses only local storage
- All data stored on device only
- No cross-device sync available
A6: Dedicated Papyrus server for files
- User selects "Papyrus Server" as file storage
- Files stored on same server as metadata
- Single server handles everything
Postconditions:
- Metadata server connected (optional)
- File storage backend(s) configured
- Cross-device sync enabled (if metadata server connected)
- Books can be uploaded to selected storage
See Server Architecture for technical details.
UC-7.2: Process scanned documents¶
Actors: Reader Priority: P2 Requirements: FR-7.3
Description: System applies OCR to scanned books.
Preconditions:
- PDF with scanned images uploaded
Main flow:
- System detects scanned content
- System queues OCR processing
- OCR runs in background
- Text extracted and indexed
- User notified of completion
Postconditions:
- Book content is searchable
UC-7.3: Synchronize data across devices¶
Actors: Registered User Priority: P0 Requirements: FR-5.3, NFR-2.1
Description: System keeps metadata, reading progress, and annotations consistent across devices via the metadata server.
Preconditions:
- User logged into metadata server on multiple devices
- At least one device has internet connection
Main flow:
- User makes changes on device A (e.g., reads pages, adds annotation)
- Changes are saved locally immediately
- Changes are queued in sync queue
- When online, client pushes changes to metadata server
- Metadata server records changes with timestamps
- Device B polls or receives push notification
- Device B fetches changes from metadata server
- Device B applies changes to local storage
- UI updates to reflect synchronized state
Synchronized data:
- Reading position (page, chapter, percentage)
- Annotations (highlights, notes)
- Bookmarks
- Book metadata edits
- Shelf and tag assignments
- Reading goals and progress
- Reading session statistics
Alternative flows:
A1: Conflict detected (same book, both devices)
- System compares timestamps
- For reading position: latest timestamp wins
- For metadata: merge non-conflicting fields, latest wins for conflicts
- For annotations: keep both (no conflict, additive)
- User notified of resolved conflicts (optional)
A2: Offline changes accumulated
- User works offline on device A
- Multiple changes queued locally
- When device comes online, all queued changes sync
- Server processes changes in timestamp order
A3: Book file sync
- If book exists on server but not locally
- User can download for offline access
- File downloaded from configured storage backend
- Local reading position preserved after download
A4: Metadata server unavailable
- Client detects connection failure
- UI shows "Offline" or "Sync unavailable" indicator
- All changes continue to be saved locally
- Sync resumes automatically when server available
Postconditions:
- All devices have consistent metadata
- Reading position synchronized
- Annotations available on all devices
See Server Architecture for sync details.
UC-7.4: Browse OPDS catalog¶
Actors: Reader Priority: P2 Requirements: FR-7.5
Description: User downloads books from online catalogs.
Preconditions:
- OPDS catalog URL known
- Internet connection available
Main flow:
- User adds OPDS catalog URL
- System loads catalog
- User browses or searches
- User selects book to download
- Book added to library
Alternative flows:
A1: Protected catalog
- User enters credentials
- System authenticates
Postconditions:
- Book downloaded to library
Use case summary¶
By priority¶
| Priority | Use Cases | Description |
|---|---|---|
| P0 | UC-1.1, UC-1.2, UC-1.4, UC-2.1, UC-2.3, UC-2.4, UC-2.5, UC-2.6, UC-2.7, UC-3.1, UC-3.2, UC-3.4, UC-4.1, UC-4.2, UC-4.3, UC-5.1, UC-7.1, UC-7.3 | MVP critical |
| P1 | UC-1.3, UC-1.5, UC-1.6, UC-2.9, UC-3.3, UC-4.4, UC-4.5, UC-5.2, UC-6.1, UC-6.2 | MVP high priority |
| P2 | UC-2.2, UC-2.8, UC-7.2, UC-7.4 | Post-MVP |
By actor¶
| Actor | Primary use cases |
|---|---|
| Anonymous User | UC-1.4 |
| Registered User | UC-1.1, UC-1.2, UC-1.3, UC-1.5, UC-1.6, UC-7.1, UC-7.3 |
| Reader | UC-2.x, UC-3.x, UC-4.x, UC-5.x, UC-6.x |
| E-ink Reader | UC-3.1, UC-3.2, UC-3.3 |
| System Administrator | UC-7.1 |