A mobile-first educational coding simulator that helps beginners learn programming by translating between code and natural language.
-
Code → Data (Explanation Mode)
- Analyze code and provide structured explanations
- 4-part format: Summary, Variables, Steps, Output
- Support for Python, Java, TypeScript, and C++
- Error highlighting and handling
-
Data → Code (Generation Mode)
- Convert natural language descriptions to code
- Generate runnable code snippets
- Support for all 4 programming languages
- Automatic type detection and variable naming
-
Examples Library
- 32 built-in examples covering all languages
- Easy-to-use modal interface
- Organized by language and mode
-
User Interface
- Mobile-first responsive design
- Dark/Light mode toggle
- Language selector
- Mode toggle (Code → Data | Data → Code)
- Action buttons (Run, Clear, Examples, Settings)
- Node.js 18+
- npm or yarn
-
Clone the repository
-
Install dependencies:
npm install
-
Run the development server:
npm run dev
-
Open http://localhost:3000 in your browser
- Select your programming language
- Choose "Code → Data" mode
- Paste your code in the input area
- Click "Run" to analyze
- View the structured explanation in 4 parts:
- Summary: One-sentence description
- Variables: Table with name, type, and value
- Steps: Line-by-line actions
- Output: Expected print result
- Select your target programming language
- Choose "Data → Code" mode
- Write a natural language description
- Click "Run" to generate code
- View the generated code and expected output
- Click the "Examples" button
- Select your language and mode
- Browse the available examples
- Click "Use Example" to load it
- Framework: Next.js 15 with App Router
- Language: TypeScript 5
- Styling: Tailwind CSS 4
- UI Components: shadcn/ui
- Syntax Highlighting: react-syntax-highlighter
- Theme: next-themes for dark/light mode
- AI: Z-AI Web Dev SDK for code analysis and generation
Analyzes code and provides structured explanation.
Request:
{
"code": "x = 10\nprint(x)",
"language": "python"
}Response:
{
"summary": "Defines x=10 and prints it",
"variables": [
{
"name": "x",
"type": "int",
"value": "10"
}
],
"steps": ["Line 1 define x", "Line 2 print x"],
"output": "10"
}Converts natural language to code.
Request:
{
"description": "My name is Sarah",
"language": "python"
}Response:
{
"code": "name = \"Sarah\"\nprint(name)",
"output": "Sarah"
}- Mobile-first: Optimized for mobile screens
- Responsive: Works on all device sizes
- Dark/Light Mode: User preference support
- Accessible: WCAG compliant where possible
- Intuitive: Clean, beginner-friendly interface
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
src/
├── app/
│ ├── api/
│ │ ├── analyze-code/ # Code analysis endpoint
│ │ └── generate-code/ # Code generation endpoint
│ ├── layout.tsx # Root layout with theme provider
│ └── page.tsx # Main application page
├── components/
│ ├── ui/ # shadcn/ui components
│ ├── code-explanation.tsx
│ ├── generated-code.tsx
│ ├── examples-modal.tsx
│ ├── settings-modal.tsx
│ └── theme-provider.tsx
└── globals.css
The application includes 32 built-in examples:
- Python: Variables (int, string, float, boolean)
- Java: Variables (int, double, String, boolean)
- TypeScript: Variables (number, string, boolean)
- C++: Variables (int, double, string, bool)
- Python: Name, age, GPA, active status
- Java: City, temperature, score, access
- TypeScript: Count, price, title, status
- C++: Height, weight, name, admin status
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
- Built with Next.js
- Powered by Z.AI SDK
- UI components from shadcn/ui
- Styling with Tailwind CSS