Skip to main content

Overview

Your Library is the central hub for managing your entire story collection. Browse chronologically, explore patterns, track key moments, and compile stories into NFT books.
Smart Organization: Stories grouped by month, with tabs for different views (stories, books, key moments, themes, life areas).

Library Interface

Month-by-Month Timeline
  • Stories and books grouped by date
  • Collapsible month sections
  • Current month highlighted with colored dot
  • Shows count badges (e.g., “5 stories, 2 books”)
Click month header to collapse/expand. Perfect for quickly navigating years of entries.

Story Cards

Card Layout (app/library/LibraryPageClient.tsx:877-1016)

Top Row:
  • 📄 Icon (story) or 📚 (book)
  • Title (truncated to 1 line)
  • Mood badge (if not neutral)
Middle:
  • Content preview (2 lines)
  • Tags (up to 3 shown)
Bottom Row:
  • 👁️ Views count
  • ❤️ Likes count
  • 🌍 Public / 🔒 Private indicator
  • 🔊 Has audio indicator
  • 📅 Date (story_date for entries, created_at for books)
Hover Effects:
  • Shadow grows on hover
  • Share icon appears
  • Slight upward lift animation

Visibility Indicators

IconMeaningAccess
🌍 GlobePublicVisible on social feed, anyone can view
🔒 LockPrivateOnly you can access, requires authentication
🔊 VolumeHas audioStory includes voice recording

Search & Filtering

Search Bar (app/library/LibraryPageClient.tsx:478-490)

1

Text Search

Search across:
  • Story titles
  • Content (full-text)
  • Tags
Search is case-insensitive and matches partial words (“tok” finds “Tokyo”).
2

Filter by Tab

Combine search with tab selection:
  • Search in “Themes” tab → filters by theme name
  • Search in “Stories” tab → searches only journal entries
  • Search in “All” tab → searches everything
3

Clear Search

Click ❌ in search bar or delete text to show all entries.

Compiling Books

Multi-Select Mode (app/library/LibraryPageClient.tsx:313-396)

1

Start Compilation

Click Compile Book button in Quick Actions section.What happens:
  • Cards enter selection mode
  • Checkboxes appear on story cards
  • “Cancel” and “Create Book (n)” buttons replace actions
2

Select Stories

Click story cards to toggle selection:
  • ✅ Blue border = selected
  • ⬜ Gray border = not selected
  • Books are not selectable (only journal entries)
Minimum 2 stories required to create a book.
3

Create Book Metadata

Click Create Book (n) button. Dialog opens:Required Fields:
  • Book Title: Name for your collection
  • Description: What this book is about
Metadata Generation:
{
  "name": "Summer Memories 2024",
  "description": "Stories from my trip to Japan",
  "external_url": "https://estory.vercel.app",
  "attributes": [
    { "trait_type": "Author", "value": "Your Name" },
    { "trait_type": "Stories", "value": 5 }
  ],
  "stories": [
    { "title": "Day 1 - Arrival", "content": "...", "audio": "...", "date": "2024-07-01" },
    ...
  ]
}
4

IPFS Upload

Book metadata uploaded to IPFS via Pinata:
  • Returns IPFS hash (e.g., QmX...)
  • Token URI: ipfs://{hash}
  • Immutable and permanent
IPFS upload is irreversible. Double-check metadata before creating.
5

NFT Minting

Smart Contract Interaction:Calls StoryNFT.mintBook(tokenURI) on Base Sepolia:
  • Mints ERC-721 NFT to your wallet
  • Pays 0.001 ETH mint fee
  • You sign transaction in wallet
  • NFT appears in your wallet (OpenSea, etc.)
Contract: 0x6D37ebc5... (see lib/contracts.ts for full address)
6

Database Record

Book saved to books table via /api/books POST:Fields:
  • author_id, author_wallet: Your identifiers
  • title, description: Book metadata
  • story_ids: Array of included story IDs
  • ipfs_hash: Content address
  • created_at: Timestamp
