Java Learning Hub is an interactive web-based platform for learning Java programming. It combines a code editor, AI-powered tutoring via Groq, and a structured curriculum with direct Java execution in the browser.
- Java code runs directly in your browser
- Uses Judge0 CE API (ce.judge0.com)
- No Java installation required!
- Fast and reliable execution
- Powered by Groq API (Llama 3.3 70B model)
- Context-aware responses based on current lesson
- Interactive teaching style with examples
- Helps debug code and explains concepts
- CodeMirror editor with Dracula theme
- Java syntax highlighting
- Auto-indentation
- Line numbers
- Multiple font family options
- 53 comprehensive lessons
- 8 modules from basics to advanced
- Progress tracking with localStorage
- W3Schools-based content
- Dark theme (default)
- Light theme
- Night/Amber theme for easy reading
- Mobile-friendly layout
- Touch-friendly resize handles
- Works on all screen sizes
- ARIA labels and roles
- Keyboard navigation
- Screen reader support
- Focus indicators
- Service worker for offline support
- Web app manifest
- Installable on home screen
User clicks Run → Code sent to Judge0 API → Compiled & Executed → Output displayed
The app uses the Judge0 CE API for compilation and execution:
- Language ID: 62 (Java)
- Timeout: 10 seconds
User sends message → Groq API → AI response → Displayed in chat
The AI tutor has context awareness:
- Knows current lesson
- Can see user's code
- Provides contextual help
├── index.html # Main application
├── styles.css # Styling with theme support
├── app.js # Core application logic
├── groq-service.js # Groq API integration
├── lessons.js # 53 lesson curriculum
├── server.js # Node.js static server
├── sw.js # Service worker for offline
├── manifest.json # PWA manifest
├── package.json # Dependencies and scripts
├── AGENTS.md # This documentation
└── README.md # User guide
- Model:
llama-3.3-70b-versatile - Rate Limits: 14,000 requests/day, 30 requests/minute
- API Key: Stored in localStorage (user provides)
- Primary: Judge0 CE API (ce.judge0.com)
- Language ID: 62 (Java)
const state = {
currentLesson: null, // Active lesson object
editor: null, // CodeMirror instance
isAITyping: false, // AI typing state
progress: {
completedLessons: [],
completedExercises: [],
totalLessons: 55
}
};Executes Java code using the online compiler API.
Sends user message to AI tutor and displays response.
Loads lesson content and updates editor with example code.
Sends lesson context to AI for explanation.
- Chrome 80+
- Firefox 75+
- Safari 13+
- Edge 80+
- CodeMirror 5.65.16 - Code editor
- Google Fonts - JetBrains Mono, Inter
- Judge0 API - Online Java compiler
Edit lessons.js:
{
id: "lesson-id",
title: "Lesson Title",
duration: "15 min",
content: {
description: "...",
keyPoints: ["...", "..."]
},
example: `public class Main { }`,
explanation: "..."
}Edit groq-service.js system prompt for different teaching styles.
MIT License - Use freely for learning!