How jewinjibu/eduspark works
Purpose and Runtime
EduSpark 2.1 is a TypeScript React learning platform: curriculum browsing, topic learning, quizzes, missions, flashcards, progress, an IDE, certificates, and an AI-assisted coding workspace. The browser app is built and served by Vite; a separate Node/Express service proxies AI requests to OpenRouter. Entry points are src/main.tsx, src/App.tsx, and server/server.js.
Application Shell and Navigation
src/App.tsx is the likely composition and route-selection boundary for page-level experiences. Shared presentation and fault containment sit around those pages through src/components/AppLayout.tsx and src/components/ErrorBoundary.tsx. Page modules under src/pages/, notably src/pages/LearningWorkspace.tsx, src/pages/IDEPage.tsx, and src/pages/SubjectDetailPage.tsx, own major user workflows rather than a server-rendered backend.
Learning Content and Curriculum Flow
Curriculum is primarily client-owned static data: subject, course, lesson, quiz, mission, and flashcard definitions in src/data/subjects.ts, src/data/lessons.ts, and src/data/courseSchema.json (with language-specific JSON datasets alongside them). Users move from subject/topic views into learning content and practice; reusable content renderers include src/components/LanguageSection.tsx, src/components/LessonCard.tsx, and src/components/CodePractice.tsx.
User State, Authentication, and Persistence Boundary
Firebase is the external identity/application-service boundary, initialized in src/lib/firebase.ts. Authentication state is exposed through src/contexts/AuthContext.tsx and consumed via src/hooks/useAuth.ts. Learning-state concerns are separated into focused hooks—progress, streaks, missions, notifications, recommendations, and spaced repetition—such as src/hooks/useProgress.ts, src/hooks/useMissions.ts, and src/hooks/useSpacedRepetition.ts; shared client state utilities reside in src/lib/store.ts.
Learning Feature Modules
Feature directories package interactive learning surfaces independently from general pages: quizzes (src/features/quiz/QuizPanel.tsx), flashcards (src/features/flashcards/FlashcardPanel.tsx), missions (src/features/missions/MissionPanel.tsx), and mastery/progress (src/features/progress/MasteryPanel.tsx). This creates a flow from static curriculum and authenticated learner state into task-specific panels, then back into progress-oriented hooks/state.
IDE and AI Coding OS
The coding environment is split between a conventional IDE workspace—src/features/ide/IDE.tsx, src/features/ide/IDEWorkspace.tsx, src/features/ide/VisualBlockEditor.tsx—and the broader AI Coding OS at src/features/ai-coding-os/AICodingOS.tsx. The latter organizes Learn/Build/Debug/Review/Ship/Grow stages through panel modules such as src/features/ai-coding-os/panels/BuildPanel.tsx and src/features/ai-coding-os/panels/DebugPanel.tsx, backed by local concepts, paths, templates, and progression logic in src/features/ai-coding-os/data/ and src/features/ai-coding-os/lib/progression.ts.
AI Service and Deployment Boundary
The browser must not call OpenRouter with credentials directly. server/server.js owns /api/ai/* proxy behavior, obtains OPENROUTER_API_KEY from server/.env, and can enforce Bearer-token and CORS-origin controls. The front end’s AI integration surface includes src/hooks/useAIModels.ts; requests cross from Vite-hosted client code to Express, then OpenRouter. Production frontend deployment is configured by vercel.json; the Express server remains a separately runnable/deployable Node service.
Main entry points: LearningWorkspace.tsx Learning pages · App.tsx App and route selection · subjects.ts Curriculum datasets · useProgress.ts Learner state hooks
Components 19
Browser application
Vite-built React client.
- React entry
src/main.tsx - App and route selection
src/App.tsx - Layout and error boundary
src/components/AppLayout.tsx - Learning pages · Subject detail, learning workspace, and IDE page experiences.
src/pages/LearningWorkspace.tsx
Learning domain
Curriculum, learner state, and practice modules.
- Curriculum datasets · Subjects, lessons, schemas, and language datasets.
src/data/subjects.ts - Learning content renderers · Lesson, language, and code-practice surfaces.
src/components/LanguageSection.tsx - Auth context
src/contexts/AuthContext.tsx - Firebase · Identity and application-service boundary.
src/lib/firebase.ts - Learner state hooks · Progress, missions, streaks, recommendations, and spaced repetition.
src/hooks/useProgress.ts - Quiz panel
src/features/quiz/QuizPanel.tsx - Flashcard panel
src/features/flashcards/FlashcardPanel.tsx - Mission panel
src/features/missions/MissionPanel.tsx - Mastery panel
src/features/progress/MasteryPanel.tsx
Coding workspaces
IDE and AI-assisted coding experiences.
- IDE workspace · Conventional IDE and visual block editing workspace.
src/features/ide/IDEWorkspace.tsx - AI Coding OS · Learn, Build, Debug, Review, Ship, and Grow stages.
src/features/ai-coding-os/AICodingOS.tsx - AI progression logic · Local paths, templates, concepts, and progression.
src/features/ai-coding-os/lib/progression.ts - AI model client
src/hooks/useAIModels.ts
AI service boundary
Credentials stay behind the Express proxy.
- Express AI proxy · Owns /api/ai/*, credentials, Bearer controls, and CORS.
server/server.js - OpenRouter
Connections 20
- React entry → App and route selection: mounts
- App and route selection → Layout and error boundary: wraps with
- App and route selection → Learning pages: selects workflows
- Learning pages → Curriculum datasets: browses
- Learning pages → Learning content renderers: renders
- Learning pages → IDE workspace: opens
- Learning pages → AI Coding OS: opens
- Auth context → Firebase: uses
- App and route selection → Auth context: provides session
- Curriculum datasets → Quiz panel: supplies practice data
- Curriculum datasets → Flashcard panel: supplies cards
- Curriculum datasets → Mission panel: supplies missions
- Quiz panel → Learner state hooks: records outcomes
- Flashcard panel → Learner state hooks: updates repetition
- Mission panel → Learner state hooks: updates progress
- Learner state hooks → Mastery panel: drives
- AI Coding OS → AI progression logic: uses
- AI Coding OS → AI model client: requests assistance
- AI model client → Express AI proxy: calls /api/ai/*
- Express AI proxy → OpenRouter: proxies authenticated requests