Success toast: “Book Created & Minted!”

Daily Journal Compilation

If you record 2+ stories on the same day, a special prompt appears in Profile page:“Daily Recap Available”
  • Bundles all today’s stories into one book
  • Auto-generates title: “Daily Journal -
  • One-click compilation
  • Perfect for daily journaling habit
Daily journals are a great way to build a consistent NFT collection.

Statistics

Quick Stats Cards (app/library/LibraryPageClient.tsx:443-475)

Total Stories

Count of all journal entries (excludes books).

Key Moments

Stories marked as canonical (important milestones).

Books Created

Number of compiled NFT collections.

Months Active

How many months you’ve been journaling.

Activity Insights

Stats are real-time—no caching. Reflect immediate changes after saving stories or creating books.

Patterns & Discovery

Themes View (components/patterns/ThemesView.tsx)

AI-Generated Themes:Gemini 2.5 Flash analyzes story content and extracts recurring themes:
  • Gratitude
  • Challenge & Resilience
  • Personal Growth
  • Relationships
  • Celebration
  • Reflection
Theme Groups:
  • Each theme shows story count
  • Click to expand and view stories
  • Color-coded badges
  • Sorted by frequency (most common first)
Themes reveal patterns in your journaling. Notice what you write about most!

Life Domains View (components/patterns/DomainsView.tsx)

AI categorizes stories into life areas:
  • Work & Career: Job, projects, professional growth
  • Relationships: Family, friends, romance
  • Health & Wellness: Physical health, mental health, fitness
  • Finance: Money, investments, financial goals
  • Personal Growth: Learning, skills, self-improvement
  • Leisure & Hobbies: Travel, entertainment, hobbies
  • Spirituality: Faith, meditation, purpose
Visual Distribution:
  • Pie chart shows percentage per domain
  • Click domain to filter stories
  • Helps identify imbalance (e.g., too much work, not enough leisure)
Domain insights powered by usePatterns hook (app/hooks/usePatterns.ts).

Month Grouping Logic

How Stories are Grouped (app/library/LibraryPageClient.tsx:98-145)

Key Dates:
  • Stories: Grouped by story_date (when memory occurred)
  • Books: Grouped by created_at (when book was compiled)
Sorting:
  1. Groups sorted newest month first (descending)
  2. Within each group, entries sorted by date (descending)
  3. Current month highlighted with special styling
Collapsed State:
  • All months start expanded
  • Click month header to collapse
  • State persists in component (not localStorage)
  • Refreshing page resets to all expanded
Use collapse feature to hide old entries when browsing recent stories.

Troubleshooting

Possible causes:
  • Story is still being saved (wait for toast confirmation)
  • Database sync delay
  • You’re signed in with different account
Solution:
  1. Refresh the page (library fetches on mount)
  2. Check Profile page—does story count increase?
  3. Verify you’re signed in (check nav bar for wallet address)
Common issues:
  • Insufficient ETH for gas fees
  • You rejected transaction in wallet
  • Network congestion (Base Sepolia)
Solution:
  1. Get testnet ETH from Base Sepolia faucet
  2. Approve transaction when prompted
  3. Wait 30 seconds, try again if failed
  4. Check wallet for “Pending” transactions
Why this happens:
  • AI analysis not complete yet (takes 5-10 seconds after saving)
  • None of your stories marked as canonical
  • Analysis failed (check console for errors)
Solution:
  1. Wait a minute, refresh library
  2. Mark stories as canonical manually (coming soon)
  3. Check browser console for API errors
Troubleshooting:
  • Check spelling (search is case-insensitive but exact match)
  • Try searching single words instead of full phrases
  • Clear search and browse manually
  • Story might be in different month than expected
Example: ❌ “Tokyo trip day one” → no match ✅ “Tokyo” → finds all Tokyo stories

Next Steps

Cognitive Insights

Click any story card to see full content, AI insights, and CRE verification.

Share on Social Feed

Make stories public to share with the iStory community.

Build docs developers (and LLMs) love