Inspiration
CBC Tutor: Building an AI-Powered Learning Assistant 🧠
Inspiration 💡
Kenya's transition to the Competency-Based Curriculum (CBC) represents a fundamental shift from rote learning to skill-based education. However, students often struggle with the new learning methodologies that emphasize understanding over memorization. We were inspired to create CBC Tutor after witnessing students' challenges in adapting to this new system.
The key insight was that students needed a privacy-first AI companion that could help them:
- Take structured notes aligned with CBC's competency framework
- Test their understanding through interactive quizzes
- Track their learning progress over time
- Access multilingual support for Kenya's diverse linguistic landscape
What We Learned 📚
Chrome AI APIs: The Future of Local AI
Working with Chrome's built-in AI APIs was revolutionary. We discovered that modern browsers can now run sophisticated AI models locally, eliminating privacy concerns and server costs. Key learnings included:
- Gemini Nano Integration: Chrome's on-device AI model provides summarization, rewriting, and translation capabilities
- Privacy by Design: All processing happens locally - no data leaves the user's device
- Performance Optimization: Local AI is faster than cloud APIs for many tasks
Advanced Web Technologies
- IndexedDB Mastery: Learned to store complex data structures including base64 images and nested quiz results
- React Router Integration: Implemented proper URL-based navigation for a single-page application
- TypeScript Interfaces: Created comprehensive type definitions for AI activities and learning data
Educational Technology Principles
- Competency-Based Assessment: Designed quiz systems that test understanding rather than recall
- Progress Visualization: Implemented charts showing learning trends over time
- Adaptive Learning: AI adjusts content difficulty based on user performance
Architecture Overview
┌─────────────────────────────────────────────────────────────┐
│ CBC Tutor Architecture │
├─────────────────────────────────────────────────────────────┤
│ Frontend (React + TypeScript) │
│ ├── Components Layer │
│ ├── Hooks Layer (AI Integration) │
│ ├── Utils Layer (Storage, Auth, Formatting) │
│ └── Types Layer (TypeScript Definitions) │
├─────────────────────────────────────────────────────────────┤
│ Browser APIs │
│ ├── Chrome AI APIs (Gemini Nano) │
│ ├── IndexedDB (Local Storage) │
│ ├── Web Crypto API (Authentication) │
│ └── File API (Image Processing) │
├─────────────────────────────────────────────────────────────┤
│ Local Device Storage │
│ ├── Encrypted User Data │
│ ├── Base64 Images │
│ ├── Quiz Results & Progress │
│ └── AI Activity History │
└─────────────────────────────────────────────────────────────┘
src/
├── components/ # React components
│ ├── Editor.tsx # Main editor container with AI integration
│ ├── EditorWelcome.tsx # Welcome screen for new users
│ ├── WelcomeScreen.tsx # App welcome with feature overview
│ ├── LoginForm.tsx # Authentication interface
│ ├── ModelLoadingAnimation.tsx # AI loading states
│ ├── editor/ # Editor-specific components
│ │ ├── NotesSidebar.tsx # Notes list and navigation
│ │ ├── TopicTagsHeader.tsx # Topic/tags input with help tips
│ │ ├── EditorToolbar.tsx # AI tools and actions toolbar
│ │ ├── AIActivityPanel.tsx # AI history and recovery panel
│ │ └── MobileNotesPanel.tsx # Mobile-responsive notes panel
│ ├── summarizer/ # AI Summarizer components
│ │ ├── SummarizerPanel.tsx # Main summarizer container
│ │ ├── TreeVisualization.tsx # ReactFlow hierarchical tree
│ │ ├── CustomNodes.tsx # Topic/Tag/Note node components
│ │ ├── SummaryCards.tsx # Note summary display cards
│ │ ├── QuizDialog.tsx # Quiz interface and results
│ │ └── ProgressCharts.tsx # Learning progress visualization
│ └── Translator.tsx # Language translation with history
├── hooks/ # Custom React hooks
│ └── useAI.ts # Chrome AI API wrapper
├── utils/ # Utility functions
│ ├── chrome-ai.ts # AI API helpers
│ ├── storage.ts # IndexedDB operations with quiz/summary storage
│ ├── auth.ts # Local authentication
│ └── textFormatter.ts # Markdown & text processing
├── types/ # TypeScript definitions
│ └── chrome-ai.d.ts # Extended Note interface with quizzes & summaries
└── styles/ # CSS and styling
What it does
Creating Notes
- Fill Required Fields: Enter title, topic, tags, and content
- Use AI Features: Select text to rewrite, clean, or translate
- Upload Images: Extract text from images with OCR
- Track AI History: View all AI operations in the side panel
- Recover Text: Click recover on any AI result to restore it
Taking Quizzes
- Generate Summary: Click on any note to create AI summary
- Start Quiz: Click "Test Your Understanding" for 5 questions
- Review Results: See detailed breakdown of correct/incorrect answers
- Track Progress: View progress charts to monitor improvement
- Review History: Click on any past quiz to see full details
Smart Note Editor
- Structured Note Creation: Separate fields for title, topic, tags, and content
- AI Text Enhancement: Select text to rewrite, clean, or translate
- OCR Integration: Upload images to extract and format text automatically
- AI Activity Tracking: Complete history of all AI operations per note
- Recovery System: Restore any previous AI result with one click
- Validation System: Required field warnings prevent incomplete notes
- Auto-Complete: Smart suggestions for topics and tags
AI Summarizer & Quizzes
- Note-Specific Summaries: Individual summaries for each note with persistent storage
- Comprehensive Quizzes: 5-question multiple choice tests based on action items
- Detailed Quiz Review: Full question-by-question analysis with correct answers
- Progress Visualization: Color-coded progress bars showing improvement over time
- Performance Analytics: Average scores and attempt tracking
- Mobile Quiz Access: Floating button interface for mobile devices
- Topic Organization: Notes grouped by topics for better study organization
Advanced Translation
- Translation History: Persistent storage of all translation attempts
- Clickable History: Reuse previous translations with one click
- Multi-Language Detection: Support for 10+ languages with confidence scoring
- Real-Time Processing: Instant language detection as you type
How we built it
Frontend Framework React 18.2+ with TypeScript 5.0+ Vite 4.0+ (Lightning-fast build tool) React Router 6.0+ (URL-based navigation)
Styling & UI Tailwind CSS 3.0+ (Utility-first styling) Framer Motion (Smooth animations) Lucide React (Modern icon library) React Flow (Graphical Visualization)
Browser APIs Chrome AI APIs (Gemini Nano integration) IndexedDB (Local data persistence) Web Crypto API (Secure authentication) File API (Image processing & OCR)
Challenges we ran into
1. Chrome AI API Limitations 🔬
Challenge
Chrome AI APIs are experimental and require specific browser configurations, making them inaccessible to many users.
Technical Issues:
- APIs only available in Chrome 127+ with experimental flags enabled
- Inconsistent availability across different Chrome installations
- No fallback mechanisms for unsupported browsers
- Limited documentation for experimental features
Solution
Warns the user about the AI unavailability
Impact: Created comprehensive setup documentation and implemented fallback mechanisms for core functionality.
2. Image Persistence Nightmare 📸
Challenge
Browser blob URLs don't persist across sessions, causing uploaded images to disappear when users reload the app.
Technical Problem:
// This doesn't work - blob URLs are temporary
const imageUrl = URL.createObjectURL(file);
// After page reload: blob:http://localhost:5173/abc123 becomes invalid
Solution
Converted all images to base64 strings for permanent storage
3. Complex State Management 🔄
Challenge
Managing interconnected data (notes, summaries, quizzes, AI history, translations) without a state management library.
Complexity Issues:
- AI activity history per note
- Quiz results linked to summaries
- Translation history persistence
- Progress tracking across multiple data sources
- Real-time UI updates
Solution
Implemented a comprehensive TypeScript interface system
Impact: Created a robust data management system without external dependencies.
4. Mobile Responsiveness Complexity 📱
Challenge
Complex UI components (AI panels, quiz dialogs, progress charts) needed to work seamlessly on mobile devices.
Design Problems:
- Limited screen space for multiple panels
- Touch interactions for AI features
- Quiz interface on small screens
- Progress charts readability
Solution
Implemented floating panel systems and responsive layout
Impact: Achieved full mobile functionality with intuitive touch interactions.
5. Performance Optimization 🚀
Challenge
Large notes, multiple AI operations, and complex data structures could slow down the application significantly.
Performance Issues:
- Large text processing delays
- Multiple simultaneous AI operations
- IndexedDB query performance
- Memory leaks from AI models
Solution
Implemented comprehensive optimization strategies like caching responses.
Impact: Achieved smooth performance even with hundreds of notes and extensive AI usage.
6. TypeScript Integration Challenges 🔧
Challenge
Chrome AI APIs lack official TypeScript definitions, requiring custom type declarations for experimental features.
Type Safety Issues:
- No official @types package for Chrome AI
- Experimental API signatures changing
- Complex nested interfaces for AI responses
- Type safety for IndexedDB operations
Impact: Achieved full type safety while working with experimental APIs.
7. Authentication Without Servers 🔐
Challenge
Implementing secure authentication in a completely client-side application without traditional server-side validation.
Security Concerns:
- Password storage without server validation
- Session management in browser storage
- Data encryption with client-side keys
- Protection against XSS attacks
Solution
Implemented local authentication with proper security measures:
Solution
Created comprehensive type definitions
Accomplishments that we're proud of
🔒 Privacy-First AI Education Platform
Built the first educational AI assistant that processes everything locally - zero data leaves the user's device. This breakthrough addresses major privacy concerns in educational technology while maintaining full AI capabilities.
Technical Achievement:
// 100% local AI processing
const enhanceText = async (text: string) => {
const rewriter = await window.ai.rewriter.create();
return await rewriter.rewrite(text); // Processed locally
};
🧠 Intelligent Quiz Generation System
Created an AI system that generates educationally meaningful quizzes from student notes, focusing on comprehension rather than memorization - perfectly aligned with CBC's competency-based approach.
Educational Impact:
- Automatic difficulty adjustment based on content complexity
📊 Comprehensive Progress Tracking
Implemented visual progress analytics that help students monitor their learning velocity and identify knowledge gaps through interactive charts and detailed quiz history.
Learning Analytics:
// Mathematical model for learning efficiency
const learningEfficiency = (comprehensionScore, usageFrequency, timeInvestment) => {
return (comprehensionScore * usageFrequency * 1.0) / timeInvestment;
};
🌐 Advanced Multilingual Support
Built sophisticated translation capabilities with persistent history and real-time language detection, supporting Kenya's diverse linguistic landscape with 10+ languages.
Language Features:
- Auto-detection with confidence scoring
- Translation history with one-click reuse
- Real-time language detection as you type
- Support for English, Swahili, French, Spanish, and more
🔄 AI Recovery System
Innovated a unique AI activity history feature that tracks every AI operation and allows users to recover any previous result - no other educational app offers this level of transparency.
User Empowerment:
- Complete history of all AI operations
- One-click recovery of any AI result
- Full transparency in AI interactions
- User control over AI-processed content
📱 Mobile-First Educational Design
Achieved seamless mobile functionality with floating panels and touch-optimized interfaces, making advanced AI tutoring accessible on any device.
Responsive Innovation:
- Floating quiz panels for mobile devices
- Touch-friendly text selection for AI features
- Responsive progress charts
- Mobile-optimized note editor
🏗️ Zero-Server Architecture
Built a complete educational platform that requires no backend infrastructure - reducing costs, improving privacy, and enabling offline learning.
Technical Excellence:
- Client-side authentication with SHA-256 hashing
- IndexedDB for persistent local storage
- Base64 image storage for cross-session persistence
- Complete offline functionality
🎯 CBC Curriculum Alignment
Designed features specifically for Kenya's Competency-Based Curriculum, focusing on skill development, understanding assessment, and competency tracking.
Educational Alignment:
- Topic-based note organization
- Competency-focused quiz questions
- Skill development tracking
- Understanding over memorization
⚡ Performance Optimization
Achieved smooth performance with response caching, handling thousands of notes without slowdown.
Performance Metrics:
- Sub-100ms note loading times
- Efficient AI model memory management
- Optimized IndexedDB queries
- Smooth animations and transitions
🔧 TypeScript Excellence
Created comprehensive type definitions for experimental Chrome AI APIs, ensuring type safety while working with cutting-edge browser features.
Developer Experience:
// Custom type definitions for Chrome AI
interface AIActivity {
id: string;
timestamp: Date;
action: 'rewrite' | 'translate' | 'summarize' | 'image_ocr' | 'clean';
originalText: string;
resultText: string;
}
🌍 Social Impact Achievement
Built an educational tool that addresses real challenges in Kenya's education system:
- Digital Divide: Works offline, reducing internet dependency
- Privacy Concerns: Local processing protects student data
- Language Barriers: Multilingual support for diverse communities
- Resource Constraints: Free, open-source alternative to expensive EdTech
🚀 Innovation in Browser AI
Pioneered the use of Chrome's built-in AI APIs for educational applications, demonstrating the potential of local AI processing in real-world applications.
Technical Firsts:
- First educational app using Chrome AI APIs
- Local AI quiz generation
- Browser-based OCR with AI enhancement
- Client-side educational analytics
🎨 User Experience Excellence
Created an intuitive, educational-focused interface that makes advanced AI accessible to students of all technical levels.
UX Achievements:
- Clean, distraction-free design
- Intuitive AI interaction patterns
- Comprehensive onboarding flow
- Accessibility-compliant interface
What we learned
Technical Insights
- Local AI is the Future: Browser-based AI eliminates privacy concerns and server costs
- Progressive Enhancement: Build core functionality first, then add AI enhancements
- Type Safety Matters: Custom TypeScript definitions prevent runtime errors
- Performance First: Optimize for mobile and low-end devices from the start
Educational Technology Principles
- Privacy by Design: Students need control over their learning data
- Offline Capability: Internet connectivity shouldn't limit learning access
- Competency Focus: Assessment should test understanding, not memorization
- User Agency: Students should control their AI interactions and data
Development Best Practices
- Comprehensive Error Handling: Experimental APIs require robust fallbacks
- Data Migration Planning: Plan for schema changes from day one
- Mobile-First Design: Complex educational tools must work on all devices
- User Testing: Educational software requires extensive student feedback
What's next for CBC Tutor
🎯 Immediate Roadmap (Next 6 Months)
- Voice Integration: Chrome Speech API implementation
- PWA Development: Mobile-first progressive web app
- Advanced Analytics: Learning pattern analysis
- Browser Extension: Web content capture and enhancement
- Open Source Release: Community-driven development
🌟 Long-Term Vision (2-3 Years)
Transforming Global Education
- 50,000 Students: Serve learners across 5+ countries
- Educational Standard: Become the privacy-first AI learning platform
- Research Impact: Publish studies on local AI in education
- Policy Influence: Shape educational technology privacy standards
CBC Tutor is just the beginning. Our vision is to create a global ecosystem of privacy-preserving educational AI that empowers students worldwide while keeping their data secure and their learning personalized. The future of education is local, intelligent, and completely under student control.
Log in or sign up for Devpost to join the conversation.