| | <!DOCTYPE html> |
| | <html lang="en"> |
| | <head> |
| | <meta charset="UTF-8"> |
| | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| | <title>Learning Engine API | QuantumCode</title> |
| | <link rel="icon" type="image/x-icon" href="/static/favicon.ico"> |
| | <script src="https://cdn.tailwindcss.com"></script> |
| | <script src="https://unpkg.com/feather-icons"></script> |
| | <style> |
| | @import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap'); |
| | |
| | body { |
| | font-family: 'Space Grotesk', sans-serif; |
| | background-color: #0f172a; |
| | color: #e2e8f0; |
| | } |
| | |
| | .gradient-text { |
| | background: linear-gradient(90deg, #7c3aed 0%, #2563eb 100%); |
| | -webkit-background-clip: text; |
| | background-clip: text; |
| | color: transparent; |
| | } |
| | |
| | .glass-card { |
| | background: rgba(15, 23, 42, 0.7); |
| | backdrop-filter: blur(10px); |
| | border: 1px solid rgba(255, 255, 255, 0.1); |
| | border-radius: 1rem; |
| | } |
| | |
| | .endpoint-card { |
| | border-left: 4px solid #7c3aed; |
| | } |
| | |
| | code { |
| | background: rgba(124, 58, 237, 0.2); |
| | padding: 0.2rem 0.4rem; |
| | border-radius: 0.25rem; |
| | font-family: monospace; |
| | } |
| | </style> |
| | </head> |
| | <body class="min-h-screen"> |
| | <nav class="px-6 py-4 flex justify-between items-center"> |
| | <div class="flex items-center space-x-2"> |
| | <i data-feather="cpu" class="text-indigo-500"></i> |
| | <span class="text-xl font-bold gradient-text">QuantumCode</span> |
| | </div> |
| | <div class="flex items-center space-x-2"> |
| | <a href="i18n-setup.html" class="flex items-center text-sm hover:text-indigo-400 transition-colors"> |
| | <i data-feather="globe" class="w-4 h-4 mr-1"></i> |
| | <span id="currentLang">EN</span> |
| | </a> |
| | </div> |
| | <div class="hidden md:flex space-x-8"> |
| | <a href="index.html" class="hover:text-indigo-400 transition-colors">Home</a> |
| | <a href="index.html#features" class="hover:text-indigo-400 transition-colors">Features</a> |
| | <a href="index.html#roadmap" class="hover:text-indigo-400 transition-colors">Roadmap</a> |
| | <a href="data-architecture.html" class="hover:text-indigo-400 transition-colors">Data Architecture</a> |
| | <a href="learning-engine.html" class="text-indigo-400">Learning Engine</a> |
| | <a href="auth.html" class="hover:text-indigo-400 transition-colors">Login</a> |
| | <a href="select-role.html" class="hover:text-indigo-400 transition-colors">Roles</a> |
| | <a href="progress-report.html" class="hover:text-indigo-400 transition-colors">Progress</a> |
| | <a href="self-talk-journal.html" class="hover:text-indigo-400 transition-colors">Self-Talk</a> |
| | <a href="gamequest.html" class="hover:text-indigo-400 transition-colors">GameQuest</a> |
| | </div> |
| | </nav> |
| | |
| | <main class="container mx-auto px-4 py-16"> |
| | <section class="max-w-6xl mx-auto mb-20"> |
| | <h1 class="text-4xl md:text-5xl font-bold mb-6"> |
| | <span class="gradient-text">Learning Engine</span> API Documentation |
| | </h1> |
| | <p class="text-xl text-slate-300 mb-10"> |
| | RESTful API for managing courses, modules, lessons and tracking learning metrics. |
| | </p> |
| | |
| | <div class="glass-card endpoint-card p-8 mb-12"> |
| | <h2 class="text-2xl font-bold mb-6">Course Structure</h2> |
| | <div class="mb-8"> |
| | <h3 class="text-xl font-bold mb-4">Courses → Modules → Lessons Hierarchy</h3> |
| | <div class="bg-slate-800/50 p-6 rounded-lg mb-6"> |
| | <pre><code> |
| | { |
| | "course": { |
| | "id": "string", |
| | "title": "string", |
| | "description": "string", |
| | "modules": [ |
| | { |
| | "id": "string", |
| | "title": "string", |
| | "lessons": [ |
| | { |
| | "id": "string", |
| | "title": "string", |
| | "exercises": [ |
| | { |
| | "id": "string", |
| | "type": "speaking|listening|vocabulary|grammar|speak-brave" |
| | } |
| | ] |
| | } |
| | ] |
| | } |
| | ] |
| | } |
| | } |
| | </code></pre> |
| | </div> |
| | </div> |
| | </div> |
| |
|
| | <div class="glass-card endpoint-card p-8 mb-12"> |
| | <h2 class="text-2xl font-bold mb-6">API Endpoints</h2> |
| | |
| | <div class="mb-8"> |
| | <h3 class="text-xl font-bold mb-4 flex items-center"> |
| | <span class="px-3 py-1 bg-indigo-900/30 text-indigo-400 rounded mr-3">GET</span> |
| | <code>/api/courses</code> |
| | </h3> |
| | <p class="text-slate-300 mb-4">Retrieve all available courses</p> |
| | <div class="bg-slate-800/50 p-6 rounded-lg"> |
| | <pre><code>// Response |
| | [ |
| | { |
| | "id": "course-123", |
| | "title": "Beginner English", |
| | "description": "Basic English for beginners", |
| | "language": "en", |
| | "difficulty": "beginner" |
| | } |
| | ]</code></pre> |
| | </div> |
| | </div> |
| | |
| | <div class="mb-8"> |
| | <h3 class="text-xl font-bold mb-4 flex items-center"> |
| | <span class="px-3 py-1 bg-green-900/30 text-green-400 rounded mr-3">POST</span> |
| | <code>/api/courses</code> |
| | </h3> |
| | <p class="text-slate-300 mb-4">Create a new course (Admin only)</p> |
| | <div class="bg-slate-800/50 p-6 rounded-lg"> |
| | <pre><code>// Request Body |
| | { |
| | "title": "Advanced English", |
| | "description": "Advanced English course", |
| | "language": "en", |
| | "difficulty": "advanced" |
| | } |
| |
|
| | // Response |
| | { |
| | "id": "course-456", |
| | "status": "created" |
| | }</code></pre> |
| | </div> |
| | </div> |
| | </div> |
| |
|
| | <div class="glass-card endpoint-card p-8 mb-12"> |
| | <h2 class="text-2xl font-bold mb-6">Progress Tracking</h2> |
| | |
| | <div class="mb-4"> |
| | <h3 class="text-xl font-bold mb-4 flex items-center"> |
| | <span class="px-3 py-1 bg-purple-900/30 text-purple-400 rounded mr-3">PATCH</span> |
| | <code>/api/lessons/{lessonId}/progress</code> |
| | </h3> |
| | <p class="text-slate-300 mb-4">Update lesson progress metrics</p> |
| | <div class="bg-slate-800/50 p-6 rounded-lg"> |
| | <pre><code>// Request Body |
| | { |
| | "speaking": { |
| | "score": 75, |
| | "timeSpent": 120, |
| | "attempts": 3 |
| | }, |
| | "listening": { |
| | "score": 80, |
| | "timeSpent": 90, |
| | "attempts": 2 |
| | }, |
| | "vocabulary": { |
| | "score": 90, |
| | "timeSpent": 60, |
| | "attempts": 1 |
| | }, |
| | "grammar": { |
| | "score": 70, |
| | "timeSpent": 150, |
| | "attempts": 4 |
| | }, |
| | "speakBraveScore": { |
| | "confidence": 85, |
| | "clarity": 80, |
| | "fluency": 75, |
| | "emotionalImpact": 90, |
| | "transcript": "I believe in my ability to speak English confidently...", |
| | "emotions": [ |
| | {"emotion": "happy", "score": 0.85}, |
| | {"emotion": "neutral", "score": 0.12}, |
| | {"emotion": "sad", "score": 0.03} |
| | ], |
| | "facialExpressions": [ |
| | {"expression": "smile", "intensity": 0.8}, |
| | {"expression": "eyeContact", "intensity": 0.7} |
| | ] |
| | }, |
| | "confidence": 85, |
| | "completionStatus": "completed", |
| | "masteryPercentage": 78.75 |
| | } |
| |
|
| | // Response |
| | { |
| | "lessonId": "lesson-789", |
| | "updated": true, |
| | "report": { |
| | "totalTime": 420, |
| | "totalAttempts": 10, |
| | "weakestArea": "grammar", |
| | "nextSteps": [ |
| | "Review past tense exercises", |
| | "Practice with audio drills", |
| | "Complete bonus vocabulary quiz" |
| | ] |
| | } |
| | }</code></pre> |
| | </div> |
| | </div> |
| | </div> |
| | |
| | <div class="glass-card p-8 mb-12"> |
| | <h2 class="text-2xl font-bold mb-6">VoiceTrack Module</h2> |
| | <p class="text-slate-300 mb-6">Test the voice analysis API with real-time recording and feedback.</p> |
| | <div class="grid md:grid-cols-2 gap-8 mb-12"> |
| | <voice-track></voice-track> |
| | <ai-dialog></ai-dialog> |
| | </div> |
| | <div class="mt-6"> |
| | <h3 class="text-xl font-bold mb-4 flex items-center"> |
| | <span class="px-3 py-1 bg-purple-900/30 text-purple-400 rounded mr-3">POST</span> |
| | <code>/voice/analyze</code> |
| | </h3> |
| | <p class="text-slate-300 mb-4">Analyze voice recordings for pronunciation and confidence</p> |
| | <div class="bg-slate-800/50 p-6 rounded-lg"> |
| | <pre><code>// Request: Multipart form with audio file |
| | // Response |
| | { |
| | "pronunciation": 85, |
| | "confidence": 78, |
| | "fluency": 82, |
| | "clarity": 80, |
| | "feedback": [ |
| | "Work on vowel sounds", |
| | "Good pacing overall", |
| | "Slightly nervous tone detected" |
| | ] |
| | }</code></pre> |
| | </div> |
| | </div> |
| | </div> |
| | </section> |
| | </main> |
| | <script src="components/voice-track.js"></script> |
| | <script src="components/ai-dialog.js"></script> |
| | <footer class="py-12 border-t border-slate-800"> |
| | <div class="container mx-auto px-4 text-center"> |
| | <p class="text-slate-500 text-sm"> |
| | © 2023 QuantumCode AI Architect. All rights reserved. |
| | </p> |
| | </div> |
| | </footer> |
| | <script> |
| | |
| | document.getElementById('currentLang').textContent = |
| | document.cookie.match('(^|;)\\s*NEXT_LOCALE\\s*=\\s*([^;]+)')?.pop() || 'EN'; |
| | |
| | feather.replace(); |
| | </script> |
| | </body> |
| | </html> |