Platform Architecture
inspir is built as a modern, performant web application with AI at its core.Technology Stack
Frontend
React + Vite + Tailwind CSS
- React 19 for UI components
- Vite for lightning-fast builds
- Tailwind CSS for styling
- React Router for navigation
- Framer Motion for animations
Backend
Node.js + Express
- Express 5 API server
- Multer for file uploads
- Rate limiting for security
- JWT authentication
- RESTful API design
AI Engine
Anthropic Claude
- Claude API for generation
- Context-aware responses
- Step-by-step explanations
- Multi-modal support (text + images)
- Intelligent question generation
Database & Auth
Supabase
- PostgreSQL database
- Row Level Security (RLS)
- Real-time subscriptions
- User authentication
- File storage
How It Works: End-to-End
1. User Workflow
Content Input
Users can provide study material in multiple ways:Text Input:Files are processed using:
- Direct topic description (“Quiz me on World War 2”)
- Pasted notes, articles, or study guides
- Any length from a sentence to thousands of words
Upload Handler
- Plain text: Direct extraction
- DOCX:
mammothlibrary for document parsing
AI Processing
The backend sends content to Claude API with a structured prompt:
AI Request Flow
Claude generates questions that test understanding, not just memorization. It creates distractors (wrong answers) that address common misconceptions.
Question Generation
Claude generates a mix of question types:Multiple Choice Questions (MCQs):
- 4 options (A, B, C, D)
- One correct answer
- Three plausible distractors
- Detailed explanation for each
- Open-ended responses
- Key concepts identified
- Flexible evaluation
- Comprehensive topic coverage
- 10-15 minute completion time
- Balanced difficulty progression
Storage & Retrieval
Quiz data is stored in Supabase PostgreSQL:Benefits:
Database Schema
- Users can review past quizzes anytime
- Track progress over time
- Share quizzes via unique tokens
- View attempt history and statistics
Answer Evaluation
When users submit answers, the backend evaluates them:MCQ Evaluation:Short Answer Evaluation:The AI:
- Awards full credit for correct concepts
- Gives partial credit for incomplete answers
- Identifies what’s missing or incorrect
- Provides constructive feedback
AI-Powered Features Deep Dive
Quiz Generator
The core feature that powers active recall learning:- How It Works
- Input Processing
- Rate Limiting
- Content Analysis: Claude analyzes your topic or uploaded materials
- Concept Extraction: Identifies key concepts worth testing
- Question Generation: Creates questions at appropriate difficulty
- Distractor Creation: Generates plausible wrong answers for MCQs
- Explanation Generation: Writes detailed explanations for learning
Example Quiz Structure
Doubt Solver
Instant AI-powered homework help:Text Questions
Text Questions
Users can type any question and get step-by-step solutions.Flow:
- User types question + optional subject
- Backend sends to Claude with specialized prompt
- Claude returns:
- Step-by-step solution
- Key concepts involved
- Estimated difficulty
- Solution saved to database (if authenticated)
- User can share solution via unique link
Image Upload + OCR
Image Upload + OCR
Users can upload photos of handwritten or printed problems.Multi-Modal Processing:Claude can:
- Read handwritten text
- Parse mathematical notation
- Understand diagrams and figures
- Detect subject area automatically
Sharing & History
Sharing & History
Other AI Features
Flashcard Creator
- Upload notes → AI generates Q&A flashcards
- Spaced repetition algorithm
- Track mastery per card
- Export as PDF or print
Text Summarizer
- Paste long text → get concise summary
- Adjustable summary length
- Bullet points or paragraph format
- Preserves key information
Study Guide Generator
- Upload materials → comprehensive guide
- Organized by topics
- Key terms and definitions
- Practice questions included
Math Solver
- Solve equations step-by-step
- Show work and reasoning
- Support for algebra, calculus, etc.
- Graph visualizations
Gamification System
Building lasting study habits through motivation:Study Streaks
Streak Tracking
- Visual 🔥 flame icon grows with streak length
- Leaderboard ranking based on streaks
- Badges awarded at milestones (7 days, 30 days, 100 days)
- Streak recovery: Miss 1 day? Use a streak freeze (earned every 7 days)
XP & Leveling
XP System
- Level 1: 0 XP (Beginner)
- Level 2: 100 XP (Apprentice)
- Level 3: 250 XP (Scholar)
- Level 4: 500 XP (Expert)
- Level 5+: Exponential scaling
Leaderboards
- Global: Top users by XP
- Weekly: Most active this week
- Streaks: Longest current streaks
- Category: Top in each subject area
Security & Privacy
Authentication
- Passwords hashed with bcrypt (10 salt rounds)
- JWT tokens expire after 7 days
- Refresh tokens for extended sessions
- Supabase Auth for OAuth providers
Data Protection
- Row Level Security (RLS): Users can only access their own data
- HTTPS Only: All communication encrypted
- Rate Limiting: Prevents abuse and DDoS
- Input Validation: All user input sanitized
- File Upload Security: Type and size validation
Privacy
- No tracking cookies: Only essential cookies for authentication
- Data deletion: Users can delete account + all data
- Content privacy: Study materials never shared without permission
- AI processing: Content sent to Claude API is not used for training
Performance Optimizations
- Frontend
- Backend
- AI
- Code splitting: Route-based lazy loading
- Asset optimization: Minified JS/CSS bundles
- Image optimization: Lazy loading, responsive images
- Caching: Service worker for offline support
- CDN delivery: Static assets served via CDN
Developer Resources
The inspir codebase is available for reference:Local Development
What’s Next?
Try It Now
Start using inspir today—no credit card required
Quickstart Guide
Generate your first quiz in 2 minutes