This folder documents the current implementation of @civ-clone/web-renderer to support a full rewrite.
architecture-overview.mdmodule-inventory.mdruntime-data-flow.mdbackend-worker.mdfrontend-ui.mdplugin-and-translation-loading.mdasset-system.mdbuild-and-release.mdknown-issues-and-rewrite-notes.mdmemory-testbed.mdui-stress-harness.mdperformance-review-2026-06.mdmemory-growth-analysis-2026-07.md
- Capture how the current code behaves, not how it should ideally work.
- Highlight coupling points and risk areas for rewrite planning.
- Keep depth medium: broad system coverage with targeted details where architecture depends on them.
- Frontend and backend are both TypeScript bundles.
- Backend runs inside a Web Worker and hosts game engine/client logic.
- Frontend owns DOM, canvas rendering, input handling, and interaction windows.
- Backend sends initial game data + incremental patches over a typed message transport.
- UI reconstructs object graphs from plain objects and re-renders from that state.
- App shell:
index.html - Frontend entry:
src/js/frontend.ts - Backend entry:
src/js/backend.ts - Backend orchestrator:
src/js/Engine/Game.ts - Backend data bridge:
src/js/Engine/DataTransferClient.ts - Frontend orchestrator:
src/js/UI/Renderer.ts - Asset import UI:
src/js/UI/components/ImportAssetsWindow.ts - Asset storage/cache:
src/js/UI/AssetStore.ts