Skip to main content
New to iStory? This guide will walk you through creating your first voice journal entry in just a few minutes.

What You’ll Build

By the end of this guide, you’ll have:
  • ✅ Connected your account
  • ✅ Recorded your first story using voice
  • ✅ Enhanced it with AI
  • ✅ Saved it permanently with encryption
1

Sign In to iStory

iStory supports two authentication methods:Click the “Start Journaling — Free” button on the homepage:
// Authentication happens via Supabase
const { signInWithGoogle } = useAuth();
await signInWithGoogle();
You’ll be redirected to Google’s OAuth consent screen. After authorization, you’ll be automatically redirected back to iStory.

Option 2: Web3 Wallet

Connect your MetaMask or compatible wallet:
app/api/auth/nonce/route.ts
// 1. Client fetches a nonce
const response = await fetch(`/api/auth/nonce?address=${address}`);
const { nonce, message } = await response.json();

// 2. Sign the message containing the nonce
const signature = await signMessageAsync({ message });

// 3. Submit signature for verification
await fetch('/api/auth/login', {
  method: 'POST',
  body: JSON.stringify({ address, signature, message })
});
Security Note: Wallet authentication uses server-generated nonces with 5-minute expiry to prevent signature replay attacks.
After signing in, you’ll see your profile info in the top right corner.
2

Navigate to Record Page

Click the “Record New Story” button or navigate to /record.You’ll see the recording interface with:
  • 🎙️ Microphone button for voice recording
  • 📝 Text editor for transcription
  • ✨ AI enhancement tools
  • 💾 Save options
Record page interface
3

Record Your Story

Start Recording

Click the microphone button to start recording:
app/record/RecordPageClient.tsx
const startRecording = async () => {
  const stream = await navigator.mediaDevices.getUserMedia({
    audio: {
      echoCancellation: true,
      noiseSuppression: true,
      sampleRate: 16000,
    },
  });

  const mediaRecorder = new MediaRecorder(stream);
  mediaRecorder.start();
  setIsRecording(true);
};
Just talk naturally about:
  • Your day
  • A memory or experience
  • Something on your mind
  • A realization or insight
The recording duration will be displayed while you speak. Click Stop when you’re done.

Transcribe Your Audio

After stopping, your audio is automatically transcribed using ElevenLabs Scribe:
const transcribeAudio = async (audioBlob: Blob) => {
  const formData = new FormData();
  formData.append('audio', audioBlob, 'recording.webm');

  const response = await fetch('/api/ai/transcribe', {
    method: 'POST',
    headers: await getAuthHeaders(),
    body: formData,
  });

  const { text } = await response.json();
  setTranscribedText(text);
};
Pro tip: You can also type directly into the text editor if you prefer writing to speaking.

Response Example

{
  "text": "Today was really interesting. I had a long conversation with my friend about the future of AI and how it might change the way we work. It made me think about what skills will be valuable in 10 years."
}
4

Enhance with AI (Optional)

Click the “Enhance with AI” button to polish your text:
const enhanceText = async () => {
  const response = await fetch('/api/ai/enhance', {
    method: 'POST',
    headers: { 
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json' 
    },
    body: JSON.stringify({ text: transcribedText }),
  });

  const { text: enhanced } = await response.json();
  setTranscribedText(enhanced);
};
AI enhancement provides:
  • ✍️ Grammar and spelling corrections
  • 🎨 Improved clarity and flow
  • 💡 Better sentence structure
Before/After is saved: Your original text is preserved so you can undo changes if needed.

Before Enhancement

today was really interesting i had conversation with friend about ai 
and future and it made me think about skills

After Enhancement

Today was incredibly insightful. I had a deep conversation with a 
friend about artificial intelligence and its implications for the 
future. It prompted me to reflect on which skills will remain 
valuable a decade from now.
5

Save Your Story

Add Metadata

Before saving, you can add:
  • Title (auto-generated if blank)
  • Mood (happy, reflective, anxious, etc.)
  • Tags (topics, themes)
  • Visibility (public/private)
  • Date (can backdate entries)

