Skip to content

NeuroForgeLabs/CodePilot-AI

Repository files navigation

πŸš€ CodePilot AI

Open-source, AI-powered coding interview preparation platform with algorithm practice, interactive syntax training, and guided coaching.

✨ Features β€’ 🏁 Quick Start β€’ πŸ—οΈ Architecture β€’ πŸ› οΈ Tech Stack β€’ 🀝 Contributing

Developed by Anvar Baltakhojayev


✨ Features

🧩 100 Curated Problems β€” Challenges from Easy to Hard across 21 topic categories including arrays, trees, graphs, dynamic programming, backtracking, and more.

🌐 9 Programming Languages β€” Write and execute code in Python, JavaScript, TypeScript, Java, C++, C, Go, Rust, and C#.

πŸ“š Interactive Syntax Trainer β€” 13 curriculum categories with ~500 hands-on exercises across all 9 languages. Learn data structure patterns and language syntax through guided practice with instant feedback.

πŸ“ Monaco Editor β€” The same editor powering VS Code, with syntax highlighting, bracket colorization, and font ligatures.

⚑ Code Execution β€” Run your code against visible and hidden test cases via Judge0, with real-time execution time and memory stats.

πŸ’‘ AI-Guided Hints β€” Three modes to match your practice style:

Mode Style Description
πŸ”’ Strict No hints Pure interview simulation
πŸŽ“ Interviewer Socratic Guiding questions that nudge without revealing
πŸ“– Learning Direct Pseudocode, partial snippets, and explanations

Each mode supports 5 progressive hint levels β€” from a subtle nudge to a detailed walkthrough.

πŸ” AI Code Review β€” After running your code, get a senior-engineer-level debrief with overall feedback, time and space complexity analysis, edge cases to consider, and actionable improvements.

πŸ€– AI Mentor Chat β€” Context-aware AI assistant with two personalities: coaching mode for problems (no spoilers) and tutoring mode for syntax (teaches freely with code examples).

πŸ’Ύ Auto-Save β€” Your code is automatically saved to browser localStorage. Pick up right where you left off.

🎨 Modern Landing Page β€” Interactive homepage with animated hero, live code demo, mouse-parallax effects, and scroll-reveal animations.

πŸ“Œ Formerly known as "AI Interview Coach" β€” rebranded to CodePilot AI.


🏁 Quick Start

1️⃣ Environment Setup

cp .env.example .env.local

Edit .env.local and fill in your keys:

Variable Required Description
OPENAI_API_KEY βœ… OpenAI or compatible provider API key
OPENAI_BASE_URL ❌ Default: https://api.openai.com/v1
OPENAI_MODEL ❌ Default: gpt-4.1-mini
JUDGE0_URL βœ… Judge0 instance URL
X_RAPIDAPI_KEY βœ…* Required for RapidAPI-hosted Judge0

2️⃣ Start the Backend

cd server
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload --port 8000

3️⃣ Start the Frontend

npm install
npm run dev

Open πŸ‘‰ http://localhost:3000

4️⃣ (Optional) Start Infrastructure

docker compose up -d

🐳 Starts Postgres & Redis β€” scaffolded for future features, not required for the current MVP.


πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Browser (localhost:3000)                        β”‚
β”‚                                                                    β”‚
β”‚  / ................ Landing page (overview, live demo, features)  β”‚
β”‚  /practice ........ Problem solving + Syntax trainer workspace   β”‚
β”‚  /contact ......... Contact page                                  β”‚
β”‚                                                                    β”‚
β”‚  β”Œβ”€ Practice: Problems View ──────────────────────────────────┐  β”‚
β”‚  β”‚ 100 problems | Difficulty & topic filters | Search          β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚  β”Œβ”€ Practice: Workspace ──────────────────────────────────────┐  β”‚
β”‚  β”‚ Problem Panel β”‚ Monaco Editor β”‚ Tests|Hint|Review|AI tabs   β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚  β”Œβ”€ Practice: Syntax Trainer ─────────────────────────────────┐  β”‚
β”‚  β”‚ Learn|Reference β”‚ 9 Languages β”‚ 13 categories β”‚ AI Chat     β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                                                    β”‚
β”‚  localStorage ◄── Auto-save code attempts (debounced 1s) ──►    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
          POST /api/execute, /api/hint, /api/review,
          /api/syntax/explain, /api/syntax/check
          (Next.js API routes β†’ FastAPI)
                             β”‚
                             β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  FastAPI Backend (localhost:8000)                  β”‚
β”‚                                                                    β”‚
β”‚  ⚑ POST /execute       ──► Judge0 (code execution, 9 languages) β”‚
β”‚  πŸ’‘ POST /hint          ──► OpenAI-compatible LLM                 β”‚
β”‚  πŸ” POST /review        ──► OpenAI-compatible LLM                 β”‚
β”‚  πŸ“– POST /syntax/explain ──► LLM (syntax explain / translate)    β”‚
β”‚  βœ… POST /syntax/check   ──► Judge0 + pattern checks + LLM       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

