A web application that helps users deeply understand programming code by explaining it in their own words.
- View code snippets in C, Python, C++, or Java (no comments)
- AI splits code into logical teaching units
- Explain each unit in plain English
- Get AI-powered semantic evaluation
- Learn through understanding, not memorization
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env.local
# Add your OPENAI_API_KEY to .env.local
# Run development server
npm run devOpen http://localhost:3000 to see the app.
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Styling: TailwindCSS
- Code Editor: Monaco Editor
- Database: PostgreSQL (Prisma ORM)
- AI: OpenAI GPT-4o-mini
src/
├── app/ # Next.js App Router pages
│ ├── page.tsx # Landing page
│ ├── learn/page.tsx # Language & difficulty selection
│ └── practice/page.tsx # Main learning interface
├── components/ # React components
│ ├── code-editor.tsx # Monaco editor wrapper
│ ├── feedback-card.tsx # Evaluation feedback display
│ ├── progress-bar.tsx # Progress tracking
│ └── selectors.tsx # Language/difficulty selectors
└── lib/
├── prompts/ # AI prompt templates
│ ├── code-splitter.ts
│ └── evaluation.ts
├── data/ # Sample snippets
│ └── sample-snippets.ts
└── services/ # AI service layer
└── ai-service.ts
- Landing → "Let's get started"
- Language Selection → Choose C, Python, C++, or Java
- Difficulty Selection → Beginner, Intermediate, Advanced
- Code Presentation → See code with highlighted teaching unit
- Explain → Write what the code does in plain English
- Feedback → Get AI evaluation with missing concepts
- Progress → Move to next unit or retry
Two production-ready prompts are included:
-
Code Splitter (
src/lib/prompts/code-splitter.ts)- Splits code into semantic teaching units
- Generates beginner-friendly explanations
- Extracts key concepts for evaluation
-
Evaluation (
src/lib/prompts/evaluation.ts)- Semantic comparison (meaning, not keywords)
- Identifies matched/missing concepts
- Provides constructive feedback and hints
See prisma/schema.prisma for the complete data model including:
- Users & Preferences
- Code Snippets & Teaching Units
- Attempts & Progress tracking
- AI response caching
# Database
DATABASE_URL="postgresql://..."
# OpenAI
OPENAI_API_KEY="sk-..."
# Auth (optional)
NEXTAUTH_SECRET="..."
NEXTAUTH_URL="http://localhost:3000"See SYSTEM_DESIGN.md for:
- Complete learning flow diagrams
- AI prompt specifications
- Feedback design guidelines
- Difficulty level definitions
- Technical architecture
- 7-day MVP plan
- Educational principles
The UI follows the mockups with:
- Dark theme (#1a1a1a background)
- Primary accent: #00ff87 (green)
- Language colors: C (cyan), Python (green), C++ (purple), Java (yellow)
- Monospace font for code (JetBrains Mono)
MIT