GitHub - PramithaMJ/java-masterclass
Java Engineering Masterclass ๐
An interactive, production-grade React application for mastering advanced Java/JVM concepts through visual simulations and deep-dive theory.
๐ฏ Features
Interactive Simulators
| Module | Description | Visualization |
|---|---|---|
| Garbage Collection | Eden, Survivor, Old Gen memory pools | Object allocation & GC cycles |
| Concurrency | Monitor locks, Entry/Wait sets | Thread state transitions |
| JIT Compilation | Tiered compilation (Interpreted โ C1 โ C2) | Profiling & optimization |
| Java Memory Model | CPU caches, Main Memory, Volatile | Cache coherence & visibility |
| Static vs Instance | Metaspace vs Heap memory layout | Static field sharing |
Educational Theory
Each module includes comprehensive "Engineer's Guide" content covering:
- Under-the-hood JVM internals
- Best practices and anti-patterns
- Thread safety considerations
- Performance implications
๐๏ธ Architecture
Built following SOLID principles with a modular, scalable architecture:
src/
โโโ components/ # Reusable UI components
โ โโโ Layout/ # Header, Layout wrapper
โ โโโ UI/ # Button, Console, MemoryBlock
โ โโโ Hub/ # Module selection grid
โโโ features/ # Feature modules (one per topic)
โ โโโ gc/ # Garbage Collection
โ โโโ threads/ # Concurrency
โ โโโ jit/ # JIT Compilation
โ โโโ jmm/ # Java Memory Model
โ โโโ static/ # Static vs Instance
โโโ hooks/ # Custom React hooks (simulation logic)
โโโ contexts/ # React Context providers
โโโ types/ # TypeScript type definitions
โโโ App.tsx # Root application component
๐ Getting Started
Prerequisites
- Node.js 18+
- npm or yarn
Installation
# Clone the repository git clone https://github.com/pramithamj/java-masterclass.git cd java-masterclass # Install dependencies npm install # Start development server npm run dev
Open http://localhost:5173 in your browser.
Build for Production
npm run build
npm run preview # Preview production build locally๐ Deployment
GitHub Pages
The app is configured for GitHub Pages deployment:
- Build the project:
npm run build - Push to your repository
- Enable GitHub Pages in repository settings (deploy from
gh-pagesbranch or/docsfolder)
Note: The
basepath invite.config.tsmust match your repository name.
๐ Module Details
Garbage Collection Simulator
Visualize the Generational Hypothesis in action:
- Eden Space: Where new objects are allocated
- Survivor Space: Objects that survive Minor GC
- Old Generation: Long-lived objects (tenured)
- Trigger Minor GC and Full GC to see object lifecycle
Concurrency Simulator
Understand Java's Monitor Lock mechanism:
- See threads competing for synchronized blocks
- Watch Entry Set (blocked) and Running states
- Visualize lock acquisition and release
JIT Compilation Simulator
Watch code get "hot" and tiered compilation kick in:
- Interpreted: Initial slow execution
- C1 Compiler: Quick compilation, basic optimizations
- C2 Compiler: Aggressive optimization (inlining, escape analysis)
Java Memory Model Lab
Understand visibility and happens-before:
- CPU L1 caches vs Main Memory
- Volatile writes flush to memory
- Non-volatile reads may see stale data
Static vs Instance Lab
Visualize where static and instance members live:
- Metaspace: Class-level static fields (shared)
- Heap: Per-instance fields (unique per object)
- See how static changes affect ALL instances
๐ ๏ธ Technology Stack
- React 19 - UI framework with hooks
- TypeScript 5.9 - Type safety
- Vite 7 - Fast build tool with HMR
- CSS Modules - Scoped styling
- ESLint - Code quality
๐ Design Principles
- Single Responsibility (SRP): Each component/hook has one clear purpose
- Open/Closed (OCP): Easy to add new modules without modifying core
- Dependency Inversion (DIP): Contexts provide injectable dependencies
- Interface Segregation (ISP): Small, focused type interfaces
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- 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
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Inspired by the need for better JVM education tools
- Built with modern React best practices
- Designed for developers learning advanced Java concepts