Skip to content

The web app

apps/web is a single-page React 19 app built with Vite. It has no router beyond the machine address: it’s an operating system, not a website.

Folder Holds
system/shell/ ShellController: Welcome, desktop, locked, Turn Off
system/session/ AuthClient, UserSession, settings, demo-mode switch (backend.ts)
system/machine/ The /m/<slug>/ address and the machine picker
system/files/ The FileSystem interface and everything built on it
system/dialogs/ Shared dialogs: Open, Save As, Find, Font, message boxes
shell/ The desktop itself: icons, taskbar, Start menu, appearance
wm/ The window manager: window store, geometry, the Window component
apps/ The app registry (registry.tsx) and the programs: Explorer, Notepad, …
messenger/ Messenger: client, store, effects, calls, activities, UI
ie/ Retro Internet Explorer and the site list (sites.ts)
sites/ The Retro Web sites
games/ The game catalog: rules, computer opponents and boards by kind
sound/, toast/ Synthesized sounds and pop-up toasts
  • Per person: everything on the UserSession, made at logon and dropped at Log Off.
  • Per screen: the window, toast and sound stores, which are global and reset at Log Off.
  • Server data: TanStack Query caches REST answers; Messenger’s Zustand store is kept up to date by ServerEvents.

Each service sits behind an interface with a real and a mock implementation:

Interface Real Demo mode
AuthClient HttpAuthClient MockAuthClient
MessengerClient SocketClient MockClient
FileSystem ServerFileSystem MemoryFileSystem
MatchClient RemoteMatchClient createLocalMatch
CallTransport WebRtcTransport MockCallTransport

SocketClient holds one Socket.IO connection and reconnects by itself. The Messenger class turns events into toasts, sounds and window behavior through a MessengerEffects interface, which tests replace with spies.

Messages and names are never rendered as HTML. @retro/emoticons tokenizes them into text, emoticon, link and color spans, and validates each color.