codepilot-ai/
β”œβ”€β”€ 🌐 app/                          Next.js App Router
β”‚   β”œβ”€β”€ layout.tsx                    Root layout (Inter font, dark theme)
β”‚   β”œβ”€β”€ page.tsx                      Landing / homepage
β”‚   β”œβ”€β”€ practice/page.tsx             Practice workspace (Problems + Syntax)
β”‚   β”œβ”€β”€ contact/page.tsx              Contact page
β”‚   β”œβ”€β”€ globals.css                   Global styles + animations
β”‚   └── api/                          API proxy routes β†’ FastAPI
β”‚       β”œβ”€β”€ execute/route.ts
β”‚       β”œβ”€β”€ hint/route.ts
β”‚       β”œβ”€β”€ review/route.ts
β”‚       └── syntax/
β”‚           β”œβ”€β”€ explain/route.ts
β”‚           └── check/route.ts
β”œβ”€β”€ 🧱 components/                    React UI components
β”‚   β”œβ”€β”€ AIChatPanel.tsx               AI chat (dual mode: syntax/problem)
β”‚   β”œβ”€β”€ CodeEditor.tsx                Monaco editor + language picker
β”‚   β”œβ”€β”€ ProblemPanel.tsx              Problem description & examples
β”‚   β”œβ”€β”€ ProblemsView.tsx              Problem browser with filters
β”‚   β”œβ”€β”€ RightPanel.tsx                Tabbed panel (Tests/Hint/Review/AI)
β”‚   β”œβ”€β”€ TestResults.tsx               Execution results display
β”‚   β”œβ”€β”€ HintPanel.tsx                 Hint controls & display
β”‚   β”œβ”€β”€ ReviewPanel.tsx               AI review display
β”‚   └── syntax/                       Syntax Trainer components
β”‚       β”œβ”€β”€ SyntaxPanel.tsx           Main panel (Learn/Reference, language)
β”‚       β”œβ”€β”€ LessonTrainer.tsx         Interactive trainer with progress
β”‚       β”œβ”€β”€ TrainerSection.tsx        Exercise: explain β†’ example β†’ try β†’ check
β”‚       β”œβ”€β”€ ExerciseEditor.tsx        Monaco editor for exercises
β”‚       β”œβ”€β”€ FeedbackPanel.tsx         Exercise result + AI feedback
β”‚       β”œβ”€β”€ LessonView.tsx            Static reference lesson view
β”‚       β”œβ”€β”€ LessonList.tsx            Reference lesson grid
β”‚       └── SyntaxSnippet.tsx         Code snippet with copy button
β”œβ”€β”€ πŸ“š data/
β”‚   β”œβ”€β”€ problems/                     100 problem JSON definitions
β”‚   └── syntax/
β”‚       β”œβ”€β”€ lessons/                  4 static reference lessons
β”‚       └── trainer/                  117 interactive trainer lessons
β”‚           └── curriculum.json       13 category definitions
β”œβ”€β”€ πŸ”§ lib/                          Shared frontend utilities
β”‚   β”œβ”€β”€ types.ts                      TypeScript type definitions
β”‚   β”œβ”€β”€ problems.ts                   Problem loader (100 problems)
β”‚   β”œβ”€β”€ trainer.ts                    Trainer lesson loader (117 lessons)
β”‚   β”œβ”€β”€ syntax.ts                     Reference lesson loader
β”‚   └── storage.ts                    localStorage helpers
β”œβ”€β”€ 🐍 server/                        Python FastAPI backend
β”‚   β”œβ”€β”€ main.py                       App entry point, 7 endpoints
β”‚   β”œβ”€β”€ requirements.txt
β”‚   β”œβ”€β”€ models/schemas.py             Pydantic request/response models
β”‚   └── services/
β”‚       β”œβ”€β”€ judge0.py                 Judge0 integration (9 languages)
β”‚       β”œβ”€β”€ llm.py                    LLM client (hints, review, syntax)
β”‚       └── prompts.py                Prompt templates
β”œβ”€β”€ πŸ–ΌοΈ public/                        Static assets
β”‚   └── favicon.svg                   App favicon
└── 🐳 docker-compose.yml             Postgres + Redis (scaffolded)

πŸ—ΊοΈ Pages & Routes

Route Page Description
/ 🏠 Home Landing page with hero, feature grid, live code demo, how it works, open source section
/practice πŸ’» Practice Full workspace: Problems list, Syntax trainer, coding workspace with AI tools
/contact πŸ“¬ Contact Contact cards for email, LinkedIn, and GitHub

πŸ“‘ API Endpoints

Method Path Description
POST /execute ⚑ Run code against test cases via Judge0
POST /hint πŸ’‘ Generate AI hint (5 levels, 3 modes)
POST /review πŸ” Generate AI code review (structured JSON)
POST /syntax/explain πŸ“– AI syntax explanation with dual mode
POST /syntax/check βœ… Exercise validation: Judge0 + pattern checks + AI feedback
GET /health πŸ₯ Health check
GET /problems πŸ“‹ List all 100 problems
GET /problems/{id} πŸ”Ž Single problem details

πŸ”„ Using with Claude or Other Providers

The backend works with any OpenAI-compatible API. Update your .env.local:

# πŸ€– Anthropic Claude
OPENAI_BASE_URL=https://api.anthropic.com/v1
OPENAI_API_KEY=sk-ant-...
OPENAI_MODEL=claude-sonnet-4-20250514

# 🏠 Local model (Ollama, LM Studio, vLLM)
OPENAI_BASE_URL=http://localhost:11434/v1
OPENAI_API_KEY=not-needed
OPENAI_MODEL=llama3

πŸ› οΈ Tech Stack

Layer Technology
🌐 Frontend Next.js 14, React 18, TypeScript, Tailwind CSS, Monaco Editor
🐍 Backend Python FastAPI, Pydantic, Uvicorn
⚑ Execution Judge0 CE (9 languages)
πŸ€– AI OpenAI-compatible chat API (GPT, Claude, Llama, etc.)
πŸ’Ύ Storage Browser localStorage
🐳 Infra Docker Compose (Postgres + Redis scaffolded)

🀝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.


πŸ“„ License

MIT


⚑ CodePilot AI β€” Built with ❀️ by Anvar Baltakhojayev

Releases

No releases published

Packages

 
 
 

Contributors