Skip to content
/ bellum Public

Run EXEs and APKs directly in the browser with this advanced compiler. Please look at the contributors, I used AI once to try it out I swear πŸ˜­πŸ™

Notifications You must be signed in to change notification settings

xazalea/bellum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

459 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Bellum - Browser Runtime Platform

Discord

πŸ’¬ Join our Discord community for bugs, suggestions, or just chatting!

Browser-based runtime for games and applications using emulation, virtualization, and distributed computing.

Overview

Bellum enables running retro games and applications directly in the browser:

  • HTML5 Games - 20,000+ games from GameDistribution
  • Windows Emulation - Windows 98 via v86 emulator
  • Android Emulation - Experimental Android support
  • Cloud Storage - Distributed storage via Discord/Telegram
  • P2P Clustering - Distributed computing across browser instances
  • Google Compute Offloading - Free cloud compute via Google Translate infrastructure
  • Dual Platform Deployment - Optimized for both Vercel and Cloudflare Pages

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            Bellum Frontend (Next.js)        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚                 β”‚                β”‚
           β–Ό                 β–Ό                β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Games   β”‚      β”‚   v86    β”‚    β”‚  Cloud   β”‚
    β”‚  System  β”‚      β”‚ Emulator β”‚    β”‚ Storage  β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚                 β”‚                β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
                        β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚  IndexedDB/OPFS  β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Quick Start

# Install dependencies
npm install

# Run development server
npm run dev

# Open in browser
# Navigate to http://localhost:3000

Features

  • Games Page (/games) - Browse and play 20,000+ HTML5 games
  • Windows Page (/windows) - Run Windows 98 in browser via v86
  • Android Page (/android) - Experimental Android emulation
  • Library Page (/library) - Upload and run APK/EXE files
  • Storage Page (/storage) - Cloud file storage via Discord

Technology Stack

  • Frontend: Next.js 15, React 19, TypeScript
  • Styling: Tailwind CSS v4, Framer Motion, shadcn/ui, Magic UI
  • Storage: IndexedDB (via HiberFile), Discord/Telegram webhooks
  • Emulation: v86 (x86 emulator)
  • Compression: fflate (gzip), optional WASM
  • Auth: Firebase Authentication
  • Deployment: Vercel (primary), Cloudflare Pages (unlimited bandwidth)
  • Compute: Google Translate infrastructure for offloading web-based tasks

Feature Status

Currently Working

  • βœ… HTML5 Games: Browse and play 20,000+ games
  • βœ… Windows Emulation: Windows 98 via v86
  • βœ… Cloud Storage: File storage using Discord/Telegram
  • βœ… Authentication: Firebase auth with device fingerprinting
  • βœ… Compression: Automatic file compression (gzip/zstd)
  • βœ… Google Compute Offloading: Route web-based tasks to Google's infrastructure
  • βœ… Dual Platform Support: Deploy to both Vercel and Cloudflare
  • βœ… Modern UI: shadcn/ui and Magic UI components with matte design
  • βœ… Security Headers: Comprehensive security hardening (HSTS, COOP/COEP, CSP)

Experimental

  • ⚠️ Android Emulation: Basic Android support via v86
  • ⚠️ APK/EXE Upload: File upload with basic execution
  • ⚠️ P2P Clustering: Distributed computing (in development)

Not Yet Implemented

  • ❌ Native Binary Execution: JIT/GPU runtime are stubs
  • ❌ High Performance: No actual GPU compute or JIT
  • ❌ Full OS Support: Limited to what v86 can emulate

Core Components

Games System

  • XML parser for 20,000+ game catalog
  • Service worker for CORS proxy
  • Virtual scrolling for performance
  • Game install/save to library

v86 Emulator Integration

  • x86 emulation for Windows/DOS
  • Disk image loading from storage
  • Screen rendering to canvas
  • Input handling (keyboard/mouse)

Storage System (HiberFile)

  • IndexedDB for local storage
  • Chunked file storage (4MB chunks)
  • Compression support (gzip/zstd)
  • Cloud archival to Discord/Telegram
  • Hot/cold storage tiers

Experimental Features

  • GPU Benchmarking: WebGPU matrix multiply benchmark
  • JIT Stubs: Architecture for future JIT (not functional)
  • Binary Parser: PE/DEX format detection (basic)

Browser Requirements

  • Minimum: Chrome 90+, Firefox 90+, Safari 14+
  • Recommended: Chrome 113+ or Edge 113+ for WebGPU features
  • Required: IndexedDB support, JavaScript enabled
  • Optional: SharedArrayBuffer for better performance (requires HTTPS)

Development

# Install dependencies
npm install

# Run development server
npm run dev

# Build for production (Vercel)
npm run build

# Build for Cloudflare Pages
npm run build:cloudflare

# Deploy to Cloudflare
npm run deploy:cloudflare

# Build WASM modules (optional)
npm run build:wasm

Deployment

Vercel (Recommended)

  • Automatic deployment on push to main
  • Fast builds (~1 min)
  • 100GB/month bandwidth

Cloudflare Pages

  • Unlimited bandwidth
  • Edge runtime compatibility
  • Build command: npm run build:cloudflare
  • Output directory: .vercel/output/static

Key Features

Google Compute Offloading

  • Automatically routes web-based JavaScript tasks to Google's datacenter infrastructure
  • Reduces cluster load by 30-50%
  • Free cloud compute for web applications
  • See lib/google-compute/README.md for details

Security

  • Comprehensive security headers (HSTS, COOP/COEP, CSP)
  • Route-specific security policies
  • Cross-origin isolation for VM routes
  • Production-ready security hardening

Modern UI

  • shadcn/ui components
  • Magic UI effects (shimmer, gradients, animations)
  • Professional matte color scheme
  • Responsive design with smooth animations

Known Limitations

  • Emulation Speed: v86 is significantly slower than native
  • Binary Execution: Limited to what v86 can emulate
  • WebGPU: Only available in Chrome/Edge 113+
  • CORS: Some games may fail to load due to CORS restrictions
  • Storage: Discord/Telegram have file size limits (25MB)
  • Google Compute: Rate-limited, suitable for web-based tasks only

License

MIT License - See LICENSE file for details

About

Run EXEs and APKs directly in the browser with this advanced compiler. Please look at the contributors, I used AI once to try it out I swear πŸ˜­πŸ™

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •