Skip to content
mahesh2-labPublic

About

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

77 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Jyvra Boot Sequence


โ›ง Jyvra โšก โ€” Where Code Enters. Bytecode Leaves. โ˜•

"In the beginning, there was javac. And javac said: let there be .class files. And there were .class files. And the JVM looked upon them, and saw that they were good." โ€” The Book of Compilation, Chapter 1

Jyvra is a browser-based online Java compiler and execution arena โ€” a full-stack ritual chamber where mortals write Java, and the server compiles and runs it in real time. Monaco Editor on the frontend. Flask on the backend. The JVM in the shadows, waiting.


โ›ง The Boot Sequence

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                                                                  โ•‘
โ•‘  โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—   โ•‘
โ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—  โ•‘
โ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘  โ•‘ 
โ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•  โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘  โ•‘
โ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘  โ•‘
โ•‘  โ•šโ•โ•โ•šโ•โ•  โ•šโ•โ•  โ•šโ•โ•โ•โ•  โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•  โ•šโ•โ•โ•โ•โ•šโ•โ•  โ•šโ•โ•  โ•‘
โ•‘                                                                  โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

[BOOT] Jyvra v1.0 โ€” Summoning Protocol Initiated
[    ] Detecting host OS .................... โœ“ Linux
[    ] Locating javac binary ................ โœ“ /usr/bin/javac
[    ] Verifying JVM heartbeat .............. โœ“ OpenJDK 17.0.2
[    ] Raising Flask server from the void ... โœ“ Port 5000
[    ] Mounting Monaco Editor grimoire ...... โœ“ React 18.3
[    ] Binding frontend to backend .......... โœ“ Vite proxy locked
[    ] Warming the classloader .............. โœ“ Ready

[SYSTEM] The Arena is open.
[SYSTEM] May your semicolons be plentiful, and your NullPointers few.

>>> Listening on http://localhost:5000

โšก Invocation

The ritual has two paths. Choose your summoning method.

๐Ÿ”ฎ Path I โ€” The Automated Rite (Recommended)

On Linux / macOS:

chmod +x start.sh
./start.sh

On Windows:

start.bat

The script will install all dependencies, build the frontend, and raise the server automatically. Open http://localhost:5000 when the incantation completes.

๐Ÿ“œ Path II โ€” The Manual Ritual (For Those Who Seek Control)

Prerequisites โ€” Gather Your Artifacts

Artifact Minimum Recommended
JDK Any OpenJDK 17+
Node.js 16+ 18+
Python 3.7+ 3.13+
npm Bundled with Node Latest

Step 1 โ€” Install the Dependencies

npm install
pip install -r requirements.txt

Step 2 โ€” Forge the Frontend

npm run build

Step 3 โ€” Raise the Server

python server.py

You should witness:

Java Compiler Server - Detected OS: Linux
โœ“ Java compiler found and ready
Starting unified server on http://localhost:5000
Serving React frontend + Java Compiler API

Step 4 โ€” Enter the Arena

Open http://localhost:5000 in your browser.

๐Ÿณ Path III โ€” The Docker Containment (For the Disciplined)
docker-compose up --build

One command. One container. One arena. Port 5000. Done.

โš™๏ธ Development Mode (Live Reload)

If you wish to modify the arena while it runs:

# Terminal 1 โ€” The Frontend Watcher
npm run dev

# Terminal 2 โ€” The Backend Daemon
python server.py

The frontend will hot-reload. The backend will persist. Chaos under control.


โ˜• Features of the Abyss

Feature Description
Monaco Editor The same editor that powers VS Code โ€” syntax highlighting, autocomplete, the works
Real-Time Compilation Write Java โ†’ hit Run โ†’ see output. No pages to refresh. No files to save.
Server-Side Execution Your code compiles and runs on the actual JVM. Not an emulator. Not a sandbox. The real thing.
Cross-Platform Windows, Linux, macOS โ€” the arena doesn't discriminate
Split-Pane Layout Resizable editor and output panels. Because one screen is all you need.
10s Execution Timeout Infinite loops are detected and terminated. The arena has rules.
Docker Support One docker-compose up to rule them all
Client-side Java execution via WebAssembly when the server is unreachable

๐Ÿ›๏ธ Architecture of the Ritual

                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚         THE MORTAL (You)        โ”‚
                    โ”‚      Writes Java in browser     โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                   โ”‚
                                   โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚       MONACO EDITOR (React)     โ”‚
                    โ”‚   TypeScript ยท Tailwind ยท Vite  โ”‚
                    โ”‚     Syntax highlighting, etc.   โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                   โ”‚  POST /api/compile
                                   โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚       FLASK SERVER (Python)     โ”‚
                    โ”‚    Receives code via REST API   โ”‚
                    โ”‚    Writes temp .java file       โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                   โ”‚  javac + java
                                   โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚        JVM (The Beast)          โ”‚
                    โ”‚   Compiles โ†’ Executes โ†’ Returns โ”‚
                    โ”‚   stdout / stderr / exit code   โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                   โ”‚
                                   โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚         OUTPUT PANEL            โ”‚
                    โ”‚  Real-time results in browser   โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

File Structure โ€” The Sacred Geometry

JavaRena/
โ”œโ”€โ”€ src/                    # React + TypeScript source (the frontend grimoire)
โ”‚   โ”œโ”€โ”€ components/         # UI components (shadcn/ui + Radix)
โ”‚   โ”œโ”€โ”€ pages/              # Application pages
โ”‚   โ”œโ”€โ”€ hooks/              # Custom React hooks
โ”‚   โ”œโ”€โ”€ lib/                # Utility functions
โ”‚   โ””โ”€โ”€ App.tsx             # The root incantation
โ”œโ”€โ”€ server.py               # Flask backend (the summoner)
โ”œโ”€โ”€ dist/                   # Built frontend (generated by npm run build)
โ”œโ”€โ”€ public/                 # Static assets
โ”œโ”€โ”€ Dockerfile              # Docker containment spell
โ”œโ”€โ”€ docker-compose.yml      # Orchestration ritual
โ”œโ”€โ”€ start.bat               # Windows startup script
โ”œโ”€โ”€ start.sh                # Linux/Mac startup script
โ”œโ”€โ”€ requirements.txt        # Python dependencies
โ”œโ”€โ”€ package.json            # Node dependencies
โ”œโ”€โ”€ vite.config.ts          # Vite configuration
โ”œโ”€โ”€ tailwind.config.ts      # Tailwind configuration
โ””โ”€โ”€ tsconfig.json           # TypeScript configuration

๐Ÿ“ก API Endpoints โ€” The Protocols

GET /api/health โ€” Check the Server Pulse
curl http://localhost:5000/api/health
POST /api/compile โ€” Submit Code to the Arena
curl -X POST http://localhost:5000/api/compile \
  -H "Content-Type: application/json" \
  -d '{"code":"public class Main { public static void main(String[] args) { System.out.println(\"Hello from the Arena!\"); } }"}'
GET /api/info โ€” Server Intelligence Report
curl http://localhost:5000/api/info

๐Ÿ“– The First Ritual โ€” A Java Offering

Paste this into the editor and hit Run. If the output appears, the JVM has accepted your offering.

public class Main {
    public static void main(String[] args) {
        System.out.println("โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—");
        System.out.println("โ•‘   The Arena acknowledges you.     โ•‘");
        System.out.println("โ•‘   Your code compiled.             โ•‘");
        System.out.println("โ•‘   The JVM has spoken.             โ•‘");
        System.out.println("โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•");

        String[] truths = {
            "Semicolons are not optional.",
            "Everything is an object. Except primitives.",
            "Checked exceptions build character.",
            "The garbage collector giveth, and it taketh away."
        };

        System.out.println("\n--- Truths of the JVM ---");
        for (int i = 0; i < truths.length; i++) {
            System.out.println((i + 1) + ". " + truths[i]);
        }

        System.out.println("\nTotal truths revealed: " + truths.length);
    }
}

โš”๏ธ Rules of the Realm

  1. Your class must be named Main โ€” The arena expects public class Main with a public static void main(String[] args) entry point.
  2. 10-second execution limit โ€” Infinite loops will be slain. The arena does not wait.
  3. Standard I/O only โ€” System.out and System.err are your voice. GUI and file I/O are beyond the arena's walls.
  4. One file, one class โ€” This is a compiler, not an IDE. Keep it focused.
  5. No external dependencies โ€” The JVM standard library is your toolkit. No Maven. No Gradle. Just raw Java.

๐Ÿ”ฎ Future Rituals

  • Multi-file support โ€” Summon multiple classes into the arena
  • Stdin support โ€” Let users feed input to running programs
  • Syntax error highlighting โ€” Mark the lines where the JVM weeps
  • Code sharing โ€” Shareable links for arena submissions
  • Multiple languages โ€” Python, C++, and other mortals may enter
  • User accounts โ€” Save your rituals for future sessions
  • Dark/light theme toggle โ€” Choose your allegiance

๐Ÿฉธ Who Should Enter

You Are Verdict
A student learning Java Enter. This was built for you.
A developer testing a quick snippet Enter. No IDE boot time. No project setup.
Someone who wants to run Java in a browser Enter. That's literally what this does.
A recruiter asking candidates to live-code Enter. Share the link. Watch them type.
Someone who thinks JavaScript is Java Turn back. This is not your realm.

๐Ÿ› ๏ธ Troubleshooting โ€” When the Ritual Fails

"Java compiler not found"

Install the JDK (not just JRE). Then restart your terminal.

# Ubuntu/Debian
sudo apt-get install openjdk-17-jdk

# macOS
brew install openjdk

# Windows โ†’ download from https://openjdk.org/install/
"Frontend not built yet"
npm run build
python server.py
Port 5000 already in use

Edit server.py and change the port number:

app.run(debug=False, host="0.0.0.0", port=5001)  # Changed from 5000
Python module not found
pip install -r requirements.txt

Footer

Built with โ˜• and questionable life choices. Licensed under MIT.

About

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages