https://codepath-ai-frontend.onrender.com/
CodePath AI is a production-ready web application designed to help beginners learn programming through:
- Micro-Lessons: Bite-sized lessons covering programming fundamentals
- Hands-On Coding: In-browser code editor with real-time execution
- AI-Guided Hints: Intelligent mentoring that guides without giving solutions
- Progress Tracking: Streaks, badges, and leaderboards to keep you motivated
The AI Mentor NEVER provides complete solutions. Instead, it offers:
- Conceptual explanations
- Logical hints and guiding questions
- Error reasoning and debugging guidance
- Optimization suggestions and best practices
This approach ensures learners develop problem-solving skills rather than just copying code.
- Java with DSA - Java fundamentals and Data Structures & Algorithms
- Data Science - Python, NumPy, Pandas, and data analysis
- AI Engineer - Machine learning concepts and implementations
- FastAPI - Modern Python web framework
- MongoDB - NoSQL database with Motor async driver
- JWT - Secure authentication with access & refresh tokens
- Piston API - Safe code execution in isolated containers
- React 18 - UI library with hooks
- Vite - Lightning-fast build tool
- Tailwind CSS - Utility-first styling
- Monaco Editor - VS Code's editor in the browser
- Zustand - Lightweight state management
- React Router v6 - Client-side routing
Project ownership is divided into these modules:
- User Management & Authentication
- Learning Content & Micro-Lessons
- Coding Practice & AI Guidance
- Progress Tracking & Recommendation
The backend now registers routes through module entrypoints in backend/modules/, and the frontend route wiring imports module entrypoints from frontend/src/modules/.
For full file ownership mapping and push order, see MODULE_SPLIT.md.
codepath-ai/
βββ backend/
β βββ main.py # FastAPI application entry
β βββ config/
β β βββ database.py # MongoDB connection
β β βββ settings.py # Environment settings
β βββ models/
β β βββ user.py # User model
β β βββ lesson.py # Lesson model
β β βββ problem.py # Problem model
β β βββ progress.py # Progress model
β β βββ ai_hint.py # AI hint model
β βββ routes/
β β βββ auth.py # Authentication endpoints
β β βββ lessons.py # Lesson CRUD
β β βββ practice.py # Problem solving
β β βββ progress.py # Progress tracking
β β βββ ai_mentor.py # AI hint endpoints
β βββ services/
β β βββ auth_service.py # Auth business logic
β β βββ lesson_service.py # Lesson operations
β β βββ problem_service.py # Problem operations
β β βββ code_execution_service.py # Piston API
β β βββ progress_service.py # Stats & badges
β β βββ ai_mentor_service.py # AI mentoring
β βββ ai/
β β βββ prompts.py # AI prompt templates
β βββ utils/
β βββ security.py # JWT & password utils
βββ frontend/
β βββ src/
β β βββ main.jsx # React entry
β β βββ App.jsx # Routes & layouts
β β βββ components/
β β β βββ layouts/ # MainLayout, AuthLayout
β β β βββ editor/ # CodeEditor, OutputPanel, AIHintPanel
β β βββ pages/
β β β βββ HomePage.jsx
β β β βββ DashboardPage.jsx
β β β βββ LessonsPage.jsx
β β β βββ ProblemsPage.jsx
β β β βββ ProblemSolvePage.jsx
β β β βββ ProgressPage.jsx
β β β βββ ProfilePage.jsx
β β β βββ auth/
β β βββ services/ # API service layer
β β βββ stores/ # Zustand stores
β βββ package.json
β βββ vite.config.js
β βββ tailwind.config.js
βββ requirements.txt
βββ Dockerfile
βββ .env.example
βββ README.md
- Python 3.11+
- Node.js 18+
- MongoDB (local or Atlas)
- OpenAI or Anthropic API key
-
Clone the repository
git clone https://github.com/yourusername/codepath-ai.git cd codepath-ai -
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Configure environment
cp .env.example .env # Edit .env with your settings -
Run the backend
cd backend uvicorn main:app --reload --host 0.0.0.0 --port 8000
-
Install dependencies
cd frontend npm install -
Start development server
npm run dev
-
Build for production
npm run build
Create a .env file with the following:
# MongoDB
MONGODB_URL=mongodb://localhost:27017
DATABASE_NAME=codepath_ai
# JWT
JWT_SECRET_KEY=your-super-secret-key-min-32-chars
JWT_ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
REFRESH_TOKEN_EXPIRE_DAYS=7
# AI Provider (choose one)
OPENAI_API_KEY=sk-your-openai-key
# OR
ANTHROPIC_API_KEY=your-anthropic-key
# Piston API
PISTON_API_URL=https://emkc.org/api/v2/piston
# Frontend URL (for CORS)
FRONTEND_URL=http://localhost:5173
# Environment
ENVIRONMENT=development| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Register new user |
| POST | /api/auth/login |
Login user |
| POST | /api/auth/refresh |
Refresh access token |
| POST | /api/auth/change-password |
Change password |
| GET | /api/auth/me |
Get current user |
| PUT | /api/auth/profile |
Update profile |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/lessons |
List lessons |
| GET | /api/lessons/{id} |
Get lesson details |
| GET | /api/lessons/tracks |
Get learning tracks |
| POST | /api/lessons/{id}/complete |
Mark as complete |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/practice/problems |
List problems |
| GET | /api/practice/problems/{id} |
Get problem |
| POST | /api/practice/problems/{id}/run |
Run code |
| POST | /api/practice/problems/{id}/submit |
Submit solution |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/ai/hint |
Get AI hint |
| POST | /api/ai/analyze-error |
Analyze code error |
| POST | /api/ai/ask |
Ask AI question |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/progress/stats |
Get user stats |
| GET | /api/progress/badges |
Get earned badges |
| GET | /api/progress/leaderboard |
Get leaderboard |
# Build the image
docker build -t codepath-ai .
# Run the container
docker run -d -p 8000:8000 \
-e MONGODB_URL=your-mongo-url \
-e JWT_SECRET_KEY=your-secret \
-e OPENAI_API_KEY=your-key \
codepath-ai- Create a new Web Service on Render
- Connect your GitHub repository
- Set build command:
pip install -r requirements.txt - Set start command:
cd backend && uvicorn main:app --host 0.0.0.0 --port $PORT - Add environment variables in Render dashboard
# Backend tests
cd backend
pytest
# Frontend tests
cd frontend
npm test- π Structured micro-lessons by track
- π» In-browser code editor with syntax highlighting
- π€ AI mentor for guidance (never gives solutions!)
- π Progress tracking with streaks and badges
- π Leaderboard to compete with others
- Create and manage lessons
- Add coding problems with test cases
- Configure AI prompt settings
- View user analytics
The AI strictly follows these guidelines:
- NEVER provide complete code solutions
- NEVER write the function body or implementation
- ALWAYS guide with questions and hints
- FOCUS on teaching concepts and problem-solving
Example AI response:
"I notice you're trying to find the maximum element. Think about this: what happens when you compare two numbers? How could you use that comparison as you go through each element?"
- Fork the repository
- 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
For questions or issues, please open a GitHub issue or contact the team.