How the engine, the endpoint, the CLI and the web app fit together.

Architecture

Foundry, Hardhat, viem, wallet ──> src/proxy  (JSON-RPC endpoint)
hardhat-shadowfork, web app    ──>     │ local methods          │ other methods
npx shadowfork                 ──> src/engine                   │
                                       │                        │
                                   src/core/rpc.ts (failover, batching, record and replay)
                                       │
                                   QIE mainnet archive RPC
Module Role
src/engine/state.ts Lazy fork, shared per block, with a learned batch prefetch: QIE state at block N fetched on first read (balance, nonce and code in one batch, storage per slot), with a journaled overlay for checkpoints and reverts, and a per-transaction record of first reads for prestate and diffs
src/engine/tracer.ts geth-format callTracer and prestateTracer from EVM step and message events, plus a gas profile
src/engine/engine.ts QIE's ruleset, block headers, state overrides, unsigned transactions, the fee floor, replay and debug_traceCall
src/engine/simulate.ts eth_simulateV1, asset changes, gas advice, oracle reads
src/engine/regress.ts, layout.ts, fuzz.ts Upgrade regression, storage layout check, invariant fuzzing
src/engine/explain.ts, preview.ts, sandwich.ts Revert explanation, wallet preview, sandwich exposure
src/engine/verify.ts, src/server/status.ts Differential verification, run hourly by the server
src/proxy/server.ts The endpoint
src/server/ Web API, the /rpc mount, the monitor and SQLite
web/ The info page and docs (static) and the tools app (/app/)

The EVM itself is EthereumJS (MPL-2.0). The state layer, the tracer, the QIE rules and the comparison logic are this project's.