$ show MercuryWorkshop/anuraOS
AnuraOS is a browser-based desktop environment and development platform that runs entirely in the browser, featuring a full window manager (AliceWM), taskbar, launcher, notification center, and a suite of built-in apps (file manager, terminal, settings, browser, marketplace, etc.). It includes a complete x86 emulation subsystem via v86, allowing users to boot a custom Alpine Linux virtual machine with persistent disk storage, PTY multiplexing, and network relay through the Wisp protocol. The system is designed as a Progressive Web App (PWA) with offline support via service workers and uses IndexedDB for filesystem and settings persistence. The architecture is modular: core APIs (filesystem, networking, window management, settings, processes, notifications) are exposed through a global `anura` object. Apps are defined by manifests and can be either iframe-based or manual scripts, with support for versioned libraries imported via `anura.import()`. The filesystem uses an abstract provider pattern (`AFSProvider`) with multiple backends (Filer, LocalFS/OPFS). The x86 subsystem manages a v86 emulator with persistent disk images stored in IndexedDB, and integrates with the host OS through a custom mouse driver and network relay. While the codebase demonstrates strong engineering with clean abstractions (e.g., filesystem providers, window manager, notification service), it also exhibits some technical debt: large monolithic files (v86.tsx, Boot.tsx), use of `eval` in legacy handlers, memory leaks in the x86 disk cache, and race conditions in boot sequencing. The x86 image build process requires Linux, Docker, and specific toolchains, limiting portability. Overall, AnuraOS is a sophisticated and functional webOS with reusable components, but its complexity and some outdated patterns suggest moderate maintenance overhead.
The LLM identified 4 files worth highlighting for reuse:
Defines `AFSProvider<TStats>` and `AFSShell` classes that provide an abstract, pluggable filesystem interface. The provider pattern allows multiple backends (Filer, LocalFS, custom) to be used interchangeably. The shell class offers common operations (cat, ls, find, rm, mkdirp, cpr) that work across any provider. This is a clean, reusable abstraction that could be extracted for any project needing a virtual filesystem with multiple storage backends.
Implements a notification service with methods like `anura.notifications.add()` supporting title, description, timeout, and action buttons. It manages a queue of notifications and renders them via a React-like component. The API is simple and decoupled from the rest of the system, making it reusable as a standalone notification library for web applications.
Provides a context menu component that can be triggered on any element. Supports nested items, icons, and separators. The implementation is self-contained and uses a declarative API (`anura.ContextMenu`). It could be extracted and used in any web project needing a customizable right-click menu.
Implements the Wisp protocol for proxying WebSocket and TCP connections. The `WispBus` class handles frame encoding/decoding, stream management, and connection lifecycle. This is a clean, protocol-level implementation that could be reused in other projects needing Wisp client support, independent of the AnuraOS environment.