Skip to main content

Overview

The Studley AI library is your personal collection of all generated study materials. Save quizzes, flashcards, study guides, and writing prompts to access them anytime from any device.

Accessing Your Library

1

Navigate to Library

Click “Library” in the dashboard sidebar or visit /dashboard/library.
2

View Your Items

All your saved study materials are displayed in a grid layout, sorted by creation date (newest first).

Saving Content to Library

From Generators

When you generate study materials:
1

Generate Content

Use any generator (Quiz, Flashcards, Study Guide, etc.) to create study materials.
2

Click Save

Look for the “Save to Library” button that appears for authenticated users.
3

Choose Folder (Optional)

Select a folder to organize your content, or leave unassigned for the main library.
4

Confirm Save

The content is saved to the study_items table with:
  • title: Name of the study material
  • topic: Subject or theme
  • type: quiz, flashcards, study_guide, or writing_prompt
  • content: Full JSON data of the material
  • folder_id: Optional folder assignment
  • created_at: Timestamp

From Quiz Results

After completing a quiz:
  1. View your results page
  2. Click “Save to Library” button
  3. The quiz is saved with your score, accuracy, and quiz data
  4. Access it later from the library

API Endpoint

Save to Library:
  • Endpoint: POST /api/library/save
  • Authentication: Required
  • Body: { title, topic, itemType, content, folderId? }
  • Response: { success: true, item: LibraryItem }

Library Item Types

The library supports four content types:

Quiz

  • Interactive quizzes with multiple choice questions
  • Displays with FileText icon in red
  • Route: /dashboard/view/quiz/[id]

Flashcards

  • Flip-card study sets
  • Displays with BookOpen icon in red
  • Route: /dashboard/view/flashcards/[id]

Study Guide

  • Comprehensive study notes with sections
  • Displays with Book icon in red
  • Route: /dashboard/view/notes/[id]

Writing Prompt

  • Creative or academic writing prompts
  • Displays with Sparkles icon in red
  • Route: /dashboard/view/writing/[id]

Organizing with Folders

Creating Folders

1

Open Folder Dialog

Click “New Folder” in the library or from the generator save dialog.
2

Name Your Folder

Enter a descriptive name like “Biology Finals” or “Spanish Vocab”.
3

Save Folder

The folder is created in the user_folders table with:
  • name: Folder name
  • user_id: Your user ID
  • created_at: Timestamp

Moving Items to Folders

1

Open Item Menu

Click the three-dot menu on any library item card.
2

Select Move to Folder

Choose “Move to Folder” from the dropdown.
3

Pick Destination

Select the target folder from your list of folders.
4

Confirm Move

The item’s folder_id is updated in the database.

Folder Features

  • Unlimited folders: Create as many as you need
  • No nesting: Folders are flat (no subfolders)
  • Quick access: Filter library by folder
  • Easy reorganization: Move items between folders anytime

Searching Your Library

Search Functionality

1

Click Search

Click the search icon in the sidebar or press / to focus the search box.
2

Type Query

Enter at least 2 characters to begin searching.
3

View Results

Results appear in a dropdown showing:
  • Item title
  • Item type (quiz, flashcards, etc.)
  • Creation date
4

Navigate to Item

Click a result or use arrow keys + Enter to open the item.

Search Features

  • Debounced: Waits 300ms after typing to search
  • Minimum query: 2 characters required
  • Keyboard navigation: Arrow keys to select, Enter to open, Escape to close
  • Real-time: Searches your study_items as you type

Search API

Search Endpoint:
  • Endpoint: GET /api/sidebar/search?q=query
  • Parameters: q (query string, min 2 chars)
  • Response: { results: SearchResult[] }

Filtering Library Items

Use the filter tabs at the top of your library:

Filter Options

  • All Items: Shows all study materials (default)
  • Quizzes: Only quiz items
  • Flashcards: Only flashcard sets
  • Shared With Me: Content shared by other users (see Sharing section)
Filters update the view instantly without reloading the page.

Favorites

Marking Favorites

1

Find Item

Locate the item you want to favorite in your library.
2

Click Star Icon