Click Save

app/api/journal/save/route.ts
export async function POST(request: NextRequest) {
  // 1. Validate authentication
  const authenticatedUserId = await validateAuthOrReject(request);
  
  // 2. Get user's wallet address
  const { data: user } = await admin
    .from("users")
    .select("wallet_address")
    .eq("id", authenticatedUserId)
    .single();

  // 3. Insert story into database
  const { data: story } = await admin
    .from("stories")
    .insert({
      author_id: authenticatedUserId,
      author_wallet: user.wallet_address,
      title: title || `Journal Entry ${new Date().toLocaleDateString()}`,
      content,
      mood: mood || 'neutral',
      tags: tags || [],
      has_audio: !!hasAudio,
      audio_url: audioUrl || null,
    })
    .select()
    .single();

  // 4. Trigger AI analysis (background)
  fetch('/api/ai/analyze', {
    method: 'POST',
    body: JSON.stringify({ storyId: story.id, storyText: content }),
  });

  return NextResponse.json({ success: true, data: story });
}

Cloud Storage

Your story is saved to Supabase (PostgreSQL) with full encryption

Local Vault

Optionally encrypted client-side using AES-256-GCM in IndexedDB

What Happens After Save?

  1. Story saved to database with your author ID
  2. AI analysis triggered (extracts themes, emotions, entities)
  3. Audio uploaded to Supabase Storage (if you recorded)
  4. Local vault copy created (if vault is unlocked)
  5. CRE verification queued (blockchain attestation)
Success! Your story is now permanently saved. You’ll see a success message and can view it in your Library.
6

Explore Your Story

Navigate to Library (/library) to see your saved stories.

View AI Insights

Click on any story to see AI-generated insights:
components/StoryInsights.tsx
const fetchMetadata = async () => {
  const res = await fetch(`/api/stories/${storyId}/metadata`);
  const { metadata } = await res.json();
  
  // metadata includes:
  // - themes: ["growth", "career", "technology"]
  // - emotional_tone: "reflective"
  // - life_domain: "professional_development"
  // - entities: { people: [], places: [], times: [] }
  // - significance_score: 7.5
  
  setMetadata(metadata);
};
AI insights panel

Insights Include

  • 🧠 Themes: Key topics extracted from your story
  • 💭 Emotional Tone: Detected mood (hopeful, reflective, joyful)
  • 🏷️ Life Domains: Categories (relationships, work, health, etc.)
  • 👥 Entities: People, places, and times mentioned
  • Significance Score: AI-rated importance (0-10)
Example AI Metadata
{
  "themes": ["technology", "future-planning", "skill-development"],
  "emotional_tone": "contemplative",
  "life_domain": "professional_development",
  "entities": {
    "people": ["friend"],
    "places": [],
    "times": ["today", "10 years"]
  },
  "significance_score": 7.2,
  "word_count": 142,
  "reading_time_minutes": 1
}

Next Steps

Explore Features

Learn about AI patterns, vault encryption, and blockchain verification

Set Up Local Vault

Enable client-side encryption for maximum privacy

Share Stories

Make stories public and engage with the community

API Reference

Integrate iStory with your own applications

Common Questions

Transcription typically takes 2-5 seconds using ElevenLabs Scribe. The API processes audio at high speed with 95%+ accuracy.
Yes, if you record audio, it’s uploaded to Supabase Storage and linked to your story. You can play it back anytime from the Library or Story detail page.
Yes! Click on any story in your Library and select “Edit” to modify the title, content, mood, tags, or visibility.
Your draft is auto-saved to sessionStorage every 500ms. If you reload the page, you’ll see a “Restored unsaved draft” message.
From the Library, click the three-dot menu on any story card and select “Delete”. This action is permanent.

Technical Details

Authentication Flow

Recording Flow

Ready to dive deeper? Check out the Features Overview to learn about AI patterns, social features, and blockchain permanence.

Build docs developers (and LLMs) love