StudyWise AI is an intelligent study platform that transforms user-uploaded documents into personalized practice tests with AI-powered question generation and performance insights.
Location: Dashboard (client/src/pages/dashboard.tsx)
Process:
- User accesses dashboard from landing page
- Uploads documents via drag-and-drop or file picker
- Supported formats: PDF, DOCX, Markdown, Plain Text
- Document Processing (
client/src/utils/documentProcessor.ts):- PDF files: Processed using PDF.js library to extract text content
- DOCX files: Converted using Mammoth.js library
- Text/Markdown: Direct text extraction
- Content appears in textarea for review/editing
- Auto-extraction of topics using frequency analysis
- Manual topic addition/removal supported
Location: Dashboard → Test Generation Process:
- User clicks "Generate with Defaults" or "Customize"
- Default Configuration:
- 10 Multiple Choice Questions (MCQ)
- Medium difficulty
- Auto-generated title from content
- Auto-detected topics
- Custom Configuration:
- Question types: MCQ, True/False
- Difficulty levels: Easy, Medium, Hard
- Question count: 5-30 questions
- Custom title and topics
AI Service (server/services/AIService.ts):
- Multi-provider AI system (Gemini, OpenRouter with GPT/Claude)
- Content hashing for caching
- Prompt engineering for educational question generation
- Response validation and error handling
- Questions include source text references
Location: TestPreviewOverlay (client/src/components/test/TestPreviewOverlay.tsx)
Features:
- Review generated questions before starting
- Regenerate questions with different settings
- View source content references
- Start test with optional time limit
- Auto-save test to library upon generation
Location: TestTakingOverlay (client/src/components/test/TestTakingOverlay.tsx)
Process:
- Timer functionality (optional)
- Question navigation
- Answer selection and storage
- Progress tracking
- Test completion handling
Location: Test workflow (client/src/stores/useTestWorkflow.ts)
Process:
- Answer validation and scoring
- Score Calculation:
- Percentage based on correct answers
- Time tracking (if timed)
- Data Storage:
- Test results saved to
test_resultstable - Session data in
test_sessionstable - User answers stored as JSONB
- Test results saved to
Location: AI Service insights endpoint Process:
- Input Data:
- Test score and performance metrics
- Incorrect questions analysis
- Source content context
- User answer patterns
- AI Analysis (
server/services/AIService.ts):- Performance assessment
- Strength/weakness identification
- Study recommendations
- Focus area suggestions
- Fallback System: Basic insights if AI fails
Location: TestResultsOverlay (client/src/components/test/TestResultsOverlay.tsx)
Features:
- Score display with percentage
- Time taken (if applicable)
- Question-by-question review
- AI-generated insights:
- Overall performance summary
- Strengths identified
- Weaknesses to address
- Study recommendations
- Focus areas for improvement
- Options: Retake test, retake wrong questions, return to library
Location: Library page (client/src/pages/library.tsx)
Features:
- Automatic Test Saving:
- Tests saved to
teststable upon generation - Questions stored in
questionstable - Metadata includes source content
- Tests saved to
- Library Operations:
- View all saved tests
- Edit test notes/content
- Start existing tests
- Delete tests
- Test Regeneration:
- Modify existing tests
- Regenerate questions from same source
- Update configurations
Location: Scores tab (integrated with library/results) Data Storage:
- All test results in
test_resultstable - Performance analytics via database views
- Learning streaks and goals tracking
Dashboard → Document Upload → Text Processing → Test Generation → Preview → Taking → Results → Library
API Routes → AI Service → Database Operations → Response Formatting
User Input → Document Processing → AI Question Generation → Test Creation → Session Management → Results Analysis → Insights Generation → Data Persistence
- Dashboard: Entry point, document upload, test generation
- TestPreviewOverlay: Question review and test configuration
- TestTakingOverlay: Interactive test interface with timer
- TestResultsOverlay: Results display with AI insights
- Library: Test management and storage
- AIService: Multi-provider AI question generation and insights
- DocumentProcessor: File format conversion to text
- API Service: Client-server communication
- useTestStore: Test generation and question management
- useLibraryStore: Test library operations
- useTestSessionStore: Active test session management
- useTestWorkflow: Test completion and results handling
- tests: Test metadata and configuration
- questions: Individual questions with answers
- test_sessions: Active test attempts
- test_results: Completed test scores and analytics
- profiles: User information and preferences
- Content analysis and topic extraction
- Question type and difficulty adaptation
- Source text referencing for answer validation
- Score analysis and performance categorization
- Weakness identification from incorrect answers
- Personalized study recommendations
- Learning pattern recognition
- Upload: User uploads study material (PDF/DOCX/TXT/MD)
- Process: Content converted to text and displayed for review
- Generate: AI creates questions based on content and user preferences
- Preview: User reviews and can regenerate questions
- Take: Interactive test with optional timer
- Submit: Answers processed and scored
- Analyze: AI generates performance insights
- Review: Results displayed with recommendations
- Save: Test automatically saved to library for future use
- Reuse: User can retake, modify, or regenerate tests
- Document Processing: Graceful failure with user feedback
- AI Generation: Multi-provider fallback system
- Test Taking: Auto-save of progress
- Insights: Basic insights if AI analysis fails
- Network Issues: Offline capability for saved tests
- Caching: AI responses cached by content hash
- Lazy Loading: Components loaded as needed
- Database Indexing: Optimized queries for test retrieval
- CDN: Static assets served via CDN
- Progressive Loading: UI loads incrementally
This comprehensive flow ensures a seamless experience from document upload to actionable learning insights, with robust error handling and performance optimizations throughout the platform.