In this video, you traced one Small Maps order with READ20, for Nadia Patel, from the click on Place order to what The Second Draft stores, and checked the trace with one run.
Key Points
- A trace starts where the user acts. A search for the button’s label,
Place order, findspublic/admin/index.html. The form there has the idorder-form, the name the page’s JavaScript finds it by. A search for that id leads to line 73 ofpublic/admin/app.js, where#order-formmarks it as an id. - The staff desk page runs in your browser and sends the form to the server at
/api/orders. The server sends the result back as its reply. - Follow the code in the order it runs, and write each step down with its file and function. A function you haven’t opened, such as
handleForm(),runCommand()orjson(), is a black box. Describe it from its name, arguments and folder. Mark what you assume it changes, like the filesrunCommand()writes, as an assumption until a run checks it. - At every step, ask: does it write, send or schedule anything? A trace that only follows the reply back to
Saved order-2misses most of whatcreateOrder()changes. Those changes happen in memory, throughstate, and reach a file only whenrunCommand()writes them. - A trace you’ve only read is still a prediction. Add a
console.log()line at the steps and run the feature once. A log line shows that a step ran. The stored data shows what it changed.
The Trace
Here’s the entry the video added to your map. Each step names its file and function, then what it changes, in the order the code runs when staff click Place order. Step four started as an assumption about runCommand(), a function you haven’t opened, and the run turned it into a checked fact: