TypeScriptZustandCanvas APIReactIndexedDB

Nocturn OS

A fully browser-native operating system concept — complete windowing system, virtual file manager, terminal emulator, and app launcher — built entirely in TypeScript without a single native dependency.

Terminal
Files
Browser
11:42 PM
Terminal

~ ls -la

drwxr-xr-x Documents/

drwxr-xr-x Projects/

-rw-r--r-- notes.md

~ cat notes.md

# Ideas for v2...

~

Files — /home
📁Documents
📁Projects
📄notes.md
🖼️screenshot.png
🌐
⚙️
🎵

Role

Solo Developer

Timeline

2-3 days

Scope

Concept / Experiment

The Challenge

How far can the browser really go?

This started as a question: could a browser tab convincingly simulate a desktop OS with no server, no native code, and no Electron? That meant solving window management, a virtual filesystem, process isolation, and inter-app communication — all in JavaScript.

The Approach

A layered system architecture in the DOM

Each "app" is a React subtree mounted into a window container managed by a Zustand store acting as the kernel. IndexedDB serves as persistent storage for the virtual filesystem. The terminal interprets a custom command set against this in-memory state.

System components

Window manager

Drag, resize, minimize, maximize, and z-order stacking — all via pointer events and a Zustand window registry.

Virtual filesystem

IndexedDB-backed VFS with POSIX-like paths, file metadata, and read/write/delete operations exposed to all apps.

Terminal emulator

Interprets a custom shell with 20+ commands including ls, cat, mkdir, rm, cd, and a rudimentary pipe operator.

App launcher

Spotlight-style fuzzy search launcher that opens apps, searches files, and runs commands from a single keystroke.

Canvas renderer

Custom Canvas API layer for pixel-level UI effects — scanlines, CRT glow, and the boot animation sequence.

Inter-app messaging

A simple pub/sub event bus lets apps communicate — the file manager can open files in registered viewer apps.

Reflection

What this project taught me

Building OS primitives from scratch in the browser is one of the best ways to understand why operating systems are designed the way they are. Every shortcut I tried to take — skipping proper z-index management, using React state instead of a proper store, ignoring event propagation — created bugs that were only fixable by doing it the "right" way.

The most valuable insight: complexity budgets are real. Every abstraction layer adds overhead. Nocturn OS works, but it taught me exactly why Electron exists — and why sometimes native is the right call.

Interested in working together?

I'm available for new projects and collaborations.

anthonycilmi4@gmail.com