# Microtables - LLM Navigation Guide ## Project Overview A lightweight spreadsheet application positioned between a calculator and a full office suite — fast loading, common spreadsheet operations. ## Architecture - `/frontend/` - ClojureScript (Reagent + re-frame, shadow-cljs). Fully functional standalone. - `/server/` - Express, minimal; will eventually handle persistence and collaboration. ## Key Concepts ### Data Structure The spreadsheet data is a nested map: `{column-letter {row-number {:value ...}}}` Example: ```clojure {"A" {1 {:value 78 :inbound [...]} 3 {:value "=B2 * 4" :refs [...]}} "B" {2 {:value "=A1 + 3" :refs [...] :inbound [...]}}} ``` ### Formula System - Formulae start with `=` and are evaluated using **math.js** library - Range syntax supported: `=sum(A1:A10)` - Cell references create a **doubly-linked tree structure**: - `:refs` - forward references (cells this formula depends on) - `:inbound` - back references (cells that depend on this cell) - `:display` - computed/evaluated value shown to user - `:value` - raw user input - `:dirty` - flag indicating re-evaluation needed ### Evaluation Flow A cell change re-parses references, updates `:refs`/`:inbound`, evaluates the cell, then recursively evaluates its `:inbound` queue (cycle detection prevents infinite loops). ## Development Notes - `todo.md` has a running list of desired changes - Data structures prioritize clarity over micro-optimization (small dataset assumption) ## Common Tasks - **Install an npm dependency**: add it to `shadow-cljs.edn` (not just `package.json`), then restart the dev server