An interactive, AI-powered coding tutor designed to help users learn and improve their programming skills. This application provides real-time analysis, error detection, and improvement suggestions for code snippets in multiple languages by leveraging the Google Gemini API.
MasterCode AI — an AI-powered coding assistant for interactive learning and instant code feedback.
- 📝 Multi-Language Code Editor: A clean, intuitive editor to write and test code in Python, JavaScript, Java, C++, and C.
- 🤖 AI-Powered Analysis: Leverages the Google Gemini API to provide instant, expert feedback on your code.
- 🐛 Error Detection & Explanation: Identifies bugs and syntax errors, explaining them in simple, easy-to-understand terms tailored to the user's skill level.
- ✨ Improvement Suggestions: Receives actionable suggestions on best practices, code readability, and performance.
- ✅ Corrected Code: View a complete, corrected version of your code to learn from mistakes.
- 🚀 Guided Learning Path: Follow a structured 'Python Path' from basic concepts to advanced algorithms, with tasks that integrate directly into the code tutor.
- 📊 Personalized Dashboard: Track your progress, total points, daily streak, and skill development across different languages.
- 👤 Customizable Profile: Personalize your username and avatar.
- ☀️ Dark & Light Modes: A sleek UI with theme toggling for user comfort.
The application takes the user's code, selected programming language, and difficulty level. It sends this data to the Google Gemini API with a specialized system prompt instructing the AI to act as an expert coding tutor. The AI's response is then streamed back to the user and parsed into a structured, easy-to-read format, providing a comprehensive analysis and corrected code.
- Frontend: React, TypeScript
- Build Tool: Vite
- AI Integration: Google Gemini API (
@google/genai) - Styling: Tailwind CSS (via CDN)
- State Management: React Context API
- Data Visualization: Recharts
- Node.js (LTS version recommended)
- A package manager like
npmoryarn - An API key.
-
Clone the repository:
git clone https://github.com/gdvtramarao/ai-tutor.git cd ai-tutor -
Install dependencies:
npm install
-
Set up your environment variables:
- Create a new file named
.env.localin the root of your project. - Add your Gemini API key to this file:
API_KEY=your_gemini_api_key_here
Note: The
.env.localfile is included in.gitignoreto ensure your API key is not committed to version control. - Create a new file named
-
Run the development server:
npm run dev
The application should now be running on
http://localhost:5173(or another port if 5173 is in use).
Contributions are welcome! If you have suggestions for improvements or want to fix a bug, please feel free to open an issue or submit a pull request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.