Click the star icon on the item card (top right corner).
3

Item Marked

The is_favorite field is set to true in the database.

Favorites Section

Favorited items appear in a special section at the top of your library:
  • Separated from regular items
  • Clearly labeled “Favorites”
  • Respect active filters (e.g., only favorite quizzes if quiz filter is active)

Unfavoriting

Click the filled star icon again to remove from favorites.

Item Actions

Available Actions

For each library item, you can:
  1. Open: Click the card to view/study the content
  2. Favorite: Star icon to mark as favorite
  3. Rename: Edit the title directly
  4. Move to Folder: Organize into folders
  5. Delete: Permanently remove the item

Renaming Items

1

Click Item Menu

Open the three-dot menu on the item card.
2

Select Rename

Click “Rename” from the dropdown.
3

Enter New Title

Type a new title in the input field.
4

Save

Press Enter or click Save to update the title in the database.

Deleting Items

1

Click Delete

Click the Trash icon or select Delete from the item menu.
2

Confirm Deletion

A confirmation dialog appears warning that this action cannot be undone.
3

Confirm

Click “Delete” to permanently remove the item from the study_items table.
Deleted items cannot be recovered. Make sure you really want to delete before confirming.

Library Statistics

At the top of your library, see an overview:
  • Total Quizzes: Count of all quiz items
  • Total Flashcards: Count of all flashcard sets
  • Other stats: Study guides, writing prompts, etc.
Statistics update in real-time as you add or remove items.

Shared Content

Shared With Me View

Content that other users have shared with you appears in a separate view:
  1. Click the “Shared With Me” filter tab
  2. See all items shared by other users
  3. View creator name and avatar
  4. Access the content but cannot edit or delete

Sharing Your Content

Currently, sharing is managed through the database. Future enhancements will include:
  • Share buttons on each item
  • Generate shareable links
  • Control who can view your content

Database Schema

study_items table

CREATE TABLE study_items (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  user_id UUID REFERENCES users(id) ON DELETE CASCADE,
  folder_id UUID REFERENCES user_folders(id) ON DELETE SET NULL,
  type TEXT NOT NULL, -- 'quiz', 'flashcards', 'study_guide', 'writing_prompt'
  title TEXT NOT NULL,
  topic TEXT,
  content JSONB NOT NULL,
  is_favorite BOOLEAN DEFAULT false,
  created_at TIMESTAMPTZ DEFAULT NOW()
);

user_folders table

CREATE TABLE user_folders (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  user_id UUID REFERENCES users(id) ON DELETE CASCADE,
  name TEXT NOT NULL,
  created_at TIMESTAMPTZ DEFAULT NOW()
);

Row Level Security

RLS policies ensure:
  • You can only see your own items and folders
  • You can only modify your own content
  • Shared items are visible but read-only

Client-Side Storage (Public Tools)

For users who aren’t logged in, content is stored in browser localStorage:
  • Prefix: quizlix_
  • Keys: quizlix_quizzes, quizlix_flashcards, quizlix_study_guides
  • Lifespan: Until browser data is cleared
  • Migration: Log in to save localStorage items to your account

API Endpoints

Get Library Items

  • Endpoint: GET /api/dashboard/library
  • Response: { items: LibraryItem[] }

Delete Item

  • Endpoint: DELETE /api/dashboard/library/[itemId]
  • Response: { success: true }

Update Item

  • Endpoint: PATCH /api/dashboard/library/[itemId]
  • Body: { title?, folder_id?, is_favorite? }
  • Response: { success: true, item: LibraryItem }

Troubleshooting

Items not appearing?

  • Refresh the page to reload data
  • Check you’re logged in to the correct account
  • Verify the item was saved successfully

Can’t find an item?

  • Use the search feature to locate by title
  • Check if it’s in a specific folder
  • Look in the “All Items” filter view

Folder not showing items?

  • Ensure items are assigned to that folder
  • Try refreshing the page
  • Check folder_id in database matches

Search not working?

  • Type at least 2 characters
  • Wait for debounce (300ms)
  • Check internet connection
  • Try exact title match

Build docs developers (and LLMs) love